• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

rmi: Connection reset

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Padmaja Prasad
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
reply
    Bookmark Topic Watch Topic
  • New Topic