Injection in Backing Bean does not work
marcusdidiusfalco Oct 19, 2010 9:59 AMHallo
JBoss 6 M5
I have deployed a jar with ejbs and a separate war.
I want to inject an ejb into a JSF backing bean.
EJB:
@Local
public interface BafoegRechner {
public BerechnungErgebnis berechnneFoerderung(Aenderungszeitraum aenderungszeitraum);
}
@Stateless
public class BafoegRechnerBean implements BafoegRechner, AenderungsGesetz {
//....
}
I have checked the namespace with the jmx console, the ejb is deployed
JSF Backing Bean:
@ManagedBean
@RequestScoped
public class Berechnung {
@EJB
private BafoegRechner bafoegRechner;
//...
}
During deployment of the war I get:
2010-10-19 15:30:41,080 WARN [org.jboss.web.tomcat.service.injection.WebEJBRemoteHandler] (HDScanner) EJBTHREE-1289: Using legacy EjbEncInjector, because mappedName for enc "env/beans.Berechnung/bafoegRechner", field "null" is null (container.environmentRefGroup.annotatedEjbReferences = [AnnotatedEJBReferenceMetaData{name=beans.Berechnung/bafoegRechner,ejb-ref-type=null,link=null,ignore-dependecy=false,mapped/jndi-name=null,resolved-jndi-name=null,beanInterface=interface berechnung.BafoegRechner}])
2010-10-19 15:30:41,096 WARN [org.jboss.injection.AbstractHandler] (HDScanner) EJBTHREE-1828: calling deprecated addDependency
2010-10-19 15:30:41,299 ERROR [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (HDScanner) ENC setup failed: java.lang.IllegalStateException: Resolution should not happen via injection container
at org.jboss.web.tomcat.service.TomcatInjectionContainer.getEjbJndiName(TomcatInjectionContainer.java:673) [:6.0.0.20100911-M5]
at org.jboss.injection.EjbEncInjector.inject(EjbEncInjector.java:80) [:1.5.1]
at org.jboss.web.tomcat.service.TomcatInjectionContainer.populateEnc(TomcatInjectionContainer.java:513) [:6.0.0.20100911-M5]
at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:427) [:6.0.0.20100911-M5]
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:115) [:6.0.0.20100911-M5]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3823) [:6.0.0.20100911-M5]
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:299) [:6.0.0.20100911-M5]
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:138) [:6.0.0.20100911-M5]
at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461) [:6.0.0.20100911-M5]
at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118) [:6.0.0.20100911-M5]
at org.jboss.web.deployers.WebModule.start(WebModule.java:95) [:6.0.0.20100911-M5]
What's going on?
Thanks,
Hans