Link to home
Start Free TrialLog in
Avatar of econcepts
econceptsFlag for United States of America

asked on

Loosing connection when i restart server using RMI with Tomcat

Hi
  In  my application i have used RMI to connect my Struts Application with my server Code. the server is dealing with database. everything is working fine but if i restart server. My already running application which is deployed on tomcat gives exception and if i see the exception it gives that it has lost the connection through RMI while i have restarted the server. Why this problem is coming because if i restart the server it means my application which is on tomcat should connect to my server code through RMI. I think RMI works on behalf of connection oriented.
Do you have any suggestion for this

Thanx and rgds.
Avatar of Mayank S
Mayank S
Flag of India image

>> if i restart the server it means my application which is on tomcat should connect to my server code through RMI

If you restart the server, your application will lose the connection.

>> my application which is on tomcat should connect to my server code through RMI

Can you explain a little more elaborately what is your application and what is your server code?
Avatar of econcepts

ASKER

Thanx mayankeagle for replying
 

My server Code is my remote object  which is dealing with database and having some business logic.Application is the client for this remote object. This client is written by using struts and deployed on tomcat.


Yes, As u have written that I will lose connection but it won't be possible to connect that remote object without restarting the client.

If you restart Tomcat, it would also stop the running instance of the Struts application which is deployed on it.

>> I will lose connection but it won't be possible to connect that remote object without restarting the client

Why do you want to restart the client?
actually i don't want to lose connection from server

The problem is what i want that if somebody restart server side then all the clients must continue there work whereever they left their client application

is it possible or not

By client, you mean the Struts application.... which is deployed on Tomcat, and so if Tomcat itself restarts, I don't see how they could continue their processing because the application resides at the Tomcat server-side, after all.
sorry i could n't explain u
This time i think u will understand

server side mean not tomcat. my struts application is running on tomcat.

From server side i mean to say one separate application running on another computer. that is not on tomcat that is a java application and acting as server for me. I used RMI to connect that struts application to my another program that is server for me.

Now i want to know if i shutdown that application and then restart that on remote computer. My struts application gives me exception that connection refused by another java application because i have lost that RMI object reference.

Is it possible that without restarting that struts application again i will get connection of that java application using RMI.

I think now u will get what i want to say

Thanx for corporating
ASKER CERTIFIED SOLUTION
Avatar of TimYates
TimYates
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The last solution I gave describes how I do it in all of my ejb apps...and it works fine for me ;-)