10 Replies Latest reply on Mar 13, 2002 1:25 PM by adrian.brock

    StatelessSessionContainer invoke returned an exception

    jbossid

      Hi there,
      iam using jboss3alpha,when iam looking another BMP from a stateless session bean it is giving me this error.

      "StatelessSessionContainer invoke returned an exception"
      java.rmi.serverException :null

      please give me any suggestion how can i getride of this

        • 1. Re: StatelessSessionContainer invoke returned an exception
          jbossid

          please somebody respond imm.. thsi is very urgent

          • 2. Re: StatelessSessionContainer invoke returned an exception

            Do you see any errors in log/server.log?
            I think nobody is responding because the error you
            report is too general.

            Regards,
            Adrian

            • 3. Re: StatelessSessionContainer invoke returned an exception
              jbossid

              Adrian,
              here is my logfile,could u please give some suggestion

              TxManager,DEBUG] resumed tx: null
              [2002-03-13 14:21:35,078,Default,INFO] Exception in exception handlingjavax.ejb.EJBException: null
              Embedded Exception
              null
              [2002-03-13 14:21:35,078,StatelessSessionContainer,ERROR] invoke returned an exception
              java.rmi.ServerException: null
              Embedded Exception
              null; nested exception is:
              javax.ejb.EJBException: null
              Embedded Exception
              null
              javax.ejb.EJBException: null
              Embedded Exception
              null
              at com.textmine.ejb.UserManagerBean.validateUser(UserManagerBean.java:83)
              at java.lang.reflect.Method.invoke(Native Method)
              at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:569)
              at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:98)
              at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:143)
              at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
              at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:67)
              at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:131)
              at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
              at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:280)
              at org.jboss.ejb.Container.invoke(Container.java:528)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:411)
              at java.lang.reflect.Method.invoke(Native Method)
              at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
              at sun.rmi.transport.Transport$1.run(Unknown Source)
              at java.security.AccessController.doPrivileged(Native Method)
              at sun.rmi.transport.Transport.serviceCall(Unknown Source)
              at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
              at java.lang.Thread.run(Unknown Source)
              java.lang.NullPointerException
              at com.textmine.ejb.UserManagerBean.validateUser(UserManagerBean.java:76)
              at java.lang.reflect.Method.invoke(Native Method)
              at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:569)
              at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:98)
              at org.jboss.ejb.plugins.AbstractTxInterceptorBMT.invokeNext(AbstractTxInterceptorBMT.java:143)
              at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:62)
              at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:67)
              at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:131)
              at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
              at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:280)
              at org.jboss.ejb.Container.invoke(Container.java:528)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
              at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
              at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:411)
              at java.lang.reflect.Method.invoke(Native Method)
              at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
              at sun.rmi.transport.Transport$1.run(Unknown Source)
              at java.security.AccessController.doPrivileged(Native Method)
              at sun.rmi.transport.Transport.serviceCall(Unknown Source)
              at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
              at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
              at java.lang.Thread.run(Unknown Source)

              • 4. Re: StatelessSessionContainer invoke returned an exception

                It looks like you've got a NullPointerException
                somewhere in validateUser().

                Regards,
                Adrian

                • 5. Re: StatelessSessionContainer invoke returned an exception
                  jbossid

                  adrian,
                  the problem is coming when iam looking for BMPlocalhome from a statelesssession bean.

                  so the exceptions are generated from the catch method for the try where iam looking my bMP home.
                  they are not from my validateUser() method.

                  well i read some where from forum that container is looking runtime exception as EJBException thats why it is showing statelesscontainer invoke return exception.
                  but how can i solve this??
                  i think it is the error while looking the LocalHome.

                  • 6. Re: StatelessSessionContainer invoke returned an exception

                    Can you post the code and deployment descriptors?
                    You don't need to post everything, just the relevant
                    sections.

                    Regards,
                    Adrian

                    • 7. Re: StatelessSessionContainer invoke returned an exception
                      jbossid

                      here is my ejb-jar.xml
                      <?xml version="1.0" encoding="UTF-8"?>
                      <ejb-jar>
                      <enterprise-beans>

                      <ejb-name>UserManagerBean</ejb-name>
                      com.xx.ejb.UserManagerHome
                      com.xx.ejb.UserManager
                      <ejb-class>com.xx.ejb.UserManagerBean</ejb-class>
                      <session-type>Stateless</session-type>
                      <transaction-type>Bean</transaction-type>



                      <ejb-name>CustomerBean</ejb-name>
                      com.xx.ejb.CustomerHome
                      com.xx.ejb.Customer
                      <ejb-class>com.xx.ejb.CustomerBean</ejb-class>
                      <prim-key-class>com.xx.ejb.CustomerPK</prim-key-class>
                      <persistence-type>Bean</persistence-type>
                      false


                      </enterprise-beans>
                      </ejb-jar>


                      and my jboss.xml is
                      <?xml version="1.0" encoding="UTF-8"?>

                      <enterprise-beans>


                      <ejb-name>UserManagerBean</ejb-name>
                      <jndi-name>usermgr/UserMgr</jndi-name>



                      <ejb-name>CustomerBean</ejb-name>
                      <jndi-name>customer/CustBean</jndi-name>


                      </enterprise-beans>



                      and my code is :
                      try{

                      Context ctx = new InitialContext();
                      Object ref=ctx.lookup("customer/CustBean");

                      CustomerLocalHome customerLocalHome = (CustomerLocalHome)PortableRemoteObject.narrow(ref,CustomerLocalHome.class);

                      CustomerLocal customer=null;
                      CustomerPK pk=(CustomerPK) customer.getPrimaryKey();
                      customer=customerLocalHome.findByPrimaryKey(pk);

                      return new User(customer.getUserId(),customer.getPassword(),customer.getFname(),customer.getLname(),customer.getPassword());

                      }

                      catch(Exception e){
                      throw new EJBException(e);
                      }

                      • 8. Re: StatelessSessionContainer invoke returned an exception

                        Hi,

                        Your immediate problem is setting customer to null
                        before using it.

                        Also, you haven't specified a <local-jndi-name> in
                        jboss.xml

                        I think it defaults to local/<ejb-name> when you
                        don't specify it?

                        Regards,
                        Adrian

                        • 9. Re: StatelessSessionContainer invoke returned an exception
                          jbossid

                          adrian ,
                          i changed the code as u said ,i am not making my customer as null.but again it is giving me problem
                          if you have any ejb-jar.xml and jboss.xml syntax please do post.
                          i don't think it is the problem with making the local as null.there iam just declaring it and initialinzing it.

                          • 10. Re: StatelessSessionContainer invoke returned an exception

                            If you look at the other post
                            http://main.jboss.org/thread.jsp?forum=47&thread=10656

                            That has a session bean with a local interface.

                            In general local interfaces aren't really required in
                            JBoss unless you turn set to False in
                            standardjboss.xml. JBoss automatically does local
                            processing for you.

                            Regards,
                            Adrian