Hi Ritchie!
I don't think you are creating stubs and skeletons for implemenation classes. It is always better to seperate implementation classes from server program. Use rmic to generate stubs and skeletons.Then run your server program.It'll work
Code for HelloWorld app:
//Remote interface
import java.rmi.*;
public interface HelloWorld extends Remote
{
public
String sayHello(String name) throws RemoteException;
}
//Implementation class
import java.rmi.*;
import java.rmi.server.*;
public class HelloWorldImpl extends UnicastRemoteObject implements HelloWorld
{
public HelloWorldImpl() throws RemoteException
{
super();
}
public String sayHello(String name)
{
return "Hello "+ name;
}
}
//server program
import java.rmi.*;
class HelloServer{
public static void main(String[] args)
{
try
{
HelloWorldImpl hw = new HelloWorldImpl();
System.out.println("Trying to bind");
Naming.rebind("localhost/Hello",hw);
System.out.println("Bound");
}
catch(Exception e)
{
e.printStackTrace();
}
}
}
after creating and compiling all these classes,
use rmic to create stub and skeleton classes(rmic HelloWorldImpl). Then start the server program.
[ September 20, 2003: Message edited by: Murthy Narasimha ]