RMI Server Class path issue

hi ,

i am facing classpath issue when try to run rmi server. i have a jar file

(RmiServer.jar) for rmi server , which contain some other jar file .

when i run this jar file it throwsClassNotFoundException

the java classloader are not able to load class from jar(RmiServer.jar)

file. pls. tell me what i did wrong .

Regards

Brajesh K

[390 byte] By [brajesh_rathorea] at [2007-11-27 11:09:19]
# 1

What class isn't being found, and what are you executing when it happens?

If it is Naming.bind/rebind or Registry.bind/rebind, the Registry needs the remote interface and stub (if any) accessible via its classpath.

ejpa at 2007-7-29 13:34:41 > top of Java-index,Core,Core APIs...
# 2

it throw following exception.

java.rmi.UnmarshalException: error unmarshalling arguments; nestedexception is:

java.lang.ClassNotFoundException: .RmiServer_Stub

whereas stub class is also exist in jar

brajesh_rathorea at 2007-7-29 13:34:41 > top of Java-index,Core,Core APIs...
# 3

See reply #1.

ejpa at 2007-7-29 13:34:41 > top of Java-index,Core,Core APIs...
# 4

Actully you dont understand my problem.

i have 2 jar file RmiClient.jar and RmiServer.jar

when i run RMIserver.jar it throws following exception.

Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:

java.lang.ClassNotFoundException: RmiServer_Stub

the RmiServer.jar contain all the class file (stub/skelton,remote,etc) whichever needed.

even i set class path to that folder where RMIserver.jar is placed

inspite of that it throws ClassNotFoundException : RmiServer_Stub

i dont undersatand why classloder , not able to load class file from Rmiserver.jar.

any idea.

thanks in advance

Regards

Brajesh K

brajesh_rathorea at 2007-7-29 13:34:41 > top of Java-index,Core,Core APIs...
# 5

Actually you don't understand my answer, and also you didn't answer my question. See reply #1. The Registry needs access to those classes too.

FYI your problem comes up about twice a day in this forum. I've seen it thousands of times over the last ten years.

ejpa at 2007-7-29 13:34:41 > top of Java-index,Core,Core APIs...
# 6

i am using Naming.rebind to bind Rmiserver instance.

RmiServer server = new RmiServer();

Naming.rebind("rmi:/localhost:1099",server );

how can i bind RmiServer_stub instance. so it can be accessible from jar

thanks

brajesh_rathorea at 2007-7-29 13:34:41 > top of Java-index,Core,Core APIs...
# 7

If you don't understand the answer don't just repeat yourself. It's irritating. You have to start the Registry in such a way that it has your appropriate JAR files on its classpath. There are several ways of doing that, e.g. rmiregistry -J-classpath

ejpa at 2007-7-29 13:34:41 > top of Java-index,Core,Core APIs...