This works as designed. The SeContainerInitializer.selectAlternatives() method enables the alternatives only for the synthetic bean archive, ie. for the beans added through the SeContainerInitializer.addBeanClasses() and SeContainerInitializer.addPackages methods. It's a programmatic alternative to the <alternatives> element of the beans.xml file. If isolation is disabled a "flat" deployment structure is used - all bean classes share the same bean archive and all beans.xml descriptors are merged into one. In this case, SeContainerInitializer.selectAlternatives() effectively enables the alternatives globally. If you need to enable an alternative globally you can use the @javax.annotation.Priority annotation - see Declaring selected alternatives for an application. |