This content has been marked as final. Show 3 replies
The beans in I2 should be annotated with @Alternative and the alternatives must be declared in the beans.xml of the war file.
Unfortunately it does not working. I am using jboss AS 7.
- ear contains war
- the war contains the beans.xml (with alternative entry) in WEB-INF
- jar B is located in war in WEB-INF/lib (jar B contains also beans.xml in META-INF)
- injection point is in a JSF controller (jar in WEB-INF/lib in war)
Always I1 is injected. But I do not know if I explained it clearly. I1 is always present. I2 is optional but shall have a higher priority.
Did you fix it? If not can you explain more about how the deployment is done. How do you decide to include the alternative or not not? Did you confirm that all your beans in the alternative jar have @Alternative annotations?