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
HugiAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mbormannCommented:
0
HugiAuthor Commented:
Adjusted points to 400
0
Ravindra76Commented:

Can you post code?
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.