Link to home
Start Free TrialLog in
Avatar of jaki_77
jaki_77

asked on

RMI Exception

I'm getting an UnMarshallException while i'm running the RMI Server. It's a simple code i don't know why is it come.
I'm having both client & server on the same machine.

public interface server extends Remote{
  public void getvalue()throws RemoteException;
}

serverImpl
---------
public class ServerImpl extends UnicastRemoteObject implements server{
public ServerImpl() throws RemoteException{
   super();
}//const
public static void main(String[] args){
  try{
   ServerImpl ins = new ServerImpl();
   Naming.rebind("myserv",ins);
System.out.println("registered");
  }
  catch(Exception e){System.out.println(e.getMessage();}
}//main

}

c:\javac ServerImpl.java
c:\rmic ServerImpl
c:\java ServerImpl
Avatar of Ravindra76
Ravindra76


Instead of e.getMessage(),

give e.printStackTrace() and give the fll exception details
ASKER CERTIFIED SOLUTION
Avatar of Laminamia063099
Laminamia063099

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jaki_77

ASKER

actullay i've included some thing in that code i've cleared that error.

that's given below

Naming.rebind("myserv",ins); instead of this i've changed this to
Naming.bind("//localhost/myserv",ins);

i got correctly