This is my first RMI program, and i am running this in a same machine and i'm using jdk 1.5
file name : MethodImpl.java
-----------------------------------
import java.rmi.*;
interface MethodImpl extends Remote
{
double getSqrt(double dbl) throws RemoteException;
}
____________________________________________________
file name : RMIServer.java
----------------------------------------------------------
import java.rmi.*;
import java.rmi.registry.*;
import java.rmi.server.*;
public class RMIServer extends UnicastRemoteObject implements MethodImpl
{
public RMIServer() throws RemoteException {}
{
System.out.println("The server is instantiated");
}
public double getSqrt(double dbl)
{
return Math.sqrt(dbl);
}
public static void main(
String[] args)
{
try
{
RMIServer server = new RMIServer();
Naming.rebind("sqrt",server);
}
catch(Exception ex)
{
System.out.println("Error -- "+ex.toString());
}
}
}
___________________________________________________________
file name : RMIClient.java
--------------------------------------------------------
import java.rmi.*;
import java.rmi.registry.*;
public class RMIClient
{
public static void main(String[] args){
try
{
MethodImpl mthdImpl = (MethodImpl)Naming.lookup("rmi://127.0.0.1/sqrt");
double dbl = mthdImpl.getSqrt(100);
System.out.println("SQRT:"+dbl);
}
catch(Exception ex)
{
System.out.println("Error -- "+ex.toString());
}
}
}
___________________________________________________________
I compiled the above like
javac MethodImpl.java
javac RMIServer.java
javac RMIClient.java
and as a result i got
MethodImpl.class
RMIServer.class
RMIClient.class
then i used rmic compiler to create stub and skeleton like
rmic RMIServer
above action generated only the
RMIServer_stub.class and it doesn't create RMIServer_skeleton.class
but there is no error message.
What may be the problem?
How to create skeleton?
Please help me out
-------------------------------------------------------
Thanks in Advance
Thanigaivel S.
[ October 12, 2005: Message edited by: S Thanigaivel ]
[ October 12, 2005: Message edited by: S Thanigaivel ]
[ October 12, 2005: Message edited by: S Thanigaivel ]