3 Replies Latest reply on Aug 1, 2012 3:47 AM by Wolf-Dieter Fink

    Problem running EJB with jboss

    Jessi Raj Newbie

      Hi,


      I'm trying to run a java .ejb project with jboss. I have deployed my .ear in the jboss/server/default/deploy location. when i run it and try to access the LoginServlet, I get this exception. pls help.

       

      exception

       

      javax.servlet.ServletException: Error instantiating servlet class UserHandling.LoginServlet
       org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
       org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
       org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
       org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
       org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
       org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
       org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
       org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
       org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       java.lang.Thread.run(Unknown Source)
      root cause
      
      java.lang.RuntimeException: Unable to inject jndi dependency: env/UserHandling.LoginServlet/userHandlingSessionLocal into property UserHandling.LoginServlet.userHandlingSessionLocal: WHIMS not bound
       org.jboss.injection.JndiPropertyInjector.lookup(JndiPropertyInjector.java:82)
       org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:99)
       org.jboss.web.tomcat.service.TomcatInjectionContainer.processInjectors(TomcatInjectionContainer.java:380)
       org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:259)
       org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
       org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
       org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
       org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
       org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
       org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
       org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
       org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
       org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       java.lang.Thread.run(Unknown Source)
      root cause
      
      javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: WHIMS not bound]
       org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1348)
       org.jnp.interfaces.NamingContext.lookup(NamingContext.java:813)
       org.jnp.interfaces.NamingContext.lookup(NamingContext.java:682)
       org.jboss.ejb3.JndiUtil.lookup(JndiUtil.java:44)
       org.jboss.injection.JndiPropertyInjector.lookup(JndiPropertyInjector.java:75)
       org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:99)
       org.jboss.web.tomcat.service.TomcatInjectionContainer.processInjectors(TomcatInjectionContainer.java:380)
       org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:259)
       org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
       org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
       org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
       org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
       org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
       org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
       org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
       org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
       org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       java.lang.Thread.run(Unknown Source)
      root cause
      
      javax.naming.NameNotFoundException: WHIMS not bound
       org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
       org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
       org.jnp.server.NamingServer.getObject(NamingServer.java:785)
       org.jnp.server.NamingServer.lookup(NamingServer.java:396)
       org.jnp.interfaces.NamingContext.lookup(NamingContext.java:722)
       org.jnp.interfaces.NamingContext.lookup(NamingContext.java:682)
       javax.naming.InitialContext.lookup(Unknown Source)
       org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1342)
       org.jnp.interfaces.NamingContext.lookup(NamingContext.java:813)
       org.jnp.interfaces.NamingContext.lookup(NamingContext.java:682)
       org.jboss.ejb3.JndiUtil.lookup(JndiUtil.java:44)
       org.jboss.injection.JndiPropertyInjector.lookup(JndiPropertyInjector.java:75)
       org.jboss.injection.JndiPropertyInjector.inject(JndiPropertyInjector.java:99)
       org.jboss.web.tomcat.service.TomcatInjectionContainer.processInjectors(TomcatInjectionContainer.java:380)
       org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:259)
       org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
       org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
       org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
       org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
       org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
       org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
       org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
       org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
       org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
       java.lang.Thread.run(Unknown Source)
      


        • 1. Re: Problem running EJB with jboss
          Wolf-Dieter Fink Master

          Sounds like your application contains a class UserHandling.LoginServlet with a injected variable and the JNDI reference "WHIMS" can not be resolved.

          • 2. Re: Problem running EJB with jboss
            Jessi Raj Newbie

            thanks. when i start the jboss server i get the following errors. can you please tell me where the problem is?

             

            DEPLOYMENTS MISSING DEPENDENCIES:

              Deployment "jboss.j2ee:ear=WHIMS.ear,jar=WHIMS-ejb.jar,name=ReportGeneratingSessionBean,service=EJB3" is missing the following dependencies:

                Dependency "<UNKNOWN jboss.j2ee:ear=WHIMS.ear,jar=WHIMS-ejb.jar,name=ReportGeneratingSessionBean,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'persistence.unit:unitName=WHIMS.ear/WHIMS-ejb.jar#WHIMS-ejbPU' **")

              Deployment "jboss.j2ee:ear=WHIMS.ear,jar=WHIMS-ejb.jar,name=ReportGeneratingSessionBean,service=EJB3_endpoint" is missing the following dependencies:

                Dependency "jboss.j2ee:ear=WHIMS.ear,jar=WHIMS-ejb.jar,name=ReportGeneratingSessionBean,service=EJB3" (should be in state "Configured", but is actually in state "PreInstall")

              Deployment "jboss.j2ee:ear=WHIMS.ear,jar=WHIMS-ejb.jar,name=ServiceSessionBean,service=EJB3" is missing the following dependencies:

                Dependency "<UNKNOWN jboss.j2ee:ear=WHIMS.ear,jar=WHIMS-ejb.jar,name=ServiceSessionBean,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'persistence.unit:unitName=WHIMS.ear/WHIMS-ejb.jar#WHIMS-ejbPU' **")

              Deployment "jboss.j2ee:ear=WHIMS.ear,jar=WHIMS-ejb.jar,name=ServiceSessionBean,service=EJB3_endpoint" is missing the following dependencies:

                Dependency "jboss.j2ee:ear=WHIMS.ear,jar=WHIMS-ejb.jar,name=ServiceSessionBean,service=EJB3" (should be in state "Configured", but is actually in state "PreInstall")

              Deployment "jboss.j2ee:ear=WHIMS.ear,jar=WHIMS-ejb.jar,name=UserHandlingSessionBean,service=EJB3" is missing the following dependencies:

                Dependency "<UNKNOWN jboss.j2ee:ear=WHIMS.ear,jar=WHIMS-ejb.jar,name=UserHandlingSessionBean,service=EJB3>" (should be in state "Described", but is actually in state "** UNRESOLVED Demands 'persistence.unit:unitName=WHIMS.ear/WHIMS-ejb.jar#WHIMS-ejbPU' **")

              Deployment "jboss.j2ee:ear=WHIMS.ear,jar=WHIMS-ejb.jar,name=UserHandlingSessionBean,service=EJB3_endpoint" is missing the following dependencies:

                Dependency "jboss.j2ee:ear=WHIMS.ear,jar=WHIMS-ejb.jar,name=UserHandlingSessionBean,service=EJB3" (should be in state "Configured", but is actually in state "PreInstall")

              Deployment "persistence.unit:unitName=WHIMS.ear/WHIMS-ejb.jar#WHIMS-ejbPU" is missing the following dependencies:

                Dependency "jboss.jca:name=HealthInformationDataBases,service=DataSourceBinding" (should be in state "Create", but is actually in state "** NOT FOUND Depends on 'jboss.jca:name=HealthInformationDataBases,service=DataSourceBinding' **")

             

             

            DEPLOYMENTS IN ERROR:

              Deployment "<UNKNOWN jboss.j2ee:ear=WHIMS.ear,jar=WHIMS-ejb.jar,name=ServiceSessionBean,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'persistence.unit:unitName=WHIMS.ear/WHIMS-ejb.jar#WHIMS-ejbPU' **

              Deployment "jboss.jca:name=HealthInformationDataBases,service=DataSourceBinding" is in error due to the following reason(s): ** NOT FOUND Depends on 'jboss.jca:name=HealthInformationDataBases,service=DataSourceBinding' **

              Deployment "<UNKNOWN jboss.j2ee:ear=WHIMS.ear,jar=WHIMS-ejb.jar,name=UserHandlingSessionBean,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'persistence.unit:unitName=WHIMS.ear/WHIMS-ejb.jar#WHIMS-ejbPU' **

              Deployment "<UNKNOWN jboss.j2ee:ear=WHIMS.ear,jar=WHIMS-ejb.jar,name=ReportGeneratingSessionBean,service=EJB3>" is in error due to the following reason(s): ** UNRESOLVED Demands 'persistence.unit:unitName=WHIMS.ear/WHIMS-ejb.jar#WHIMS-ejbPU' **

             

             

                    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:441)

                    at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)

                    at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)

                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)

                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:181)

                    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:205)

                    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                    at java.lang.Thread.run(Thread.java:619)

            • 3. Re: Problem running EJB with jboss
              Wolf-Dieter Fink Master

              Check the logfile for errors before the final deployment message.

              It looks like a problem with your persistence unit

              ** UNRESOLVED Demands 'persistence.unit:unitName=WHIMS.ear/WHIMS-ejb.jar#WHIMS-ejbPU' **