tags:

views:

40

answers:

2

I am trying to get an RMI activatable server to work - but no luck so far. Actually the server seems to run, but the client triggers a strange exception.

I have 3 projects:

  • client
  • common
  • server

Common is shared code between client and server (such as remote interfaces).

Steps I follow (been adapting this tutorial):

  • start registry --> OK
  • run rmid --> OK
  • start server setup --> OK
  • start client --> BOOM! Activation fails because classes in common are not found with NoClassDefFoundError in the server thread.

I am including the common class files in the codebase for the server so those clases/interfaces should be available to the server. It bums out on the remote interface itself - so the only alternative seems to pull all the common code into the server code, but this way the client code will have to know about the server code which plain sucks.

I did a bit of browsing and looks like this guy here has got the exact same problem.

Looks like in both cases this is happening when the activatable server references classes in some other package (in my case it's a custom package in the link above it's third-parties).

I really am at loss here - so any idea would be appreciated!

EDIT: some additional info - I am trying to debug the problem. It seems that the client retrieves the remote object in subject just fine (the reference is not null). The exception is thrown as soon as a method of the remote interface (the client knows about that interface) is called. If the activation occurs on the 1st method invocation then this is pretty obvious - but not too sure about when it actually tried to activate the remote object/server.

A: 

Are the interfaces in the classpath of the client?

TofuBeer
YES - they are. The client is using those interfaces, it would run in the first place, but it bums out only as soon as a method is called. The exact same client works fine with a non-activatable server.
JohnIdol
+1  A: 

Have you included the classes in the common package in the location of the activatable class on the server during setup? If you have more than one path make sure to separate them with spaces.

Tarelli
err ... I was actually missing the path to the classes in *common* on the location parameter of the ActivationDesc ... thanks so much for spotting this!
JohnIdol