Client reconnecting to JBoss
dcrot Aug 17, 2003 6:55 PMOur stand-alone Java client application needs to reconnect to Jboss when Jboss has been brought down and restarted.
To test this I have a simple Java client application, and Jboss with a stateless session bean that simply echo's the string sent from the client. This is using 3.2.1 on W2K Server.
Heres the sequence of steps.
1. Bring up Jboss
2. Bring up client application that makes a call to the session bean which echos the string.
3. Client blocks on a dialog.
4. Bring down and restart Jboss.
5. Press in dialog with the client attempting to make the same call on the session bean.
At this point, I receive a ConnectException on the client. I then recreate the initialContext, but the client again throws a ConnectException when I'm looking up the EJB home object?
Does anybody have any ideas on this?
thanks,
Dean
PS Heres my stack trace...
javax.naming.CommunicationException. Root exception is java.rmi.ConnectException: Connection refused to host: 192.168.0.114; nested exception is:
java.net.ConnectException: Connection refused: connect
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:567)
at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:185)
at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:171)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:101)
at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:492)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at com.lds.client.Client.main(Client.java:31)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158)
at java.net.Socket.connect(Socket.java:426)
at java.net.Socket.connect(Socket.java:376)
at java.net.Socket.(Socket.java:291)
at java.net.Socket.(Socket.java:119)
at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:22)
at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:128)
at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:562)
... 8 more