ClassNotFound when i try to connect to server.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   collen_mavunga
Posted On:   Wednesday, January 15, 2003 01:57 AM

I'm new to rmi and i'm currently developing a network application (for my final year prooject). The application comprises a server and client which are implemented using rmi. Both components (server-client) compile correctly and the server runs without a glitch until the client application tries to make a connection to the server. When i run the client application a nested (ClassNotFound)error message is returned from the server. The offending class is the stub class for the server application. Could someone please give me a few pointers on what i might be doing wrong, i thought it might be something to do with my classpath environment but i've tried altering it and the same error occurs. =>t   More>>

I'm new to rmi and i'm currently developing a network application (for my final year prooject).

The application comprises a server and client which are implemented using rmi. Both components (server-client) compile correctly and the server runs without a glitch until the client application tries to make a connection to the server.



When i run the client application a nested (ClassNotFound)error message is returned from the server. The offending class is the stub class for the server application.

Could someone please give me a few pointers on what i might be doing wrong, i thought it might be something to do with my classpath environment but i've tried altering it and the same error occurs.


=>the server class is called DataAccess
=>the client is EmployeeInterface



error connecting to server error unmarshalling return;
nested exception is:

java.lang.ClassNotFoundException: server.DataAccess_Stub

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

java.lang.ClassNotFoundException: server.DataAccess_Stub

java.lang.ClassNotFoundException: server.DataAccess_Stub

at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

at java.security.AccessController.doPrivileged(Native
Method)

at java.net.URLClassLoader.findClass
(URLClassLoader.java:188)

at java.lang.ClassLoader.loadClass(ClassLoader.java:297)

at java.lang.ClassLoader.loadClass(ClassLoader.java:253)

at java.lang.ClassLoader.loadClassInternal
(ClassLoader.java:313)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:195)

at sun.rmi.server.LoaderHandler.loadClass
(LoaderHandler.java:354)

at sun.rmi.server.LoaderHandler.loadClass
(LoaderHandler.java:88)

at sun.rmi.server.MarshalInputStream.resolveClass
(MarshalInputStream.jav

a:145)

at java.io.ObjectInputStream.inputClassDescriptor
(ObjectInputStream.java

:918)

at java.io.ObjectInputStream.readObject
(ObjectInputStream.java:366)

at java.io.ObjectInputStream.readObject
(ObjectInputStream.java:236)

at java.io.ObjectInputStream.inputObject
(ObjectInputStream.java:1186)

at java.io.ObjectInputStream.readObject
(ObjectInputStream.java:386)

at java.io.ObjectInputStream.readObject
(ObjectInputStream.java:236)

at sun.rmi.registry.RegistryImpl Stub.lookup(Unknown Source)

at java.rmi.Naming.lookup(Naming.java:84)

at client.EventHandlers. (EventHandlers.java:28)

at client.EmployeeInterface.

EmployeeInterface.java:54)

at client.EmployeeInterface.main(EmployeeInterface.java:307)

   <<Less

Re: ClassNotFound when i try to connect to server.

Posted By:   Edward_Harned  
Posted On:   Wednesday, January 15, 2003 12:58 PM

When the client unmarshalles the remote object it gets the _stub. So, where is the _stub? Yes, it is a locate problem. Either with the classpath or codebase.


First, try it on a local machine where everyone uses the same classpath with this url: rmi:/// (yes those are three slashes)


When that works then put a remote address inside the second and third slash. When that works, then use the codebase option.

About | Sitemap | Contact