rmiregistry cannot be started ...

Hello, all.

I encountered a weird problem with rmiregistry. I wrote following code in the source file

import java.rmi.registry.LocateRegistry;

LocateRegistry.createRegistry(5081);

when running the application, the system complains.

Error: Registry cannot be contacted.

java.rmi.Unmarshal Exception: Error unmarshalingreturn header; nested exception is:

java.net.SocketException: Connection Reset

Does anybody know how to solve this problem?

And a second question, are strings and arrays of strings passed by reference in RMI?

Thanks !!

[669 byte] By [loudkinga] at [2007-11-27 1:39:13]
# 1
1. Use a policy file for security.2. No
cooper6a at 2007-7-12 0:51:59 > top of Java-index,Core,Core APIs...
# 2

Neither of those answers seems to have anything to do with the question.

You need to save the result of LocateRegistry.createRegistry() (i.e. the Registry remote object) in a static variable, otherwise it will be GC'd.

But you didn't get that exception from those lines of code. What did you get them from?

ejpa at 2007-7-12 0:51:59 > top of Java-index,Core,Core APIs...