Re: Notify and Outrigger Codebase

Dan Creswell <[email protected]>
Newsgroups gmane.comp.java.sun.javaspaces
Message-ID <[email protected]>
Jon Meyer wrote:
> Javaspace users,
>
>   I am having problems trying to implement a listenter (thru the notify
> method) for a Javaspace.  I get Unmarshelling exception from the server
> saying it cannot find the listener class.   I figured that the javaspace

Okay - so first thing to do is make sure you're passing the correct
thing to Outrigger.

If you're passing a RemoteObject, you need to make sure you're passing a
Remote reference not the RemoteObject itself - if you're passing the
reference produced from a call to Exporter.export() that should be
sufficient.

If you're passing a smart proxy wrapping a remote reference, you can
pass an instance of the appropriate smart proxy class but, again, make
sure it contains a Remote reference as above.

If you're passing a remote reference, I don't think you should need a
codebase at all - just wondering if you're also passing a
MarshalledObject as part of the notify() call and what it might contain?

Have you got a stack trace for the UnmarshallException you could post?

> instance does not have a reference to the proper codebase that contains the
> classfiles, obvious right....  So the question is, what is the best way to
> pass the codebase to the instance?  I am using jini 2.1b2 and launch the
> javaspace using the start.jar with a set of configuration files.  I have
> tried adding the reference to the codebase thru the config file like so....
>
> private static t_outrigger_codebase =
> "http://codebasesvr:8080/jini/outrigger-dl.jar"
>    + " http://codebasesvr:8080/jini/jsk-dl.jar"
>    + " http://codebasesvr:8080/jini/notifyListener-dl.jar"
> <other settings for passing to ServiceDescriptor>
> private static testing_outrigger_service =
>    new NonActivatableServiceDescriptor(
>           t_outrigger_codebase, outrigger_policy, outrigger_classpath,
>           outrigger_impl, new String[] {outrigger_config});
>

I think this is the wrong way around.  You need the
notifyListener-dl.jar to be specified as the _client_ codebase not
_outrigger_.  Basic rule of thumb is that the supplier of the instance
(client in this case) of an object should have the codebase for the
appropriate code assigned to it such that when the object is marshalled
and passed to the recipient (outrigger) the recipient can download the
necessary classes.

Hope that helps,

Dan.

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JAVASPACES-USERS".  For general help, send email to
[email protected] and include in the body of the message "help".

To view past JAVASPACES-USERS postings, please see:
http://archives.java.sun.com/archives/javaspaces-users.html

JDC members can download the JavaSpaces(tm) Technology from:
http://developer.java.sun.com/developer/products/jini/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.