> I'm trying to create a factory to let me @Inject Loggers as shown here: > > > http://docs.jboss.org/cdi/api/1.0/javax/enterprise/inject/spi/InjectionPoint.html > > But I get: > >> [14-03-08 23:59:23.129] WARNING com.caucho.server.webapp.WebApp >> setConfigException: javax.enterprise.inject.UnsatisfiedResolutionException: >> Can't find a bean for 'class org.apache.log4j.Logger' because no beans >> implementing that class have been registered with the injection manager >> InjectManager[singleton:null#UsageMapServer]. >> at >> com.caucho.config.inject.InjectManager.unsatisfiedException(InjectManager.java:2471) >> at >> com.caucho.config.inject.InjectManager.resolveByInjectionPoint(InjectManager.java:2656) >> at >> com.caucho.config.inject.InjectManager.getReferenceFactory(InjectManager.java:2614) >> at >> com.caucho.config.inject.InjectManager.getReferenceFactory(InjectManager.java:2593) > > > Here's my code (first class needs the injection, second class is the factory):
That should work, please check if there are any compile exceptions for the Producer. I verified the pattern with java.util.logging.* > > http://pastebin.com/nHiGZyzf > > One additional question: when this works, how many LoggerFactory instances > can I expect? Is it a singleton? Can I use its constructor or static init to > initialize Log4J? With an @ApplicaitonScoped producer there should be one instance for a Proxy class and one for an actual Producer. Thanks, Alex > > Thanks! > > -- > Rick > > > > _______________________________________________ > resin-interest mailing list > resin-interest@caucho.com > http://maillist.caucho.com/mailman/listinfo/resin-interest _______________________________________________ resin-interest mailing list resin-interest@caucho.com http://maillist.caucho.com/mailman/listinfo/resin-interest