Standalone client do not recover from aap server shutdown
I've developed a standalone java application. This application creates threads to receive socket requests. As part of the process, I need to invoke an ejb deployed in WebSphere 5.1. This part works fine, but the problem is when the server need to be rebooted. The standalone client does not stop, because it must provide the service, even when the app server or another resource is not available. When the server is online again, the standalone client is not able to invoke the ejb anymore. The Context is obtained, because it is connecting by the rmi service port, and even the home interface is received, but it fails when the method create is executed. The nested exception is a typical SocketConnectionRefused, because internally it's trying to connect to the server in a port that has no listener in it (not the rmi port). I assume that the rmi port receives the request and even provide the home interface, but the rest of the method calls are made throw a different port, dinamically chosen, that is not the same if you reinitialize the app server.
Well, the question is: �how do i make my standalone app to recover from a server fall? �what do I need to reinitialize? (not the standalone app, of course) The Initial Context is instatiated every single time the ejb is invoked, so obviously is not it.
I will appreciate any information you can provide to solve this problem.
Thanks.