0

I am running an RMI server on a VM, but I keep getting this error:

Failure during Name registration: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: MarketBBImpl_Stub

Failure during Name registration: java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
    java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: AMPLocation_Stub

All of the class files are in the same directory(including the stub files), and when I run it localy there are no problems.

Anyone know what's going on here?

ryanthescot
  • 327
  • 4
  • 16

2 Answers2

1

If you look at the stack trace you will probably see bind() or rebind() down there. That indicates that the server concerned is the RMI Registry. It needs access to your classes via its CLASSPATH.

user207421
  • 305,947
  • 44
  • 307
  • 483
-1

Have you run http server to deliver classes to RMI server?

Konstantin Milyutin
  • 11,946
  • 11
  • 59
  • 85
  • (a) you aren't obliged to use the codebase feature; (b) it delivers class files to the Regsitry and the client, rarely to the server. – user207421 Mar 04 '11 at 00:27
  • 2
    By RMI server I meant RMI registry. Is it hard to understand?? – Konstantin Milyutin Mar 04 '11 at 06:59
  • i'm a bit lost here. i'm running the rmiregistry on the same machine as the program that's trying to bind the objects. i thought that if the objects were in the same location then this would work without a http server? – ryanthescot Mar 05 '11 at 18:23
  • You have 2 variants: 1) is simple, provide registry and client with classes just copying them and setting classpath 2) you can make dynamic loading of classes using http server. So if want to keep it simple just make sure that when you start RMI registry and client you tell them classpath – Konstantin Milyutin Mar 06 '11 at 08:06
  • yes, actually, it is a bit hard to understand. In the RMI context 'server' usually means the remote object, or else the host it is running on. It can also mean the DGC remote object. Best to be specific. – user207421 Mar 11 '11 at 06:54