2 Replies Latest reply on Apr 8, 2002 10:39 AM by broberts

    session bean clustering problem

    broberts

      Summary: I'm having trouble getting a stateless session bean to work in a clustered environment. I can set up the cluster and see that both machines are part of the cluster (when I start or stop one server, I can see the other server note that fact), so it looks like the clustering service itself is working fine. When I mark the session bean as clustered I get a MarshalException (details below). It looks like it's not using the MarshaledInvocation that is Serializable - in fact in the log files I never see any logging calls of "_add(RegisterComponent..." from the ReplicantManager, although I do see other debugging output like "_adding new HashMap". It almost looks like the SessionBean isn't getting noted as clustered. I would appreciate any help or ideas to try, since I've run out of ideas for the moment.

      Thanks,
      Bruce Roberts
      Rendition Networks
      broberts@renditionnetworks.com

      The details:
      ========
      Platform: Windows2000, JDK1.4.0, JBoss build created from CVS on 3/18.
      Configuration: Using the default cluster-service.xml and the jboss.xml listed below.
      Code: Created a simple stateless session bean that works fine when clustering is turned off; calling that session bean is done from a command line client (code snippet attached below).

      jboss.xml:
      ========
      <?xml version="1.0"?>

      <enterprise-beans>

      <ejb-name>RegisterComponent</ejb-name>
      <jndi-name>RegisterComponent</jndi-name>
      <configuration-name>Standard Stateless SessionBean</configuration-name>
      True

      </enterprise-beans>


      Command line client code snippet:
      =========================
      m_providerURL = "jnp://testwin2k1:1100";

      Properties p = new Properties();
      p.put(Context.PROVIDER_URL, m_providerURL);
      p.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
      p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
      InitialContext m_context = new InitialContext(p);

      RegisterComponentHome rcHome =
      (RegisterComponentHome)m_context.lookup("RegisterComponent");

      RegisterComponent m_registerComponent = rcHome.create(); <--- FAILS HERE WITH EXCEPTION BELOW.

      int m_clientID = m_registerComponent.registerComponent( m_user, m_password,
      m_ipAddress, m_listenerPort, m_componentType );

      Exception:
      ========
      java.rmi.MarshalException: error marshalling arguments; nested exception is:
      java.io.NotSerializableException: org.jboss.invocation.Invocation
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:129)
      at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
      at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)
      at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:73)
      at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:76)
      at org.jboss.proxy.ejb.HomeInterceptor.invoke(HomeInterceptor.java:185)
      at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:96)
      at $Proxy1.create(Unknown Source)
      at TestClient.connect(TestClient.java:121)
      at TestClient.main(TestClient.java:50)
      Caused by: java.io.NotSerializableException: org.jboss.invocation.Invocation
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
      at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:265)
      at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:124)
      ... 9 more

        • 1. Re: session bean clustering problem
          slaboure

          Hello broberts,

          Can you please test it with a more recent cvs snapshot? I've tested this morning and everything is fine. If it fails in the same way, please submit a bug report on sf.net (you can assign it to me, slaboure).

          Thank you. Cheers,



          Sacha

          • 2. Re: session bean clustering problem
            broberts

            I have tested it with the latest build and it seems to work fine now. Bill Burke helped me out by pointing out the test code he was using, and I was able to get that working and then get my code working.

            I'm still not sure what went wrong, since after I had been fiddling with my code for a while I couldn't seem to get it to fail - I was trying to generate a simple test case for Bill. If I see the problem again I'll be sure to create a repeatable test case. I suspect that I had something weird in a config file that went away as I changed things to try to get it to work.

            Put this one down to a PEBKAC error for now: Problem Exists Between (my) Keyboard and (my) Chair.

            Thanks,

            Bruce Roberts
            broberts@renditionnetworks.com