session bean clustering problem
broberts Apr 3, 2002 1:37 PMSummary: 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