Results 1 to 2 of 2
  1. #1
    amp88 is offline Member
    Join Date
    Apr 2010
    Posts
    3
    Rep Power
    0

    Default ClassNotFoundException Starting RMI Server With 1.7 Update 25

    Hi, all. I've got a frustrating issue running an RMI application and I'd appreciate any input.

    The command to start rmiregistry is as follows:

    Java Code:
    rmiregistry -J-Djava.rmi.server.codebase=file:/E:/TempStore/BackupManagerDBServer/
    With previous Java versions I was just running rmiregistry without an argument, but after the update and this problem I changed to the above based on this notice. Running rmiregistry without an argument leads to the same Exception as with the argument.

    The command line argument to start the server is as follows:

    Java Code:
    java -Xmx4G -Dlog4j.configuration="file:log4j.properties" -Djava.rmi.server.codebase=file:/E:/TempStore/BackupManagerDBServer/ -Djava.security.policy=server.policy -jar BackupManagerDBServer.jar
    The server.policy file is as follows:

    Java Code:
    grant codeBase "file:/E:/TempStore/BackupManagerDBServer/" {
    	permission java.security.AllPermission;
    };
    I've also tried specifying just FilePermission and SocketPermission with the same results.

    When the server runs it first does some database work before attempting to bind to the registry. This database work is accomplished OK and it references classes which are in the same jar file as the class mentioned in the ClassNotFoundException below. To build the jar file I used eclipse's Export -> Runnable JAR File -> Package required libraries into generated JAR option.

    On running the application I get the following exception:

    Java Code:
    server.BackupManagerDBServerMain.<init>(BackupManagerDBServerMain.java:66) - Error initialising RMI: RemoteException occurred in server thread; nested exception is: 
    	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
    	java.lang.ClassNotFoundException: shared.interfaces.BackupManagerDBInterface
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is: 
    	java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
    	java.lang.ClassNotFoundException: shared.interfaces.BackupManagerDBInterface
    	at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
    	at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
    	at sun.rmi.transport.Transport$1.run(Unknown Source)
    	at sun.rmi.transport.Transport$1.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at sun.rmi.transport.Transport.serviceCall(Unknown Source)
    	at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
    	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
    	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    	at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown Source)
    	at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
    	at sun.rmi.server.UnicastRef.invoke(Unknown Source)
    	at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    	at server.BackupManagerDBServerMain.initialiseRMI(BackupManagerDBServerMain.java:84)
    	at server.BackupManagerDBServerMain.<init>(BackupManagerDBServerMain.java:64)
    	at server.BackupManagerDBServerMain.main(BackupManagerDBServerMain.java:45)
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    	at java.lang.reflect.Method.invoke(Unknown Source)
    	at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is: 
    	java.lang.ClassNotFoundException: shared.interfaces.BackupManagerDBInterface
    	at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknown Source)
    	at sun.rmi.server.UnicastServerRef.oldDispatch(Unknown Source)
    	at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
    	at sun.rmi.transport.Transport$1.run(Unknown Source)
    	at sun.rmi.transport.Transport$1.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at sun.rmi.transport.Transport.serviceCall(Unknown Source)
    	at sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
    	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
    	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    	at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: shared.interfaces.BackupManagerDBInterface
    	at java.net.URLClassLoader$1.run(Unknown Source)
    	at java.net.URLClassLoader$1.run(Unknown Source)
    	at java.security.AccessController.doPrivileged(Native Method)
    	at java.net.URLClassLoader.findClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at sun.rmi.server.LoaderHandler$Loader.loadClass(Unknown Source)
    	at java.lang.ClassLoader.loadClass(Unknown Source)
    	at java.lang.Class.forName0(Native Method)
    	at java.lang.Class.forName(Unknown Source)
    	at sun.rmi.server.LoaderHandler.loadClassForName(Unknown Source)
    	at sun.rmi.server.LoaderHandler.loadProxyInterfaces(Unknown Source)
    	at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
    	at sun.rmi.server.LoaderHandler.loadProxyClass(Unknown Source)
    	at java.rmi.server.RMIClassLoader$2.loadProxyClass(Unknown Source)
    	at java.rmi.server.RMIClassLoader.loadProxyClass(Unknown Source)
    	at sun.rmi.server.MarshalInputStream.resolveProxyClass(Unknown Source)
    	at java.io.ObjectInputStream.readProxyDesc(Unknown Source)
    	at java.io.ObjectInputStream.readClassDesc(Unknown Source)
    	at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
    	at java.io.ObjectInputStream.readObject0(Unknown Source)
    	at java.io.ObjectInputStream.readObject(Unknown Source)
    	... 13 more
    java -version output:

    Java Code:
    java version "1.7.0_25"
    Java(TM) SE Runtime Environment (build 1.7.0_25-b17)
    Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)
    I just don't understand why the application isn't working on this Java version, after working for the last ~18 months without problems. I have read the enhancements notice but I think that even after making the adjustments to come in line with it I'm having this problem.

    Anyway, I'm hoping there's just something silly that I'm overlooking that someone can point out to me. If you want any more information just ask and I'll be happy to provide it.

    Thanks in advance for any input.

  2. #2
    Norberhuis is offline Member
    Join Date
    Jan 2009
    Location
    Delft
    Posts
    13
    Rep Power
    0

    Default Re: ClassNotFoundException Starting RMI Server With 1.7 Update 25

    I got a ClassNotFoundException when I did not run rmiregistry from the location of the codebase. I set the codebaseproperty inside my code. You could try it.

Similar Threads

  1. Replies: 2
    Last Post: 04-02-2010, 01:47 PM
  2. Error while starting the tomcat server
    By venkat.ravala in forum Web Frameworks
    Replies: 0
    Last Post: 01-15-2010, 05:33 AM
  3. Geting below em while starting the was6.1 server.
    By kumarjp in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 04-08-2009, 08:52 PM
  4. unnable to view the default home page though j2ee server starting properly
    By shallz in forum JavaServer Pages (JSP) and JSTL
    Replies: 2
    Last Post: 03-21-2009, 09:37 AM
  5. Problem in Starting JBOSS Server
    By 82rathi.angara in forum Networking
    Replies: 0
    Last Post: 06-16-2008, 02:58 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •