4 Replies Latest reply on Jan 23, 2009 4:15 AM by bliessen

    EJB 2.1 deployment on JBoss 5.0.0.GA

    bliessen

      I created a sample EAR app consisting of an EJB jar and a war module. I use XDoclet to generate deployment descriptors for both the ejb and web module.

      What is in my app ?
      ejb.jar: contains 1 SLSB
      web.war: contains a single servlet using this SLSB through a <ejb-local-ref>.

      My app works fine on JBoss 4.2.3 and jboss 4.0.5 but it fails to start on JBoss 5.0.0.GA. JBoss 5 throws an "ejb not bound" exception when starting the servlet. Still on JBoss 5, the EJB seems to be deployed OK as I can access the remote interface via a JNDI lookup.


      Have I hit some bug ?

      the generated descriptors:

      ejb-jar.xml:
       <session id="Session_SomeServiceBean">
      
       <ejb-name>SomeServiceBean</ejb-name>
      
       <home>moondog.service.gen.SomeServiceBeanHome</home>
       <remote>...</remote>
       <local-home>...</local-home>
       <local>...</local>
       <ejb-class>...</ejb-class>
       <session-type>Stateless</session-type>
       <transaction-type>Container</transaction-type>
      
       </session>
      
      jboss.xml:
       <session>
       <ejb-name>SomeServiceBean</ejb-name>
       <jndi-name>ejb/SomeServiceBean</jndi-name>
       <local-jndi-name>ejb/SomeServiceBeanLocal</local-jndi-name>
       </session>
      
      
      web.xml:
       <ejb-local-ref id="EJBLocalRef_1">
       <ejb-ref-name>ejb/SomeServiceBeanLocal</ejb-ref-name>
       <ejb-ref-type>Session</ejb-ref-type>
       <local-home>...</local-home>
       <local>...</local>
       <ejb-link>SomeServiceBean</ejb-link>
       </ejb-local-ref>
      
      
      jboss-web.xml:
       <ejb-local-ref>
       <ejb-ref-name>ejb/SomeServiceBeanLocal</ejb-ref-name>
       <local-jndi-name>ejb/SomeServiceBeanLocal</local-jndi-name>
       </ejb-local-ref>
      


        • 1. Re: EJB 2.1 deployment on JBoss 5.0.0.GA
          jaikiran

          Please post the entire exception stacktrace and the console logs.

          JBoss 5 throws an "ejb not bound" exception when starting the servlet.


          Is it a startup servlet which does a lookup of the EJB? Looks like an deployment ordering issue to me which looks similar to what is being discussed here http://www.jboss.com/index.html?module=bb&op=viewtopic&t=146759. Read through that thread and you will find a workaround (i don't think it can be called a fix).

          • 2. Re: EJB 2.1 deployment on JBoss 5.0.0.GA
            bliessen

            My Servlet uses the xdoclet generated Util object which does a jndi lookup of java:comp/env/ejb/SomeServiceBeanLocal.

            The lookup is executed in the servlet constructor.

            the full stacktrace:

            07:34:38,546 INFO [QueueService] Queue[/queue/ExpiryQueue] started, fullSize=200000, pageSize=2000, downCacheSize=2000
            07:34:38,546 INFO [QueueService] Queue[/queue/DLQ] started, fullSize=200000, pageSize=2000, downCacheSize=2000
            07:34:38,671 INFO [ConnectionFactoryBindingService] Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'
            07:34:38,687 INFO [TomcatDeployment] deploy, ctxPath=/, vfsUrl=ROOT.war
            07:34:38,781 INFO [TomcatDeployment] deploy, ctxPath=/jmx-console, vfsUrl=jmx-console.war
            07:34:38,859 INFO [EjbDeployer] installing bean: ejb/xdl-app01-ejb.jar#SomeServiceBean,uid23845357
            07:34:38,859 INFO [EjbDeployer] with dependencies:
            07:34:38,859 INFO [EjbDeployer] and supplies:
            07:34:38,859 INFO [EjbDeployer] jndi:ejb/SomeServiceBeanLocal
            07:34:38,859 INFO [EjbDeployer] jndi:ejb/SomeServiceBean
            07:34:39,046 INFO [TomcatDeployment] deploy, ctxPath=/xdl-app01-web, vfsUrl=xdl-app01-ear.ear/xdl-app01-web.war
            07:34:39,656 INFO [HelloServlet] Creating servlet
            07:34:39,656 ERROR [STDERR] javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException: ejb not bound]
            07:34:39,656 ERROR [STDERR] at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1339)
            07:34:39,656 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:804)
            07:34:39,656 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:820)
            07:34:39,656 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:673)
            07:34:39,656 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:392)
            07:34:39,656 ERROR [STDERR] at moondog.service.impl.SomeServiceBeanUtil.lookupHome(SomeServiceBeanUtil.java:21)
            07:34:39,656 ERROR [STDERR] at moondog.service.impl.SomeServiceBeanUtil.getLocalHome(SomeServiceBeanUtil.java:63)
            07:34:39,656 ERROR [STDERR] at moondog.ws.HelloServlet.<init>(HelloServlet.java:47)
            07:34:39,656 ERROR [STDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            07:34:39,656 ERROR [STDERR] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
            07:34:39,656 ERROR [STDERR] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
            07:34:39,656 ERROR [STDERR] at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
            07:34:39,656 ERROR [STDERR] at java.lang.Class.newInstance0(Class.java:355)
            07:34:39,656 ERROR [STDERR] at java.lang.Class.newInstance(Class.java:308)
            07:34:39,656 ERROR [STDERR] at org.jboss.web.tomcat.service.TomcatInjectionContainer.newInstance(TomcatInjectionContainer.java:242)
            07:34:39,656 ERROR [STDERR] at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1006)
            07:34:39,656 ERROR [STDERR] at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:950)
            07:34:39,656 ERROR [STDERR] at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4122)
            07:34:39,656 ERROR [STDERR] at org.apache.catalina.core.StandardContext.start(StandardContext.java:4421)
            07:34:39,656 ERROR [STDERR] at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:367)
            07:34:39,656 ERROR [STDERR] at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:146)
            07:34:39,656 ERROR [STDERR] at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:460)
            07:34:39,656 ERROR [STDERR] at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118)
            07:34:39,656 ERROR [STDERR] at org.jboss.web.deployers.WebModule.start(WebModule.java:96)
            07:34:39,656 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            07:34:39,656 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            07:34:39,656 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            07:34:39,656 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:597)
            07:34:39,656 ERROR [STDERR] at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)
            07:34:39,656 ERROR [STDERR] at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
            07:34:39,656 ERROR [STDERR] at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
            07:34:39,656 ERROR [STDERR] at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
            07:34:39,656 ERROR [STDERR] at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
            07:34:39,656 ERROR [STDERR] at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java:206)
            07:34:39,656 ERROR [STDERR] at $Proxy36.start(Unknown Source)
            07:34:39,656 ERROR [STDERR] at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:42)
            07:34:39,656 ERROR [STDERR] at org.jboss.system.microcontainer.StartStopLifecycleAction.installAction(StartStopLifecycleAction.java:37)
            07:34:39,656 ERROR [STDERR] at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
            07:34:39,656 ERROR [STDERR] at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
            07:34:39,656 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
            07:34:39,656 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
            07:34:39,656 ERROR [STDERR] at org.jboss.system.microcontainer.ServiceControllerContext.install(ServiceControllerContext.java:286)
            07:34:39,656 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
            07:34:39,656 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
            07:34:39,656 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
            07:34:39,656 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
            07:34:39,656 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
            07:34:39,656 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
            07:34:39,656 ERROR [STDERR] at org.jboss.system.ServiceController.doChange(ServiceController.java:688)
            07:34:39,656 ERROR [STDERR] at org.jboss.system.ServiceController.start(ServiceController.java:460)
            07:34:39,656 ERROR [STDERR] at org.jboss.system.deployers.ServiceDeployer.start(ServiceDeployer.java:146)
            07:34:39,656 ERROR [STDERR] at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:104)
            07:34:39,656 ERROR [STDERR] at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:45)
            07:34:39,656 ERROR [STDERR] at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:62)
            07:34:39,656 ERROR [STDERR] at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
            07:34:39,656 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
            07:34:39,656 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(DeployersImpl.java:1439)
            07:34:39,656 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1157)
            07:34:39,656 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1178)
            07:34:39,656 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:1210)
            07:34:39,656 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:1098)
            07:34:39,656 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
            07:34:39,656 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1598)
            07:34:39,656 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:934)
            07:34:39,656 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:1062)
            07:34:39,656 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:984)
            07:34:39,656 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:822)
            07:34:39,656 ERROR [STDERR] at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:553)
            07:34:39,656 ERROR [STDERR] at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:781)
            07:34:39,656 ERROR [STDERR] at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:545)
            07:34:39,656 ERROR [STDERR] at org.jboss.system.server.profileservice.ProfileServiceBootstrap.loadProfile(ProfileServiceBootstrap.java:304)
            07:34:39,656 ERROR [STDERR] at org.jboss.system.server.profileservice.ProfileServiceBootstrap.start(ProfileServiceBootstrap.java:205)
            07:34:39,656 ERROR [STDERR] at org.jboss.bootstrap.AbstractServerImpl.start(AbstractServerImpl.java:405)
            07:34:39,656 ERROR [STDERR] at org.jboss.Main.boot(Main.java:209)
            07:34:39,656 ERROR [STDERR] at org.jboss.Main$1.run(Main.java:547)
            07:34:39,656 ERROR [STDERR] at java.lang.Thread.run(Thread.java:619)
            07:34:39,656 ERROR [STDERR] Caused by: javax.naming.NameNotFoundException: ejb not bound
            07:34:39,656 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:771)
            07:34:39,656 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:779)
            07:34:39,656 ERROR [STDERR] at org.jnp.server.NamingServer.getObject(NamingServer.java:785)
            07:34:39,656 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:396)
            07:34:39,656 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:713)
            07:34:39,656 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:673)
            07:34:39,656 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:392)
            07:34:39,656 ERROR [STDERR] at org.jnp.interfaces.NamingContext.resolveLink(NamingContext.java:1333)
            07:34:39,656 ERROR [STDERR] ... 75 more
            07:34:39,750 WARN [TomcatDeployment] Failed to setup clustering, clustering disabled. NoClassDefFoundError: org/jboss/cache/pojo/jmx/PojoCacheJmxWrapperMBean
            07:34:39,906 INFO [EjbModule] Deploying SomeServiceBean
            07:34:39,953 WARN [EjbModule] EJB configured to bypass security. Please verify if this is intended. Bean=SomeServiceBean Deployment=vfszip:/C:/java/servers/jboss-5.0.0.GA/server/standard/deploy/xdl-app01-ear.ear/xdl-app01-ejb.jar
            07:34:40,125 INFO [BaseLocalProxyFactory] Bound EJB LocalHome 'SomeServiceBean' to jndi 'ejb/SomeServiceBeanLocal'
            07:34:40,140 INFO [ProxyFactory] Bound EJB Home 'SomeServiceBean' to jndi 'ejb/SomeServiceBean'
            07:34:40,156 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
            07:34:40,171 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
            07:34:40,171 INFO [ServerImpl] JBoss (Microcontainer) [5.0.0.GA (build: SVNTag=JBoss_5_0_0_GA date=200812042120)] Started in 59s:265ms
            


            • 3. Re: EJB 2.1 deployment on JBoss 5.0.0.GA
              jaikiran

              The exception occurs before the EJB is bound to JNDI

              07:34:40,125 INFO [BaseLocalProxyFactory] Bound EJB LocalHome 'SomeServiceBean' to jndi 'ejb/SomeServiceBeanLocal'
              


              So yes, its a deployment ordering issue. Follow the workaround mentioned in the other thread.

              • 4. Re: EJB 2.1 deployment on JBoss 5.0.0.GA
                bliessen

                the tag solved my problem.

                Thank you,