ClassNotFoundException while running Server class

Sebastian Konietzny <[email protected]> Mon, 15 Oct 2007 18:45:21 +0200
Newsgroups gmane.comp.java.sun.rmi
Organization CeBiTec / Bielefeld University
Message-ID <[email protected]>
Dear all,

I am new to RMI and I am not so used to programming in Java anyway.

I am writing you this email, because I have a problem with my small RMI
testing scenario and until now I couldn't find an answer to my problem
in the web.

So, here is what my problem is about:

I have a ServerApplication class that creates a remote object and
imports the appropriate interface definition.


====================================================================
package rpc_testing.server;

import rpc_testing.rmi.RemoteProcessExecutableIF;
import java.rmi.server.*;
import java.rmi.registry.Registry;
import java.rmi.registry.LocateRegistry;

public class RpcTestServerApplication {

        public RpcTestServerApplication() {
        }

        public static void main(String[] args) {
                try {
                    RapidMinerExecutioner rapExec = new RapidMinerExecutioner();
                    RemoteProcessExecutableIF stub = (RemoteProcessExecutableIF)
UnicastRemoteObject.exportObject(rapExec, 0);

                    // Bind the remote object's stub in the registry
                    Registry registry = LocateRegistry.getRegistry();
                    registry.bind("RemoteProcessExecution", stub);

                    System.err.println("Server ready");
                } catch (Exception e) {
                    System.err.println("Server exception: " + e.toString());
                    e.printStackTrace();
                }
        }
}
===================================================================


Starting the ServerApplication I receive the following Exceptions:

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Server exception: java.rmi.ServerException: RemoteException occurred in
server thread; nested exception is:
        java.rmi.UnmarshalException: error unmarshalling arguments; nested
exception is:
        java.lang.ClassNotFoundException: rpc_testing.rmi.RemoteProcessExecutableIF
java.rmi.ServerException: RemoteException occurred in server thread;
nested exception is:
        java.rmi.UnmarshalException: error unmarshalling arguments; nested
exception is:
        java.lang.ClassNotFoundException: rpc_testing.rmi.RemoteProcessExecutableIF
        at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:385)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
        at sun.rmi.transport.Transport$1.run(Transport.java:153)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
        at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
        at java.lang.Thread.run(Thread.java:595)
        at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
        at
sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
        at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:343)
        at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
        at
rpc_testing.server.RpcTestServerApplication.main(RpcTestServerApplication.java:20)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments;
nested exception is:
        java.lang.ClassNotFoundException: rpc_testing.rmi.RemoteProcessExecutableIF
        at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
        at sun.rmi.server.UnicastServerRef.oldDispatch(UnicastServerRef.java:375)
        at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:240)
        at sun.rmi.transport.Transport$1.run(Transport.java:153)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.rmi.transport.Transport.serviceCall(Transport.java:149)
        at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:466)
        at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:707)
        at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.ClassNotFoundException:
rpc_testing.rmi.RemoteProcessExecutableIF
        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:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:242)
        at sun.rmi.server.LoaderHandler.loadProxyInterfaces(LoaderHandler.java:707)
        at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:651)
        at sun.rmi.server.LoaderHandler.loadProxyClass(LoaderHandler.java:588)
        at java.rmi.server.RMIClassLoader$2.loadProxyClass(RMIClassLoader.java:628)
        at java.rmi.server.RMIClassLoader.loadProxyClass(RMIClassLoader.java:294)
        at
sun.rmi.server.MarshalInputStream.resolveProxyClass(MarshalInputStream.java:238)
        at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1500)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1463)
        at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1699)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1305)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:348)
        ... 9 more

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


The ServerApplication is running on the same computer as the
"rmiregistry"-script. So, I doubt that my problem is about wrong
settings of the Server codebase property! In fact I made no such
settings so far.


Can you help me and tell me what might be the problem?


Best regards,
Sebastian

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff RMI-USERS".  For general help, send email to
[email protected] and include in the body of the message "help".

For a list of frequently asked RMI questions please refer to:
http://java.sun.com/j2se/1.3/docs/guide/rmi/faq.html

To view past RMI-USERS postings, please see:
http://archives.java.sun.com/archives/rmi-users.html