Re: Basic Jini problem and cast exceptions

Bob Scheifler <[email protected]> Fri, 9 Nov 2007 13:46:44 -0500
Newsgroups gmane.comp.java.sun.jini
Message-ID <[email protected]>
> A PREFERRED list was new for me, but I copied and update onle I found
> into one jini dl jar.
> This is the content file I am using
> ------------------------------------------------------------------------------------------
>
> PreferredResources-Version: 1.0
>
> Name: net/jini/core/-
> Preferred: true
> ------------------------------------------------------------------------------------------

OK, if you had that before I asked my question, I think that explains
why you get the Hello ClassCastException.  You chose to put your
Hello interface in the net.jini.core package (normally we've reserved
the net.jini namespace for standards, BTW).  The preferred list above
will force the client to always download the Hello interface into a
new class loader, rather than resolving to the existing Hello interface
in your class path.

If you look at the net.jini.loader.pref package documentation, it says
that the public API classes of your service (like Hello interface)
should not be preferred, while implementation classes (like HelloServer)
should be preferred.

- Bob

--------------------------------------------------------------------------
Getting Started:     http://www.jini.org/wiki/Category:Getting_Started
Community Web Site:  http://jini.org
jini-users Archive:  http://archives.java.sun.com/archives/jini-users.html
Unsubscribing:       email "signoff JINI-USERS"  to [email protected]