5 Replies Latest reply on Jul 8, 2003 3:27 AM by jonlee

    Problem running client! [help]

    crosscourt

      Hi,

      I found a tutorial to learn jboss (but quite old-2000).
      I encountered some errors on the way but finally got depoly working and now i want to test it out with a sample client.

      however i get:
      "java.lang.IllegalStateException"
      it seems to be caused by the "home.create()" call.

      ===============================
      // Get a naming context
      InitialContext jndiContext = new InitialContext();
      System.out.println("Got context");

      // Get a reference to the Interest Bean
      Object ref = jndiContext.lookup("interest/Interest");
      System.out.println("Got reference");

      // Get a reference from this to the Bean's Home interface
      InterestHome home = (InterestHome)
      PortableRemoteObject.narrow (ref, InterestHome.class);

      //InterestHome home = (InterestHome) jndiContext.lookup( "interest/Interest" );

      System.out.println("OOOOO");

      // Create an Interest object from the Home interface
      Interest interest = home.create();

      =================================
      Got context
      Got reference
      OOOOO
      java.lang.IllegalStateException

      =================================

      any ideas?

        • 1. Re: Problem running client! [help]
          haraldgliebe

          > I found a tutorial to learn jboss (but quite old-2000).
          Things have changed quite a lot since 2000, so YMMV.

          The client code looks correct, could you post the stack trace of the exception your getting, and also any errors in the jboss log.

          Regards,
          Harald

          • 2. Re: Problem running client! [help]
            crosscourt

            I got it working when i removed the jboss.xml file.
            The one that they give in the tutorial:

            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS//EN" "http://www.jboss.org/j2ee/dtd/jboss.dtd">


            <enterprise-beans>

            <ejb-name>Interest</ejb-name>
            <jndi-name>interest/Interest</jndi-name>
            <configuration-name>Default Stateless SessionBean</configuration-name>

            false
            </enterprise-beans>

            <resource-managers/>

            <container-configurations>
            <container-configuration configuration-class="org.jboss.ejb.deployment.EntityContainerConfiguration">
            <container-name>BMP EntityBean</container-name>
            <container-invoker>org.jboss.ejb.plugins.jrmp13.server.JRMPContainerInvoker</container-invoker>
            <instance-pool>org.jboss.ejb.plugins.EntityInstancePool</instance-pool>
            <instance-cache>org.jboss.ejb.plugins.NoPassivationEntityInstanceCache</instance-cache>
            <persistence-manager>org.jboss.ejb.plugins.BMPPersistenceManager</persistence-manager>
            <transaction-manager>org.jboss.tm.TxManager</transaction-manager>
            <container-invoker-conf>
            False
            </container-invoker-conf>
            <container-cache-conf/>
            <container-pool-conf>
            100
            10
            </container-pool-conf>
            </container-configuration>
            <container-configuration configuration-class="org.jboss.ejb.deployment.StatelessSessionContainerConfiguration">
            <container-name>Singleton Stateless SessionBean</container-name>
            <container-invoker>org.jboss.ejb.plugins.jrmp13.server.JRMPContainerInvoker</container-invoker>
            <instance-pool>org.jboss.ejb.plugins.SingletonStatelessSessionInstancePool</instance-pool>
            <instance-cache></instance-cache>
            <persistence-manager></persistence-manager>
            <transaction-manager>org.jboss.tm.TxManager</transaction-manager>
            <container-invoker-conf>
            False
            </container-invoker-conf>
            </container-configuration>
            <container-configuration configuration-class="org.jboss.ejb.deployment.EntityContainerConfiguration">
            <container-name>CMP EntityBean</container-name>
            <container-invoker>org.jboss.ejb.plugins.jrmp13.server.JRMPContainerInvoker</container-invoker>
            <instance-pool>org.jboss.ejb.plugins.EntityInstancePool</instance-pool>
            <instance-cache>org.jboss.ejb.plugins.NoPassivationEntityInstanceCache</instance-cache>
            <persistence-manager>org.jboss.ejb.plugins.jaws.JAWSPersistenceManager</persistence-manager>
            <transaction-manager>org.jboss.tm.TxManager</transaction-manager>
            <container-invoker-conf>
            False
            </container-invoker-conf>
            <container-cache-conf/>
            <container-pool-conf>
            100
            10
            </container-pool-conf>
            </container-configuration>
            <container-configuration configuration-class="org.jboss.ejb.deployment.StatelessSessionContainerConfiguration">
            <container-name>Default Stateless SessionBean</container-name>
            <container-invoker>org.jboss.ejb.plugins.jrmp13.server.JRMPContainerInvoker</container-invoker>
            <instance-pool>org.jboss.ejb.plugins.StatelessSessionInstancePool</instance-pool>
            <instance-cache></instance-cache>
            <persistence-manager></persistence-manager>
            <transaction-manager>org.jboss.tm.TxManager</transaction-manager>
            <container-invoker-conf>
            False
            </container-invoker-conf>
            <container-pool-conf>
            100
            10
            </container-pool-conf>
            </container-configuration>
            </container-configurations>

            • 3. Re: Problem running client! [help]
              crosscourt

              I don't know whats happening, but when i comment out this line:

              <configuration-name>Default Stateless SessionBean</configuration-name>

              then it works?

              • 4. Re: Problem running client! [help]
                crosscourt

                the stacktrace for the first error:
                java.lang.IllegalStateException
                at org.jboss.ejb.StatelessSessionContainer.createHome(StatelessSessionCo
                ntainer.java:408)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                sorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:324)
                at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invokeHo
                me(StatelessSessionContainer.java:592)
                at org.jboss.ejb.StatelessSessionContainer.internalInvokeHome(StatelessS
                essionContainer.java:310)
                at org.jboss.ejb.Container.invoke(Container.java:694)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                sorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:324)
                at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBea
                nDispatcher.java:284)
                at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:549)
                at org.jboss.invocation.jrmp.server.JRMPInvoker.invoke(JRMPInvoker.java:
                359)
                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
                java:39)
                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
                sorImpl.java:25)
                at java.lang.reflect.Method.invoke(Method.java:324)
                at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:261)
                at sun.rmi.transport.Transport$1.run(Transport.java:148)
                at java.security.AccessController.doPrivileged(Native Method)
                at sun.rmi.transport.Transport.serviceCall(Transport.java:144)
                at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:4
                60)
                at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport
                .java:701)
                at java.lang.Thread.run(Thread.java:536)
                at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Stream
                RemoteCall.java:247)
                at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:
                223)
                at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
                at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Sour
                ce)
                at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvo
                kerProxy.java:135)
                at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.jav
                a:87)
                at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.
                java:46)
                at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:4
                5)
                at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:173)
                at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:85)
                at $Proxy0.create(Unknown Source)
                at InterestClient.main(InterestClient.java:55)

                • 5. Re: Problem running client! [help]
                  jonlee

                  The definition for container interceptors have changed quite a bit in jboss.xml. You need to update for your current JBoss distribution. Look at server/default/conf/standardjboss.xml.

                  You will be searching for a container configuration that begins:
                  <container-configuration>
                  <container-name>Standard Stateless SessionBean</container-name>

                  This entry, particularly the interceptors within, replace the jboss.xml definitions you have - as these come from an older JBoss. If you need to retain your own jboss.xml, then copy the appropriate container-configuration sections into your local copy, replacing your existing container-configuration definitions. Note that unless you have cluster configurations, the "Standard" definitions from standardjboss.xml will be fine for your EJBs.

                  Hope that helps and explains why your JBoss system is complaining.