hi all,
i am facing one problem in rmi programming.
it is simple one but
here is my interface
import java.rmi.*;
public interface AddServerIntf extends Remote
{
double add(double d1,double d2) throws RemoteException ;
}
//***************server code
import java.rmi.*;
import java.rmi.server.*;
import java.net.*;
public class AddServerImpl extends UnicastRemoteObject implements AddServerIntf
{
public AddServerImpl()throws RemoteException
{
}
public double add(double d1,double d2)throws RemoteException
{
return(d1+d2);
}
public void call()throws Exception
{
AddServerImpl a=new AddServerImpl();
System.out.println("Server Is started");
Naming.rebind("a",a);
System.out.println("Server Is started");
}
public static void main(
String [] args)
{
try
{
System.out.println("Server Is started");
AddServerImpl a=new AddServerImpl();
a.call();
}
catch ( Exception e)
{
System.out.println("Exception:"+e);
}
}
}
//************client code
import java.rmi.*;
public class AddClient
{
public static void main(String[] args)
{
try
{
AddServerIntf b= (AddServerIntf)Naming.lookup("a");
System.out.println("the first no is :"+args[1]);
double d1=Float.parseFloat(args[1]);
double d2=Float.parseFloat(args[2]);
System.out.println("the sum is :"+b.add(d1,d2));
}
catch (Exception e)
{
System.out.println("Exception is :"+e);
}
}
}
/*all programs compile well
but when i am running my server it is throwing an exception
my output is
Server Is started
Server Is started
Exception:java.rmi.ServerException: RemoteException occurred in server
thread; n
ested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: AddServerImpl_Stub
please help me....
thank you