I'm having problems using dependency injection (with CDI / Weld) in the libraries used in the war when deploying to Glassfish 3.1. I have two libraries, say:
WEB-INF/lib/library1.jar WEB-INF/lib/library2.jar
library1 contains a public class, such as "InjectMe". Library2 contains another public class, for example, "InjectionTarget" with an incubator site, for example, "InIndex InjectMe injectMe" ;.
Deployment Failed:
WELD-001408 Unsatisfied dependencies for type [InjectMe] with qualifiers [@Default] at injection point [[field] @Inject packagename.InjectionTarget.injectionSite].
Both archives are valid CDI archives with META-INF / beans.xml.
I updated the weld-osgi-bundle.jar file in Glassfish 3.1 and still see the problem.
If I manually unpack libraries1 and library2, putting their classes directly in WEB-INF / classes, the deployment succeeds and the injection works as expected.
It quickly drives me crazy. I am on the verge of restructuring my modules, so jar subpackages are unpacked using the maven-dependency-plugin module and archived as a joint bank, on which I then depend on my war. It's pretty awful though.
Ideas? Shouldn't this βworkβ?
source share