aspose file tools *
The moose likes Distributed Java and the fly likes rmi: Connection reset Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "rmi: Connection reset" Watch "rmi: Connection reset" New topic
Author

rmi: Connection reset

Padmaja Prasad
Ranch Hand

Joined: Nov 14, 2001
Posts: 76
I have been running a rmi server instance that maintains a list of data in the memory. The registry is created inside the server code using locateRegistry. The client processes get the server instance and reads the data in memory through the server.

I get this wiered exception :

This exception is also not stable. Sometimes all the records gets executed without any problem. But sometimes I get these exceptions for the same set of data. The period of time this exception occurs is also not stable. Inside the code we are not resetting or closing any connections... When this error occurs, the server process also exits from the running state. I have no idea why this is happening. I even put an infinite loop soon after the server is boud to the registry. The server exits even after putting that loop.

Both the server and client are running in win2k server. The JDK version is 1.4.2.

Pls help...
Thanks
Padmaja
[ June 22, 2004: Message edited by: Padmaja Prasad ]
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Is the server throwing this exception or the client?

Do you mean the server is crashing when you say it "exits from the running state"? Is the error message above the reason for the crash, is there a different error message, or is the server exiting normally?


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
Padmaja Prasad
Ranch Hand

Joined: Nov 14, 2001
Posts: 76
Originally posted by Nathan Pruett:
Is the server throwing this exception or the client?

Do you mean the server is crashing when you say it "exits from the running state"? Is the error message above the reason for the crash, is there a different error message, or is the server exiting normally?


Hi Nathan,
Thanks for the reply.
The exceptions are thrown by the client.
Yes..I meant the server crashing...The server is designed in such a way that it should exit only when user presses Ctl-C. But when this exception is thrown, server exits automatically.
In addition to the above exception following exceptions are also received.



At the server window, I am not getting any exception message at all.

Thanks
Padmaja
[ June 23, 2004: Message edited by: Padmaja Prasad ]
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Can you post the relevant sections of the code that keeps the server alive?

It sounds like something is causing the server to crash (this would close the socket, too, which might be what is causing the error on the client). The weird thing is that there is no error message on the server side... could there be an empty catch for a try somewhere in the server "keep alive" code?
Padmaja Prasad
Ranch Hand

Joined: Nov 14, 2001
Posts: 76
This is the code that starts the Server.


I put an infinite loop after the last print statement to keep server alive. That didn't help, so I removed that.

Thanks
Padmaja
[ June 23, 2004: Message edited by: Padmaja Prasad ]
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Is that the main() method? You do need something to keep the server alive (loop, wait(), etc.) after you bind it (unless you are doing something about this elsewhere in your code). If this isn't the main method, what does it do after this?
Padmaja Prasad
Ranch Hand

Joined: Nov 14, 2001
Posts: 76
The server is bound to rmiregistry in the main() method. This is the code I put at the end to keep server alive.


Thanks a lot..
Padmaja
Padmaja Prasad
Ranch Hand

Joined: Nov 14, 2001
Posts: 76
I moved the server from win2K server to HP-UNIX server. Now the server works like a charm. It never crashed even for more repeated test runs.

I read somewhere that the windows will reset the TCP connection if there are more number of open sockets. Probably this may be the reason the server went down when running in Windows.

Padmaja
Nathan Pruett
Bartender

Joined: Oct 18, 2000
Posts: 4121

Good to know you got it to work!

Still... it's weird that no exception printed out when the server died.
Padmaja Prasad
Ranch Hand

Joined: Nov 14, 2001
Posts: 76
Originally posted by Nathan Pruett:
Good to know you got it to work!

Still... it's weird that no exception printed out when the server died.


Yeah.. it seems that something is killing the server very silently, that the server even doesn't know. We are not calling System.exit anywhere in the code, for this state of the server.

Thanks for all your help and time
Padmaja
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: rmi: Connection reset