7 Replies Latest reply: Jul 7, 2008 9:26 AM by Ales Justin RSS

    jboss5 + @EJB injection in web tier -- problem !

    Mariano Kocalka Machala Newbie

      Hi Everyone,

      I've just downloaded the jboss-5.0.0.CR1... and still @EJB injections are not allowed in web tier ??

      When i deploy my simple application (see below) im getting this stacktrace (also im posting the sample code as well)

      17:34:23,209 INFO [STDOUT] ======> Creating interceptor metadata bridge
      17:34:23,911 INFO [JBossASKernel] Created KernelDeployment for: testjboss5-server.jar
      17:34:23,919 INFO [JBossASKernel] installing bean: jboss.j2ee:ear=testjboss5-server.ear,jar=testjboss5-server.jar,name=CustomerManagerEJB,service=EJB3
      17:34:23,920 INFO [JBossASKernel] with dependencies:
      17:34:23,920 INFO [JBossASKernel] and demands:
      17:34:23,920 INFO [JBossASKernel] jboss.ejb:service=EJBTimerService
      17:34:23,924 INFO [JBossASKernel] and supplies:
      17:34:23,924 INFO [JBossASKernel] jndi:CustomerManagerEJB
      17:34:23,924 INFO [JBossASKernel] jndi:testjboss5-server/CustomerManagerEJB/local-com.sample.testjboss5.managers.CustomerManager
      17:34:23,924 INFO [JBossASKernel] Class:com.sample.testjboss5.managers.CustomerManager
      17:34:23,924 INFO [JBossASKernel] jndi:testjboss5-server/CustomerManagerEJB/local
      17:34:23,925 INFO [JBossASKernel] Added bean(jboss.j2ee:ear=testjboss5-server.ear,jar=testjboss5-server.jar,name=CustomerManagerEJB,service=EJB3) to KernelDeployment of: testjboss5-server.jar
      17:34:24,518 INFO [EJBContainer] STARTED EJB: com.sample.testjboss5.managers.CustomerManagerEJB ejbName: CustomerManagerEJB
      17:34:24,683 INFO [TomcatDeployment] deploy, ctxPath=/testjboss5-servlet, vfsUrl=testjboss5-server.ear/testjboss5-servlet.war
      17:34:24,703 WARN [EJBRemoteHandler] EJBTHREE-1289: Using legacy EjbEncInjector, because mappedName for enc "env/com.sample.testjboss5.servlet.SayHelloServlet/customerManager", field "customerManager" is null (container.environmentRefGroup.annotatedEjbReferences = null)
      17:34:24,742 ERROR [TomcatDeployment] ENC setup failed
      java.lang.IllegalStateException: Resolution should not happen via injection container
       at org.jboss.web.tomcat.service.TomcatInjectionContainer.getEjbJndiName(TomcatInjectionContainer.java:456)
       at org.jboss.injection.EjbEncInjector.inject(EjbEncInjector.java:80)
       at org.jboss.web.tomcat.service.TomcatInjectionContainer.populateEnc(TomcatInjectionContainer.java:268)
       at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:515)
       at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4351)
       at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:346)
       at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:139)
       at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:431)
       at org.jboss.web.deployers.WebModule.startModule(WebModule.java:112)
       at org.jboss.web.deployers.WebModule.start(WebModule.java:90)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
       at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
       at $Proxy35.start(Unknown Source)
       at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
       at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
       at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
       at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:271)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1392)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:784)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:912)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:834)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:672)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:455)
       at org.jboss.system.ServiceController.doChange(ServiceController.java:664)
       at org.jboss.system.ServiceController.start(ServiceController.java:436)
       at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:150)
       at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:108)
       at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
       at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:174)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:970)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:991)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1023)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:911)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1392)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:784)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:912)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:834)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:672)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:455)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:594)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
       at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
       at java.lang.Thread.run(Thread.java:595)
      17:34:24,749 ERROR [AbstractKernelController] Error installing to Start: name=jboss.web.deployment:war=/testjboss5-servlet state=Create mode=Manual requiredState=Installed
      org.jboss.deployers.spi.DeploymentException: URL file:/home/mkocalka/apps/jboss-5.0.0.CR1/server/default/tmp/deploy/testjboss5-servlet33945-exp.war/ deployment failed
       at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
       at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:351)
       at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:139)
       at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:431)
       at org.jboss.web.deployers.WebModule.startModule(WebModule.java:112)
       at org.jboss.web.deployers.WebModule.start(WebModule.java:90)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
       at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
       at $Proxy35.start(Unknown Source)
       at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
       at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
       at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
       at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:271)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1392)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:784)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:912)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:834)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:672)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:455)
       at org.jboss.system.ServiceController.doChange(ServiceController.java:664)
       at org.jboss.system.ServiceController.start(ServiceController.java:436)
       at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:150)
       at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:108)
       at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
       at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:174)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:970)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:991)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1023)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:911)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1392)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:784)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:912)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:834)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:672)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:455)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:594)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
       at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Resolution should not happen via injection container
       at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:538)
       at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4351)
       at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:346)
       ... 60 more
      Caused by: java.lang.IllegalStateException: Resolution should not happen via injection container
       at org.jboss.web.tomcat.service.TomcatInjectionContainer.getEjbJndiName(TomcatInjectionContainer.java:456)
       at org.jboss.injection.EjbEncInjector.inject(EjbEncInjector.java:80)
       at org.jboss.web.tomcat.service.TomcatInjectionContainer.populateEnc(TomcatInjectionContainer.java:268)
       at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:515)
       ... 63 more
      17:34:24,786 INFO [EJBContainer] STOPPED EJB: com.sample.testjboss5.managers.CustomerManagerEJB ejbName: CustomerManagerEJB
      17:34:25,005 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/home/mkocalka/apps/jboss-5.0.0.CR1/server/default/deploy/testjboss5-server.ear state=PreReal mode=Manual requiredState=Real
      org.jboss.deployers.spi.DeploymentException: URL file:/home/mkocalka/apps/jboss-5.0.0.CR1/server/default/tmp/deploy/testjboss5-servlet33945-exp.war/ deployment failed
       at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
       at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:351)
       at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:139)
       at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:431)
       at org.jboss.web.deployers.WebModule.startModule(WebModule.java:112)
       at org.jboss.web.deployers.WebModule.start(WebModule.java:90)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:585)
       at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
       at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
       at $Proxy35.start(Unknown Source)
       at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
       at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
       at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
       at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
       at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:271)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1392)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:784)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:912)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:834)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:672)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:455)
       at org.jboss.system.ServiceController.doChange(ServiceController.java:664)
       at org.jboss.system.ServiceController.start(ServiceController.java:436)
       at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:150)
       at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:108)
       at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46)
       at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
       at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
       at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:174)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:970)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:991)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1023)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:911)
       at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
       at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1392)
       at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:784)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:912)
       at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:834)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:672)
       at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:455)
       at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:594)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:541)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
       at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
       at java.lang.Thread.run(Thread.java:595)
      Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Resolution should not happen via injection container
       at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:538)
       at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
       at org.apache.catalina.core.StandardContext.start(StandardContext.java:4351)
       at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:346)
       ... 60 more
      Caused by: java.lang.IllegalStateException: Resolution should not happen via injection container
       at org.jboss.web.tomcat.service.TomcatInjectionContainer.getEjbJndiName(TomcatInjectionContainer.java:456)
       at org.jboss.injection.EjbEncInjector.inject(EjbEncInjector.java:80)
       at org.jboss.web.tomcat.service.TomcatInjectionContainer.populateEnc(TomcatInjectionContainer.java:268)
       at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:515)
       ... 63 more
      17:34:25,018 WARN [HDScanner] Failed to process changes
      org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
      
      *** CONTEXTS IN ERROR: Name -> Error
      
      vfszip:/home/mkocalka/apps/jboss-5.0.0.CR1/server/default/deploy/testjboss5-server.ear -> java.lang.IllegalStateException: Resolution should not happen via injection container
      
      
       at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:676)
       at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:661)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:291)
       at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:417)
       at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:280)
       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:135)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:65)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:142)
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:166)
       at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
       at java.lang.Thread.run(Thread.java:595)
      


      i made a simple test, see as follow

      Local interface
      package com.sample.testjboss5.managers;
      
      import javax.ejb.Local;
      
      @Local
      public interface CustomerManager
      {
       /**
       */
       public String sayHello();
      }
      


      Stateless Ejb
      package com.sample.testjboss5.managers;
      
      import javax.ejb.Stateless;
      
      @Stateless
      public class CustomerManagerEJB implements CustomerManager
      {
       /**
       */
       public String sayHello()
       {
       return "========== Hello jboss5 ==========";
       }
      }
      


      Custom servlet
      package com.sample.testjboss5.servlet;
      
      import java.io.IOException;
      
      import javax.ejb.EJB;
      import javax.servlet.ServletException;
      import javax.servlet.http.HttpServlet;
      import javax.servlet.http.HttpServletRequest;
      import javax.servlet.http.HttpServletResponse;
      
      import com.sample.testjboss5.managers.CustomerManager;
      
      public class SayHelloServlet extends HttpServlet
      {
       private static final long serialVersionUID = 1L;
      
       @EJB
       private CustomerManager customerManager;
      
       /**
       */
       public void init() throws ServletException
       {
       super.init();
       }
      
       /**
       */
       protected void doGet(HttpServletRequest req, HttpServletResponse resp)
       throws ServletException, IOException
       {
       doPost(req, resp);
       }
      
       /**
       */
       protected void doPost(HttpServletRequest req, HttpServletResponse resp)
       throws ServletException, IOException
       {
       // Do something.
       System.out.println(customerManager.sayHello());
       }
      }
      


      The web.xml descriptor
      <?xml version="1.0" encoding="UTF-8"?>
      
      <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
       http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
      
       <servlet>
       <servlet-name>sayHelloServlet</servlet-name>
       <servlet-class>
       com.sample.testjboss5.servlet.SayHelloServlet
       </servlet-class>
       <load-on-startup>0</load-on-startup>
       </servlet>
      
      </web-app>
      


      The application.xml descriptor
      <?xml version="1.0" encoding="UTF-8"?>
      
      <application version="5" xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd">
      
       <module>
       <ejb>testjboss5-server.jar</ejb>
       </module>
      
       <module>
       <web>
       <web-uri>testjboss5-servlet.war</web-uri>
       <context-root>testjboss5-servlet</context-root>
       </web>
       </module>
      
      </application>