Results 1 to 2 of 2
  1. #1
    Stijn_vdd is offline Member
    Join Date
    Mar 2011
    Posts
    2
    Rep Power
    0

    Default RMI (remote method invocation) Java

    Hi,

    First of all, my English isn't that good, so i'll try to write without spelling errors.

    I Followed following tutorial for setup a RMI connection (http://download.oracle.com/javase/1....o-world.html#4)

    The first time when i ran the client and the server (on the same computer) it all worked fine.
    The second time that i tried to run the server following error occurd:

    Quote:
    java -classpath out example.hello.Server
    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: example.hello.Hello
    java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: example.hello.Hello
    at sun.rmi.server.UnicastServerRef.oldDispatch(Unicas tServerRef.java:413)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastSe rverRef.java:267)
    at sun.rmi.transport.Transport$1.run(Transport.java:1 77)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport. java:173)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages( TCPTransport.java:553)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run0(TCPTransport.java:80
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run(TCPTransport.java:667)
    at java.util.concurrent.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:636)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceiv edFromServer(StreamRemoteCall.java:273)
    at sun.rmi.transport.StreamRemoteCall.executeCall(Str eamRemoteCall.java:251)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:3 77)
    at sun.rmi.registry.RegistryImpl_Stub.bind(Unknown Source)
    at example.hello.Server.main(Server.java:64)
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: example.hello.Hello
    at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknow n Source)
    at sun.rmi.server.UnicastServerRef.oldDispatch(Unicas tServerRef.java:403)
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastSe rverRef.java:267)
    at sun.rmi.transport.Transport$1.run(Transport.java:1 77)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport. java:173)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages( TCPTransport.java:553)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run0(TCPTransport.java:80
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run(TCPTransport.java:667)
    at java.util.concurrent.ThreadPoolExecutor.runWorker( ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:636)
    Caused by: java.lang.ClassNotFoundException: example.hello.Hello
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 21)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 66)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:264)
    at sun.rmi.server.LoaderHandler.loadProxyInterfaces(L oaderHandler.java:72
    at sun.rmi.server.LoaderHandler.loadProxyClass(Loader Handler.java:672)
    at sun.rmi.server.LoaderHandler.loadProxyClass(Loader Handler.java:609)
    at java.rmi.server.RMIClassLoader$2.loadProxyClass(RM IClassLoader.java:646)
    at java.rmi.server.RMIClassLoader.loadProxyClass(RMIC lassLoader.java:311)
    at sun.rmi.server.MarshalInputStream.resolveProxyClas s(MarshalInputStream.java:255)
    at java.io.ObjectInputStream.readProxyDesc(ObjectInpu tStream.java:154
    at java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1510)
    at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1749)
    at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1346)
    at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:36
    ... 12 more
    First i thought it was because the name "Hello" already was registered to the rmiregistry, But trying with "Hallo2" didn't work.

    Does someone know a possible solution ?

    Kind regards!

  2. #2
    lovelesh is offline Senior Member
    Join Date
    Nov 2010
    Location
    Delhi
    Posts
    135
    Blog Entries
    1
    Rep Power
    0

    Smile

    It seems either
    1. you have not specified RMI Server codebase path, or
    2. your codebase jar is not getting picked up by jvm.

    provide "-Djava.rmi.server.codebase=file:/<path to ur codebase>" as an argument while running the server and client

Similar Threads

  1. Listening to JPopupMenu invocation
    By nik_meback in forum AWT / Swing
    Replies: 5
    Last Post: 12-03-2010, 03:06 PM
  2. Remote deploy and remote work with JBoss AS
    By chalda in forum Eclipse
    Replies: 2
    Last Post: 03-08-2010, 12:17 PM
  3. RMI Invocation
    By kavithakr in forum Advanced Java
    Replies: 1
    Last Post: 03-14-2009, 10:04 PM
  4. HELP: Method Invocation
    By rjuyal in forum Advanced Java
    Replies: 4
    Last Post: 04-07-2008, 12:07 PM
  5. Replies: 2
    Last Post: 06-12-2007, 05:33 PM

Posting Permissions

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