[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 841
  • Last Modified:

LocateRegistry.getRegistry()

I got the following exception at calling LocateRegistry.getRegistry():

java.rmi.MarshalException: Error marshaling transport header; nested exception is: java.net.SocketException: Connection reset by peer: JVM_recv in socket input stream read

I have no idea what I did wrong. The exception will not be thrown everytime - only sometimes.

Has someone an idea why this exception will be thrown?

Regards,
Hugi
0
Hugi
Asked:
Hugi
1 Solution
 
mbormannCommented:
0
 
HugiAuthor Commented:
Adjusted points to 400
0
 
Ravindra76Commented:

Can you post code?
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
mbormannCommented:
http://forum.java.sun.com/forum?13@233.wmFrav85bI2^0@.eeb2109/0

what is ur version of JDK ?
goto
http://developer.java.sun.com/developer/support/index.html
and click on all relevant sections like Bug Reports etc...

and type 'JVM_recv'

looks like this is a intermittent bug
0
 
HugiAuthor Commented:
The code is simple:

try
{
    LocateRegistry.getRegistry();
}
catch ( Throwable th )
{
    System.out.println( th);
}

This is absolutely not reproducable. I think, the problem could be that I use the rmi connection to communicate with an applet which is running in the browser.
At starting my application the browser and the last application are terminated, but I'm not sure when the rmi registry terminates (garbage collector?). Maybe I have to make shure that the old rmi is really terminated before calling LocateRegistry.getRegistry() - but I don't know how to do that.

Regards,
Hugi
0
 
mbormannCommented:
why u use LocateRegistry.getRegistry() ?
why not Naming.rebind()
see
http://developer.novell.com/research/devnotes/1998/october/07/05.htm
0
 
RAKESHCommented:
to solve your problem use::
  LocateRegistry.getRegistry(getCodeBase().getHost(),"rmiinterfaceName").lookup(..
here rmiinterfacename is the name with which you have registered your object at server.....
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now