The Artima Developer Community
Sponsored Link

Legacy Jini Forum
Objects, the Network, and Jini



This page contains an archived post to the Jini Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Jini and marshalling of objects

Posted by Juanjo Aparicio on March 23, 2001 at 9:47 AM

I am working on a project that uses Jini.

I am having problems trying to serve some classes.

First of all there's a class implementing UnicastRemoteObject
that registers as a Jini service in the LUS (Lookup Service).

Then other client classes contact the LUS, get the proxy for
the service and start using it.

But the service also uses some extra (inner and outer) classes
that should be served as well. All of them classes live in a
jar file that is served by the http server (the same server for
the LUS, reggie, and the Service).

When the client (which is an instance of the same class as the
server itself!) tries to get an object served by the service
I get an Unable to find class for unmarshalling exception. That
object is an instance of an inner class of the server class.
Therefore, the class is already known to the client (in fact,
the class definition is within the service and client class,
which is the same). But just to make sure the inner classes
are also on the downloadable proxy that lives in the http served

First I thought it failed because the class was private, so I
tried to make it public. It also failed.

I just can't take that class outside the service class, because
it touches data within the instance of the service class (and
that's what inner classes are intended for, aren't they).

Furthermore, I've literally crowded the code with System.out.println
just to keep track of what the service (and the client) is doing.
And the exception is thrown from within the class that contains
the inner class, so I know it's being well-served (or maybe not?).

If anyone understands anything, please don't hesitate to answer.
And if you do, please be so kind to send me a copy of your answer
to the e-mail address above. Just in case you don't see it, it is:

Thank you very much.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us