Results 1 to 8 of 8
  1. #1
    Kowsi is offline Member
    Join Date
    Oct 2010
    Posts
    8
    Rep Power
    0

    Default RMI UnmarshalException error

    I too have the same problem as ChrisMayhew. But i am using Wifi, how overcome this problem in localhost. While running server program (in jdk/bin), i am receiving the following error message...

    Exception java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: ArmstrongImp_StubRaised

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    25

    Default

    Kowsi, I have moved your post out of this thread: java-rmi-problem since you have a new question. It may be related to the question in the old thread (hence the link) but is a hijack of the old thread. We like to put new questions in their own threads. Thanks for your cooperation and best of luck.

  3. #3
    Kowsi is offline Member
    Join Date
    Oct 2010
    Posts
    8
    Rep Power
    0

    Default

    Hi, i have attached server program. The problem is server is not connecting to local host...

    This is Interface...

    import java.rmi.*;

    public interface ArmstrongInf extends java.rmi.Remote
    {
    public boolean isArmstrong(long num)throws java.rmi.RemoteException;
    }
    This implements interface..
    import java.rmi.*;
    import java.rmi.server.*;

    public class ArmstrongImp extends java.rmi.server.UnicastRemoteObject implements ArmstrongInf
    {
    public ArmstrongImp() throws java.rmi.RemoteException
    {
    super();
    }
    public boolean isArmstrong(long num) throws java.rmi.RemoteException
    {
    long n=num;
    int arm=0,len=(Long.toString(num)).length();
    while(n>0)
    {
    arm+=Math.pow(n%10,len);
    n=n/10;
    }
    if(num==arm)
    return true;
    else
    return false;
    }
    }
    This is Server...

    import java.rmi.Naming;
    public class ArmstrongServer
    {
    public ArmstrongServer()
    {
    try
    {
    ArmstrongInf Arm = new ArmstrongImp();
    Naming.rebind("rmi://localhost:8080/Armstrong",Arm);
    }
    catch(Exception e){System.out.println("Exception "+e+"Raised");}
    }
    public static void main(String args[])
    {
    new ArmstrongServer();
    }
    }
    Its showing unmarshall exception... How to get rid off this...

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,442
    Rep Power
    18

    Default

    What's the full exception including stack trace.

    Your catch block only seems to be printing the exception name, which isn't as helpful.

  5. #5
    Kowsi is offline Member
    Join Date
    Oct 2010
    Posts
    8
    Rep Power
    0

    Default

    I cannt get u... I dont know what you are asking... I dont know much about java... It cannot able to connect the server to local host... I think its due to vista...

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,442
    Rep Power
    18

    Default

    Java Code:
    System.out.println("Exception "+e+"Raised")
    This tells you next to nothing about the problem.
    Java Code:
    e.printStackTrace();
    this will tell you exactly what exception has occurred and, more importantly, where it occurred.

    Always print the stack trace on an exception.

  7. #7
    Kowsi is offline Member
    Join Date
    Oct 2010
    Posts
    8
    Rep Power
    0

    Default

    i got following error...

    java.rmi.ServerException: RemoteException occurred in server thread; nested exce
    ption is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
    tion is:
    java.lang.ClassNotFoundException: ArmstrongImp_Stub
    at sun.rmi.server.UnicastServerRef.oldDispatch(Unicas tServerRef.java:396
    )
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastSe rverRef.java:250)
    at sun.rmi.transport.Transport$1.run(Transport.java:1 59)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport. java:155)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages( TCPTransport.java:5
    35)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run0(TCPTranspor
    t.java:790)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run(TCPTransport
    .java:649)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExec
    utor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor
    .java:908)
    at java.lang.Thread.run(Thread.java:619)
    at sun.rmi.transport.StreamRemoteCall.exceptionReceiv edFromServer(Stream
    RemoteCall.java:255)
    at sun.rmi.transport.StreamRemoteCall.executeCall(Str eamRemoteCall.java:
    233)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:3 59)
    at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
    at java.rmi.Naming.rebind(Naming.java:160)
    at ArmstrongServer.<init>(ArmstrongServer.java:10)
    at ArmstrongServer.main(ArmstrongServer.java:16)
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested ex
    ception is:
    java.lang.ClassNotFoundException: ArmstrongImp_Stub
    at sun.rmi.registry.RegistryImpl_Skel.dispatch(Unknow n Source)
    at sun.rmi.server.UnicastServerRef.oldDispatch(Unicas tServerRef.java:386
    )
    at sun.rmi.server.UnicastServerRef.dispatch(UnicastSe rverRef.java:250)
    at sun.rmi.transport.Transport$1.run(Transport.java:1 59)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.rmi.transport.Transport.serviceCall(Transport. java:155)
    at sun.rmi.transport.tcp.TCPTransport.handleMessages( TCPTransport.java:5
    35)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run0(TCPTranspor
    t.java:790)
    at sun.rmi.transport.tcp.TCPTransport$ConnectionHandl er.run(TCPTransport
    .java:649)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run Task(ThreadPoolExec
    utor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor
    .java:908)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: java.lang.ClassNotFoundException: ArmstrongImp_Stub
    at java.net.URLClassLoader$1.run(URLClassLoader.java: 200)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:3 07)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:2 52)
    at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:320)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:247)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandl er.java:434)
    at sun.rmi.server.LoaderHandler.loadClass(LoaderHandl er.java:165)
    at java.rmi.server.RMIClassLoader$2.loadClass(RMIClas sLoader.java:620)
    at java.rmi.server.RMIClassLoader.loadClass(RMIClassL oader.java:247)
    at sun.rmi.server.MarshalInputStream.resolveClass(Mar shalInputStream.jav
    a:197)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectI nputStream.java:157
    5)
    at java.io.ObjectInputStream.readClassDesc(ObjectInpu tStream.java:1496)
    at java.io.ObjectInputStream.readOrdinaryObject(Objec tInputStream.java:1
    732)
    at java.io.ObjectInputStream.readObject0(ObjectInputS tream.java:1329)
    at java.io.ObjectInputStream.readObject(ObjectInputSt ream.java:351)
    ... 12 more

  8. #8
    Kowsi is offline Member
    Join Date
    Oct 2010
    Posts
    8
    Rep Power
    0

    Default

    Ya... I got...


    I just changed my url(ie., name that i am binding) in server and client...

    instead of localhost i used "127.0.0.1"...

Similar Threads

  1. Replies: 1
    Last Post: 12-05-2009, 07:28 AM
  2. Replies: 1
    Last Post: 10-26-2009, 04:38 PM
  3. Err:java.rmi.UnMarshalException
    By Deepa in forum New To Java
    Replies: 4
    Last Post: 06-11-2009, 01:22 PM
  4. Replies: 3
    Last Post: 01-23-2009, 08:53 AM
  5. Replies: 0
    Last Post: 07-09-2008, 12:36 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
  •