1 2 Previous Next 16 Replies Latest reply on Feb 11, 2010 6:12 AM by Riccardo Blumenthal

    EJB 3.0 - Injection via annotation into a servlet

    Riccardo Blumenthal Newbie

      Hello Community,

       

      I am trying to get a web application working. Therefore I made a servlet, a stateless session bean and an interface for that bean. Now I am trying to get my bean injected (I think that is the correct expression?) into the servlet to call a function. I activate the servlet via a url - that is working. But as soon as I enter the code for the injection my JBoss throws an error on deploying.

       

      I have tried numerous ways but nothing helped. I have spent 3 days on this now and it would be really helpful if there is any advice for what I am doing wong.

       

      Ok, lets get a bit more precise.

       

      I am using Eclipse 3.5 (also to generate the EAR file for the JBoss) and JBoss 5.1.0.GA

       

      My servlet code looks as follows:

       

      package com;
      
      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 org.apache.log4j.Logger;
      
      import com.session.PersonControllerEJBRemote;
      
      
      public class SnoopServlet extends HttpServlet 
      {
           Logger logger = Logger.getLogger(SnoopServlet.class);
           
           @EJB
           PersonControllerEJBRemote personControllerEJB;
           
           public void doGet(HttpServletRequest request, HttpServletResponse response)
                throws ServletException, IOException
           {
                logger.info("doGet()");
                
                personControllerEJB.addPerson();
           }
      
      }
      

       

      Stateless Session Bean:

      package com.session;
      
      import java.io.Serializable;
      import java.util.Date;
      
      import javax.ejb.Local;
      import javax.ejb.Stateless;
      import javax.persistence.EntityManager;
      import javax.persistence.PersistenceContext;
      
      import org.apache.log4j.Logger;
      import org.apache.ws.scout.registry.infomodel.PersonNameImpl;
      
      @Stateless
      public class PersonControllerEJBImpl implements PersonControllerEJBRemote, Serializable
      {
           @PersistenceContext(unitName="PersonControllerEJBImpl")
           private EntityManager em;
           
           private Logger logger = Logger.getLogger(PersonNameImpl.class);
           
           public void addPerson()
           {
                logger.info("addPerson()");
                System.out.println("Person added!");
           }
           
           public String findPerson(int personId)
           {
                return;
           }
           
      }
      

       

      Interface

      package com.session;
      
      import java.util.Date;
      
      import javax.ejb.Remote;
      
      @Remote
      public interface PersonControllerEJBRemote 
      {
           
           public void addPerson();
           
           public Person findPerson(int personId);
           
      }
      

       

      and finally the error message:

      15:22:06,375 INFO  [TomcatDeployment] deploy, ctxPath=/tutorial
      15:22:06,421 WARN  [WebEJBRemoteHandler] EJBTHREE-1289: Using legacy EjbEncInjector, because mappedName for enc "env/com.SnoopServlet/personController
      EJB", field "null" is null (container.environmentRefGroup.annotatedEjbReferences = [AnnotatedEJBReferenceMetaData{name=com.SnoopServlet/personControll
      erEJB,ejb-ref-type=null,link=null,ignore-dependecy=false,mapped/jndi-name=null,resolved-jndi-name=null,beanInterface=interface com.session.PersonContr
      ollerEJBLocal}])
      15:22:06,437 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:640)
              at org.jboss.injection.EjbEncInjector.inject(EjbEncInjector.java:80)
              at org.jboss.web.tomcat.service.TomcatInjectionContainer.populateEnc(TomcatInjectionContainer.java:482)
              at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:471)
              at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
              at org.apache.catalina.core.StandardContext.start(StandardContext.java:4388)
              at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
              at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
              at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
              at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
              at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
              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 $Proxy38.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)
      ...
      
        • 1. Re: EJB 3.0 - Injection via annotation into a servlet
          Riccardo Blumenthal Newbie

          Ok, I have been looking a bit further into various threads. So I have checked my JNDI tree in the JBoss and it doesn't show me any of my beans in the namespace there.

          But as far as I know they should be there automatically when using an annotation with EJB 3.0. And JBoss 5.1.0.GA includes EJB 3.0 right?

          • 2. Re: EJB 3.0 - Injection via annotation into a servlet
            jaikiran pai Master

            How is the application packaged? Are the .war and .jar (containing the EJBs) deployed separately? If yes, try packaging the .war and the .jar in an .ear and deploy the .ear.

            • 3. Re: EJB 3.0 - Injection via annotation into a servlet
              Riccardo Blumenthal Newbie

              I have checked the EAR and I think it isn't packed correctly. Let me try to show the structure:

               

              tutorialEAR.ear: + META-INF
                               |    |
                               |     --- MANIFEST.MF
                               |
                               + tutorial.WAR
                                      |    
                                      + META-INF
                                      |     |
                                      |      --- MANIFEST.MF
                                      |      --- persitence.xml
                                      |
                                      + WEB-INF
                                      |    |
                                      |    + classes
                                      |    + lib
                                      |     --- web.xml
                                      |
                                       --- *.jsp
              

               

              That's my EAR as it is created by Eclipse. Actually I assumed Eclipse would perform the right file regarding the the fact that it optimizes for JBoss as runtim. But from what I learned the JAR is missing in the root directory right? So i created a tutorial.JAR manually from eclipse and put it into the EAR but still that didn't help. I am getting the following error message:

               

               

              09:20:08,656 INFO  [JBossASKernel] Created KernelDeployment for: tutorial.jar
              09:20:08,656 INFO  [JBossASKernel] installing bean: jboss.j2ee:jar=tutorial.jar,name=tutorial,service=EJB3
              09:20:08,656 INFO  [JBossASKernel]   with dependencies:
              09:20:08,656 INFO  [JBossASKernel]   and demands:
              09:20:08,656 INFO  [JBossASKernel]   and supplies:
              09:20:08,656 INFO  [JBossASKernel] Added bean(jboss.j2ee:jar=tutorial.jar,name=tutorial,service=EJB3) to KernelDeployment of: tutorial.jar
              09:20:08,671 INFO  [ClientENCInjectionContainer] STARTED CLIENT ENC CONTAINER: tutorial
              09:20:08,828 INFO  [TomcatDeployment] deploy, ctxPath=/admin-console
              09:20:09,109 INFO  [config] Initializing Mojarra (1.2_12-b01-FCS) for context '/admin-console'
              09:20:13,562 INFO  [TomcatDeployment] deploy, ctxPath=/
              09:20:13,734 INFO  [TomcatDeployment] deploy, ctxPath=/jmx-console
              09:20:14,203 INFO  [TomcatDeployment] deploy, ctxPath=/tutorial
              09:20:14,265 ERROR [Ejb3ClientDeployer] Could not deploy vfszip:/C:/Programme/jboss-5.1.0.GA/server/default/deploy/tutorialEAR.ear/tutorial.jar/
              javax.naming.NameAlreadyBoundException: classPathEntries
                      at org.jnp.server.NamingServer.bind(NamingServer.java:209)
                      at org.jnp.server.NamingServer.bind(NamingServer.java:167)
                      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 sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:294)
                      at sun.rmi.transport.Transport$1.run(Transport.java:153)
                      at java.security.AccessController.doPrivileged(Native Method)
                      at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
                      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
                      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
                      at java.lang.Thread.run(Thread.java:595)
                      at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
                      at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
                      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:126)
                      at org.jnp.server.NamingServer_Stub.bind(Unknown Source)
                      at org.jnp.interfaces.NamingContext.bind(NamingContext.java:650)
                      at org.jnp.interfaces.NamingContext.bind(NamingContext.java:611)
                      at org.jboss.ejb3.deployers.Ejb3ClientDeployer.deploy(Ejb3ClientDeployer.java:150)
                      at org.jboss.ejb3.deployers.Ejb3ClientDeployer.deploy(Ejb3ClientDeployer.java:61)
              
              

               

              Not sure if the WAR and the JAR must be named differently?

              • 4. Re: EJB 3.0 - Injection via annotation into a servlet
                jaikiran pai Master

                Does the tutorial.jar that you created and placed at the root of the .ear contain any EJBs? Looking at the exception stacktrace, it's being considered as an application client instead of a EJB deployment. What does the contents of the MANIFEST.MF of that jar look like? Also, you have placed the persistence.xml in the wrong location in the .war. One of the valid locations to place  the persistence.xml in the .war, is the .war/WEB-INF/classes folder, you might want to move it there.

                 

                I would also recommend that you leave out the IDE from the picture, atleast till the issue is solved. I usually use Ant to build the deployments. That way, i don't have to worry about IDE messing up the way deployments are created.

                • 5. Re: EJB 3.0 - Injection via annotation into a servlet
                  Riccardo Blumenthal Newbie
                  Well, I have tried to use Ant but I never made an own build file so I was trying to find some advice in the web. But everyone does it different with thousands of  properties etc. So it's hard to figure out what i really need and what not.
                  • 6. Re: EJB 3.0 - Injection via annotation into a servlet
                    jaikiran pai Master
                    If you are just playing around with some examples, then take a look at our tutorials http://www.jboss.org/ejb3/docs/ which run both in Maven and in Ant.
                    • 7. Re: EJB 3.0 - Injection via annotation into a servlet
                      Wolfgang Knauf Master

                      Hi Riccardo,

                       

                      it seems that the EJB jar is not part of your EAR and that the EAR only contains the WAR file. Do you deploy the JAR separately?

                       

                      If you are just trying to learn EJB3 and have no special use case, the easiest way to do this in Eclipse is to create a EAR project, which consists of an EJB module and a Web module. Now injection should work.

                       

                      Hope this helps

                       

                      Wolfgang

                      • 8. Re: EJB 3.0 - Injection via annotation into a servlet
                        Riccardo Blumenthal Newbie
                        Well, that is indeed the case. I want to create a web appliacation with EJB3 and am looking for a proper start. For that I have created a dynamic web project and added a it to an EAR. So i thought by using the export function and giving the EAR project as target I would get a correct EAR file but that is not the case? So what am I doing wrong?
                        • 9. Re: EJB 3.0 - Injection via annotation into a servlet
                          Wolfgang Knauf Master

                          Hi,

                           

                          do you have an EJB jar, or did you include the Beans in your web app? The latter is not possible, this is a new feature in JavaEE6.

                          You need two projects/modules inside your EAR, one EJB project and a Dynamic Web Project.

                           

                          You are right by exporting it as EAR and copy it to JBoss-deploy.

                           

                          Best regards

                           

                          Wolfgang

                          • 10. Re: EJB 3.0 - Injection via annotation into a servlet
                            Riccardo Blumenthal Newbie

                            Hello

                             

                            Sorry for my late answer but I have been pretty busy so I could just start again looking fo this problem.

                             

                            Ok, I have now made an EAR-File which should be build corectly. It includes a META-INF directory, a jar-file and a war-file.

                             

                            The jar-file contains again the META-INF directory and the compiled classes (that would be a bean, a remote if and a servlet).

                             

                            The war-file contains the META-INF directory, the WB-INF directory (with subdir lib, classes[contains the compiled servlet class] and web.xml) + my jsp-files.

                             

                            When I now deploy the ear in my jboss i get the following error:

                             

                            10:36:36,703 INFO  [TomcatDeployment] deploy, ctxPath=/profis
                            10:36:36,875 ERROR [AbstractKernelController] Error installing to Start: name=jboss.web.deployment:war=/profis state=Create mode=Manual requiredState=
                            Installed
                            org.jboss.deployers.spi.DeploymentException: URL file:/C:/Programme/jboss-5.1.0.GA/server/default/tmp/a3o3l4x-z2gytr-g5jco42g-1-g5jcuzxn-9s/profis.war
                            / deployment failed
                                    at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
                                    at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:316)
                                    at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
                                    at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
                                    at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
                                    at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
                                    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 $Proxy38.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:286)
                                    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
                                    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
                                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                                    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                                    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                                    at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
                                    at org.jboss.system.ServiceController.start(ServiceController.java:460)
                                    at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
                                    at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
                                    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:171)
                                    at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
                                    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
                                    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
                                    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
                                    at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
                                    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                                    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
                                    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
                                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                                    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                                    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                                    at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
                                    at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
                                    at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
                                    at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
                                    at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
                                    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: LifecycleException:  Error initializaing :  javax.management.ReflectionException: Cannot find method addChild with this signature
                                    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4150)
                                    at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
                                    ... 62 more
                            10:36:39,531 INFO  [SessionSpecContainer] Stopping jboss.j2ee:ear=profis.ear,jar=profis.jar,name=PersonControllerEJBImpl,service=EJB3
                            10:36:39,578 INFO  [EJBContainer] STOPPED EJB: de.profis.app.person.PersonControllerEJBImpl ejbName: PersonControllerEJBImpl
                            10:36:39,625 ERROR [AbstractKernelController] Error installing to Real: name=vfszip:/C:/Programme/jboss-5.1.0.GA/server/default/deploy/profis.ear/ sta
                            te=PreReal mode=Manual requiredState=Real
                            org.jboss.deployers.spi.DeploymentException: URL file:/C:/Programme/jboss-5.1.0.GA/server/default/tmp/a3o3l4x-z2gytr-g5jco42g-1-g5jcuzxn-9s/profis.war
                            / deployment failed
                                    at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
                                    at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:316)
                                    at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142)
                                    at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461)
                                    at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
                                    at org.jboss.web.deployers.WebModule.start(WebModule.java:97)
                                    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 $Proxy38.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:286)
                                    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
                                    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
                                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                                    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                                    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                                    at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
                                    at org.jboss.system.ServiceController.start(ServiceController.java:460)
                                    at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:163)
                                    at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:99)
                                    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:171)
                                    at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
                                    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
                                    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
                                    at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
                                    at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
                                    at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                                    at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1631)
                                    at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
                                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1082)
                                    at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
                                    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
                                    at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
                                    at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
                                    at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:702)
                                    at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.process(MainDeployerAdapter.java:117)
                                    at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:362)
                                    at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
                                    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: LifecycleException:  Error initializaing :  javax.management.ReflectionException: Cannot find method addChild with this signature
                                    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4150)
                                    at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310)
                                    ... 62 more
                            10:36:39,687 WARN  [HDScanner] Failed to process changes
                            org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
                            
                            *** DEPLOYMENTS IN ERROR: Name -> Error
                            
                            vfszip:/C:/Programme/jboss-5.1.0.GA/server/default/deploy/profis.ear/ -> org.jboss.deployers.spi.DeploymentException: URL file:/C:/Programme/jboss-5.1
                            .0.GA/server/default/tmp/a3o3l4x-z2gytr-g5jco42g-1-g5jcuzxn-9s/profis.war/ deployment failed
                            
                            
                            DEPLOYMENTS IN ERROR:
                              Deployment "vfszip:/C:/Programme/jboss-5.1.0.GA/server/default/deploy/profis.ear/" is in error due to the following reason(s): LifecycleException:
                            Error initializaing :  javax.management.ReflectionException: Cannot find method addChild with this signature
                            
                                    at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:993)
                                    at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:939)
                                    at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:873)
                                    at org.jboss.system.server.profileservice.repository.MainDeployerAdapter.checkComplete(MainDeployerAdapter.java:128)
                                    at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:369)
                                    at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:255)
                                    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)
                            

                             

                            Anyone having an idea? Didn't really find help in the internet :/

                            • 11. Re: EJB 3.0 - Injection via annotation into a servlet
                              jaikiran pai Master
                              Are you packaging any jar files container org.apache.catalina or org.jboss.web classes in your application? If yes then remove them.

                              • 13. Re: EJB 3.0 - Injection via annotation into a servlet
                                jaikiran pai Master

                                Please post the output of:

                                 

                                jar -tf  profis.war
                                

                                 

                                If you have jar files in .ear/lib, then even post the output of:

                                 

                                jar -tf profis.ear
                                
                                • 14. Re: EJB 3.0 - Injection via annotation into a servlet
                                  Riccardo Blumenthal Newbie

                                  ok, the output from profis.war is the following:

                                   

                                  C:\Java\deploy>jar -tf profis.war
                                  META-INF/
                                  META-INF/MANIFEST.MF
                                  WEB-INF/
                                  WEB-INF/web.xml
                                  WEB-INF/classes/
                                  WEB-INF/classes/de/
                                  WEB-INF/classes/de/profis/
                                  WEB-INF/classes/de/profis/app/
                                  WEB-INF/classes/de/profis/app/person/
                                  WEB-INF/classes/de/profis/web/
                                  WEB-INF/lib/
                                  WEB-INF/classes/de/profis/app/person/PersonControllerEJBImpl.class
                                  WEB-INF/classes/de/profis/app/person/PersonControllerEJBRemote.class
                                  WEB-INF/classes/de/profis/app/person/PersonVO.class
                                  WEB-INF/classes/de/profis/web/SnoopServlet.class
                                  WEB-INF/lib/j2ee.jar
                                  WEB-INF/lib/log4j-1.2.15.jar
                                  hello.jsp
                                  showBrowser.jsp
                                  

                                   

                                  For the ear I understand that you asking for jars in the lib directory inside the ear-file right? However, I do not have a lib directory in the ear.

                                  1 2 Previous Next