Problems with clustering
dcadena Nov 26, 2002 1:57 PMI have two machines with an instance of JBoss in each one inside the DefaultPartition
The Jbosses are running with the configuration "all"
I have got configured the farming and it is working perfectly. I have hot-deployed a StateFull EJB (Count)
inside DefaultPartition.
The client that I am testing is the following:
public class CountCliente {
public static void main(String[] args) {
try {
Properties props = new Properties ();
props.setProperty("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
props.setProperty("java.naming.provider.url",
"jnp://mymachine1:1099");
props.setProperty("java.naming.factory.url.pkgs",
"org.jboss.naming:org.jnp.interfaces");
Context ctx = new InitialContext(props);
Object obj = ctx.lookup ("Count");
CountHome home = (CountHome) javax.rmi.PortableRemoteObject.narrow
(obj,CountHome.class);
Count count;
int countVal = 0;
System.out.println("Instantiating beans...");
count = home.create(countVal);
countVal = count.count();
System.out.println(countVal);
// count.remove();
System.out.println("Push any key...");
System.in.read();
/***************************** POINT 1
//Count count2;
//count2 = home.create(countVal);
//countVal = count2.count();
countVal = count.count();
System.out.println(countVal);
count.remove();
//count2.remove();
} catch (Exception e) {
e.printStackTrace();
}
}
}
In the point 1 I kill the machine mymachine1 and when the program calls the count method,
it produces the following error:
java.rmi.ConnectException: Connection refused to host: 138.100.12.118; nested exception is:
java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120)
at java.net.Socket.(Socket.java:273)
at java.net.Socket.(Socket.java:100)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:25)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:120)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:499)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:190)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:174)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:83)
at org.jboss.invocation.jrmp.server.JRMPInvoker_Stub.invoke(Unknown Source)
at org.jboss.invocation.jrmp.interfaces.JRMPInvokerProxy.invoke(JRMPInvokerProxy.java:138)
at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:108)
at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:77)
at org.jboss.proxy.SecurityInterceptor.invoke(SecurityInterceptor.java:80)
at org.jboss.proxy.ejb.StatefulSessionInterceptor.invoke(StatefulSessionInterceptor.java:117)
at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:76)
at $Proxy1.count(Unknown Source)
at CountCliente.main(CountCliente.java:48)
Is the clustering facility working properly?