dcsimg
different ClassNotFoundException problem
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   jimmy_bellows
Posted On:   Tuesday, May 8, 2001 04:57 AM

the previous ClassNotFoundException question dealt w/ the server failing to start. this question regards the inability for the client application to communicate w/ the server. the client continues to receive the java.lang.ClassNotFoundException:{package}.{classname}_Stub error. here is a detailed description... i have 2 computers: a. w/ the rmiregistry & server app b. w/ the client app all of my .jars and classes are located in 1 directory (c:classes) on a. i set my classpath to include all of the .jars, change to c:classes and start rmiregistry, then server (using -Djava.security... arguments). the server starts up fine. i move    More>>

the previous ClassNotFoundException question dealt w/ the server failing to start. this question regards the inability for the client application to communicate w/ the server. the client continues to receive the java.lang.ClassNotFoundException:{package}.{classname}_Stub error.



here is a detailed description...



i have 2 computers:

a. w/ the rmiregistry & server app

b. w/ the client app



all of my .jars and classes are located in 1 directory (c:classes) on a. i set my classpath to include all of the .jars, change to c:classes and start rmiregistry, then server (using -Djava.security... arguments). the server starts up fine.



i move over to computer b. and start the client app (using - Djava.security... arguments so i have 'socket' permission). this performs a java.rmi.Naming.lookup("rmi://computer-a/bind-name") on that computer. when i attempt this i get the following error:

java.rmi.UnmarshalException:
error unmarshalling return; nested exception is:

java.lang.ClassNotFoundException:{package}.{classname}_Stub
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at .... etc.




when i trace the tcp/ip between pcs, i see packets - so i verified actual communication. i shouldn't have to use the - Djava.rmi.codebase flag because the stub .class file i need access to is located in one of the .jars located in my classpath?



i have posed this question on several forums & nobody can answer it.

any help would be appreciated...

   <<Less

Re: different ClassNotFoundException problem

Posted By:   Richard_Robinson  
Posted On:   Friday, June 29, 2001 03:15 PM

Hello Jimmy,


I'm not sure if this will help. But you may wish to check the following a) that the RMI registry (if you're using it) on the server does not have the *_Stub in its classpath, b) that the *_Stub IS in the classpath of the class that registers (binds) the remote object with the registry, and c) that the same *_Stub is accessible via http: protocol for the client requesting it.




As per footnote on p. 63 of the J2EE in a Nutshell book (by O'Reilly), "Note that in order for the RMI registry to recognize and pass along the codebase property you specify, it has to be started in such a way that it can't find any of the remotely loaded classes on its CLASSPATH. So start your RMI registry with a CLASSPATH that doesn't include the stub/skeleton classes, etc., then run your RMI server with a CLASSPATH that includes all the required classes.

About | Sitemap | Contact