Details
Description
The Bean Deployment Archive visibility graph does not correctly implement the spec.
Beans in WEB-INF/lib are made availible to beans in WEB-INF/classes, however the converse is not true (i.e. beans is WEB-INF/classes cannot be injected into WEB-INF/lib injection points), and beans in one jar in WEB-INF/lib cannot be injected into beans in a different jar in WEB-INF/lib.
According to the CDI and EE6 Platform spec both of these should work.
-
Hide
- weld-osgi-bundle.jar
- 2.54 MB
- mimik789
-
- META-INF/MANIFEST.MF 17 kB
- META-INF/DEPENDENCIES.txt 4 kB
- META-INF/LICENSE.txt 11 kB
- META-INF/maven/.../guava/pom.properties 0.1 kB
- META-INF/maven/.../guava/pom.xml 3 kB
- META-INF/maven/.../cdi-api/pom.properties 0.1 kB
- META-INF/maven/.../cdi-api/pom.xml 7 kB
- META-INF/maven/.../javassist/pom.properties 0.1 kB
- META-INF/maven/.../javassist/pom.xml 8 kB
- META-INF/maven/.../pom.properties 0.1 kB
- META-INF/maven/.../pom.xml 2 kB
- META-INF/maven/.../pom.properties 0.1 kB
- META-INF/maven/.../pom.xml 0.8 kB
- META-INF/maven/.../weld-api/pom.properties 0.1 kB
- META-INF/maven/.../weld-api/pom.xml 1 kB
- META-INF/maven/.../weld-core/pom.properties 0.1 kB
- META-INF/maven/.../weld-core/pom.xml 9 kB
- META-INF/maven/.../pom.properties 0.1 kB
- META-INF/maven/.../weld-osgi-bundle/pom.xml 8 kB
- META-INF/maven/.../weld-spi/pom.properties 0.1 kB
- META-INF/maven/.../weld-spi/pom.xml 3 kB
- META-INF/maven/.../pom.properties 0.1 kB
- META-INF/maven/.../slf4j-jdk14/pom.xml 2 kB
- beans_1_0.xsd 8 kB
- beans_1_1.xsd 8 kB
- ch/qos/cal10n/BaseName.class 0.4 kB
- ch/qos/cal10n/Cal10nConstants.class 1 kB
- ch/qos/cal10n/IMessageConveyor.class 0.4 kB
- ch/qos/cal10n/Locale.class 0.4 kB
- ch/qos/cal10n/LocaleData.class 0.5 kB
Issue Links
- duplicates
-
GLASSFISH-15906
CDI resolver issues
-
- Resolved
-
- is duplicated by
-
GLASSFISH-15888
CDI not working well on Glassfish v3.1 RC1 and RC2
-
- Resolved
-
-
GLASSFISH-15794
JAX-RS injection broken for library @Providers
-
- Resolved
-
Activity
Added issue to 3.1 Known Issues section in 3.1-3.1.1 Release Notes.
This issue has been fixed since the integration of Weld 1.1.1.Final (that fixes root cause WELD-846) into GlassFish 3.1.1(b4+) and GlassFish trunk.
Through svn revision 47397, I have also added the following developer tests to cover this scenario
javaee-integration/cdi-servlet-3.0-annotation-with-web-inf-lib/
As for Glassfish 3.1.1b11 I think the issue might not be solved, although my problem differs from the original issue.
I have an EAR with an ejb module and some jars in the lib directory.
A dependency in a class that resides in the lib directory cannot be satisfied. This dependency should be solved by a class in my ejb module, but it seems that the class in the ejb module is not visible to the class in the lib directory. Is this another issue? If so, is there an issue related to this problem?
@cbarragan:
As per section 5.1 of the CDI 1.0 specification:
"In the Java EE module architecture, a bean class is accessible in a module if and only if it is required to be accessible according to the class loading requirements defined by the Java EE platform specification."
In the scenario you had mentioned above: as the EJB module class is not required to be accessible to a jar in the lib directory, the bean class is not available for injection.
Two tests have been prepared to demonstrate cases when beans within the same bean archive are not visible to each other.
https://github.com/seam/solder/blob/master/impl/src/test/java/org/jboss/seam/solder/test/compat/TypeVisibilityForExtensionInNonBeanArchiveTest.java
https://github.com/seam/solder/blob/master/impl/src/test/java/org/jboss/seam/solder/test/compat/TypeVisibilityWithinBeanArchiveTest.java
These tests can be run from the root of the Solder project as follows:
mvn clean test -Dincontainer-glassfish-rest -Dtest=TypeVisibilityForExtensionInNonBeanArchiveTest
mvn clean test -Dincontainer-glassfish-rest -Dtest=TypeVisibilityWithinBeanArchiveTest
These tested use the new Arquillian GlassFish adapter created by Jason Porter and based on the GlassFish REST API.