Re: Reggie having problems with net.jini.entry.AbstractEntry

Gregg Wonderly <[email protected]> Wed, 19 Dec 2007 11:49:38 -0600
Newsgroups gmane.comp.java.sun.jini
Message-ID <[email protected]>
Stephen Green wrote:
> Stephen Green wrote:
>> I'm writing my first Jini services and I'm encountering a problem.  
>> I'm extending net.jini.entry.AbstractEntry to make a specific entry 
>> type for the things that I'm registering with the lookup service, but 
>> I'm seeing the following exception:
>>
>> Dec 18, 2007 1:12:55 PM com.sun.jini.reggie.RegistrarProxy 
>> handleException
>> INFO: unmarshalling failure
>> java.lang.NoClassDefFoundError: net/jini/entry/AbstractEntry
>>         at java.lang.ClassLoader.defineClass2(Native Method)
>>         at java.lang.ClassLoader.defineClass(ClassLoader.java:719)
>>         at 
>> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:160)
>>         at java.net.URLClassLoader.defineClass(URLClassLoader.java:254)
>>         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
>>         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>>         at java.security.AccessController.doPrivileged(Native Method)
>>         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

You didn't include the entire stack trace here so that we could see the initial 
calling context.  Typically this happens when you have the base class in your 
classpath, because everyone refers to it, and you have either not put jsk-dl.jar 
into your codebase, or you are not activating the appropriate ClassLoader with
Thread.setContextClassLoader() inside of a Swing/AWT event, or something else 
that happens in another thread which wouldn't have the context class loader 
otherwise set from prior activity.

>> So, what incredibly dumb mistake am I making?
> 
> I realize that it's a bit gauche to reply to one's own message, but I 
> figured out the incredibly dumb mistake that I was making, and I wanted 
> to record the answer for the archives.
> 
> The problem was that I was running LaunchAll from a shell that had a jar 
> containing the classes that I wanted to be loaded across the network, so 
> I expect that the problem was that the JVM running reggie was trying to 
> load the application classes in a classloader that didn't know about the 
> Jini classes.
> 
> Private message for Keith: You were wrong:  it wasn't codebase, it was 
> classpath!  This is cold comfort for me pulling such a boneheaded move, 
> however.

If you can provide the entire stacktrace, we can make sure that we understand 
the context of the failure to resolve the class.

Thanks

Gregg Wonderly

--------------------------------------------------------------------------
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]