Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help with RMI

 
Cathy Young
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In order to test the RMI, I copied a small program from Sun and modified the package a little. But have some trouble making it work!
The interface: c:\test\src\echo\mid\IEcho.java:

The servant: c:\test\src\echo\mid\EchoImpl.java

server: c:\test\src\echo\server\EchoServer.java:

client: c:\test\src\echo\client\Client.java

I cleared the environment settings by

Compile and the classes files are under c:\test\classes\
Next, generate the stub and skeleton by

To run the server, I started the rmiregistry from c:\
and then start the server by running:

I got the following exception, can someone tell me why?! Thanks!!
Exception in thread "main" java.rmi.ServerException: RemoteException occurred in
server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested excep
tion is:
java.lang.ClassNotFoundException: echo.mid.EchoImpl_Stub
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.lang.ClassNotFoundException: echo.mid.EchoImpl_Stub
java.lang.ClassNotFoundException: echo.mid.EchoImpl_Stub
at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknow
n Source)
at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source)
at sun.rmi.server.UnicastRef.invoke(Unknown Source)
at sun.rmi.registry.RegistryImpl_Stub.rebind(Unknown Source)
at java.rmi.Naming.rebind(Unknown Source)
at echo.server.EchoServer.main(EchoServer.java:15)
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cathy, I have to learn RMI myself for this SCJD thing, so I am willing to try this sample code too. What is the URL link to SUN where you got the code?
Maybe that way I can spot where the problem lies.
 
aadhi agathi
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Cathy Young:
[/CODE]
To run the server, I started the rmiregistry from c:\

try starting the rmiregistry from the /test/classes folder. Reason being, the rmiregistry should be knowing what is bound to what when you do a lookup. All the best
 
Cathy Young
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Barry Gaunt:
Cathy, I have to learn RMI myself for this SCJD thing, so I am willing to try this sample code too. What is the URL link to SUN where you got the code?
Maybe that way I can spot where the problem lies.

Barry,
I took a class from Sun and this code is from their textbook.
--Cathy
 
Cathy Young
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by aadhi agathi:

try starting the rmiregistry from the /test/classes folder. Reason being, the rmiregistry should be knowing what is bound to what when you do a lookup. All the best

Thanks a lot, Aadhi!
--Cathy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic