I want to run HelloWorld RMI on jboss 2.4.3 how can I do this ?
Please help .Please give code to run a simple helloworld RMI problem in jboss2.4.3.
I have tried with this :
HELLO INTERFACE -->
public interface Hello extends Remote {
String sayHello() throws RemoteException;
}
HELLO IMPLEMENTATION :-->
public class HelloImpl implements Hello {
public HelloImpl() throws RemoteException
{
super();
}
public String sayHello()
{
return "Hello World!";
}
public static void main(String args[])
{
try {
Context ctx = new InitialContext();
HelloImpl obj = new HelloImpl();
System.out.println(obj);
ctx.bind("HelloServer", obj);
System.out.println("HelloServer bound );
} catch (Exception e) {
System.out.println("HelloImpl err: " + e.getMessage());
e.printStackTrace();
}
}
}
The HELLOClient :-->
it looks up HelloServerand call sayHello();
I get this error :-->
HelloApplet exception: no such object in table
java.rmi.NoSuchObjectException: no such object in table
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
at com.myrmi.HelloImpl_Stub.sayHello(Unknown Source)
at HelloClient.main(HelloClient.java:26)