IllegalStateException: Resolution should not happen via injection container in JBoss EAP 5.1
Issue
-
This looks like it is stopping the WAR file from veing deployed.
Caused by: java.lang.IllegalStateException: Resolution should not happen via injection container at org.jboss.web.tomcat.service.TomcatInjectionContainer.getEjbJndiName(TomcatInjectionContainer.java:627) at org.jboss.injection.EjbEncInjector.inject(EjbEncInjector.java:80) at org.jboss.web.tomcat.service.TomcatInjectionContainer.populateEnc(TomcatInjectionContainer.java:469) at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:482) ... 69 more -
My code for accessing the EJB from within my JSF2 app is basically:
@ManagedBean(name = "queryBean") @SessionScoped public class QueryBean { @EJB MyEJBRemote ejb; } -
If I do a JNDI lookup as in the code below, everything seems to work OK and the WAR is deployed and can access the EJB.
Context ctx = new InitialContext(); MyEJBRemote ejb = (MyEJBRemote) ctx.lookup("MyEJBService/remote");
Environment
- JBoss Enterprise Application Platform (EAP)
- 5.1
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
