6 Replies Latest reply on Feb 26, 2010 3:33 PM by Juliano Vidal

    EJB3 Session Bean Container error

    Juliano Vidal Newbie

      Hi all,

       

      I'm moving my application from App 4.2.3.GA to 5.1.0.GA and whern I try to call any of  my SessionBeans I get the error:

       

      java.lang.IllegalStateException: Container null is not registered
           org.jboss.ejb3.Ejb3Registry.getContainer(Ejb3Registry.java:167)
           org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:70)
           org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
           org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:61)
           $Proxy705.invoke(Unknown Source)
           org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:188)
           $Proxy704.listByContentId(Unknown Source)
      
      

       

      Anyone had the same problem?

       

      Thanks!

        • 1. Re: EJB3 Session Bean Container error
          jaikiran pai Master

          Can you post your client code? Is it some remote client? How is the application packaged? And please post the logs from the console when the application is being deployed.

          • 2. Re: EJB3 Session Bean Container error
            Juliano Vidal Newbie

            Hey! Thanks for the quick reply!

             

            The error ocurrs when I try to access a Remote SessionBean.

             

            The weird thing is that I actually get the instance when I do the lookup:

             

            public CategoryRemote getCategory() throws CMSException {
             Object obj = CMSServiceLocator.getInstance().getObject(CategoryRemote.REMOTE);
             return (CategoryRemote) PortableRemoteObject.narrow(obj, CategoryRemote.class);
            }
            

             

            The getObject method is the lookup and I'm doing it the classic way...

            InitialContext... blah, blah,blah...

             

            I get the instance... but when I try to call a method from the SessionBean, I get that error.

             

            Thanks in advance for your help!

             

            Regards,

            Juliano Vidal

            • 3. Re: EJB3 Session Bean Container error
              jaikiran pai Master

              julianovidal wrote:

               

               

               

              The error ocurrs when I try to access a Remote SessionBean.

               


              You mean the client is not in the same JVM as the deployed bean, right? (Just trying to get a better picture of what's happening)

               

              julianovidal wrote:

               


               

              The weird thing is that I actually get the instance when I do the lookup:

               

              public CategoryRemote getCategory() throws CMSException {
               Object obj = CMSServiceLocator.getInstance().getObject(CategoryRemote.REMOTE);
               return (CategoryRemote) PortableRemoteObject.narrow(obj, CategoryRemote.class);
              }
              

               


              The interceptor is considering it to be a in-JVM call (i.e. client and bean are in same JVM). Before i look into the details, can you remove that PortableRemoteObject.narrow call? It's not required in EJB3. (I have a suspicion that it's messing up with the returned proxy - although i am not sure yet).

              • 4. Re: EJB3 Session Bean Container error
                Juliano Vidal Newbie

                They are in the sabe JVM, I think.

                Diferent ears but in the same JVM and deployed in the same application server.

                 

                Removed thePortableRemoteObject.narrow, and got the same error...

                 

                Any other ideas?


                • 5. Re: EJB3 Session Bean Container error
                  jaikiran pai Master

                  Looking at the stacktrace, its a servlet calling bean1 which then calls bean2. And the system is a MacOS with Apple JVM. I don't see a reason why this would fail. Can you attach application(s) which can reproduce this issue? By the way, have you patched the server with the latest EJB3 plugin or is it just a clean AS 5.1.0?

                  • 6. Re: EJB3 Session Bean Container error
                    Juliano Vidal Newbie

                    Hey man!

                     

                    After build a new EJB project and ran it in another JBoss 5.1, I got it working.

                    When I ran in my old one I found that it did not work. So I started to seach for it's diferences.

                    I added a jar: jboss-aspect-jdk50-client.jar in my common/lib beacuse I was getting a ClassDefNotFoundException exception. And the solution I found was to copy that jar from the JBoss 4.2.3 to the JBoss 5.1.0

                     

                    That caused the Countainer error...


                    After I removed it from the common/lib I got that working!!

                     

                    The error I was getting before did not appear again.... yet...

                     

                    Thanks for your help!