0

I'm stuck with a CDI problem. I've deployed a war that contains various jars in its WEB-INF/lib folder.

One of those jars has a Logger producer (a class with a method which is annotated with @Produces) and some custom qualifier annotations, some other jars have classes where I want to use the qualifiers and inject Loggers. The idea was to avoid code duplication.

But now, to my surprise, WELD complains during deployment, that it has unsatisfied dependencies for the Logger. It looks like, the qualifier annotations have been found, because the error occur on a instance which has to be injected at a qualified injection point.

It looks like, weld is able to detect "normal" beans in all of the included jars and that it is able to inject them accross the jar "boundaries". It looks like it's only the producer that isn't detected. Is this a normal behavour? Is there any way or trick to make WELD discover that producer?

Andreas Dolk
  • 113,398
  • 19
  • 180
  • 268
  • Producers in jars are detected for sure. Anything else would be completely broken. Should post some code – Karl Kildén Feb 23 '13 at 18:15
  • Sigh. Never mind. I simply forgot to add an empty `beans.xml` to the jar, that contained the produces. Learned my lesson... EACH and EVERY jar that offers managed beans needs to have at least an empty `beans.xml`. Now I know. – Andreas Dolk Feb 23 '13 at 19:27

0 Answers0