Re: Blitz Javaspaces with Plugins (Classloader Problem)

Christian Hager <[email protected]> Mon, 25 Sep 2006 11:22:45 +0200
Newsgroups gmane.comp.java.sun.javaspaces
Organization Analytic Company GmbH
Message-ID <000c01c6e084$28dcc620$0b00a8c0@acwschristian>
Does nobody have any idea how to solve my problem. Maybe it helps to say that jpf is kind of like Eclipse RCP. Maybe this is more known than jpf.

Or is JINI in general incompatible to plugin frameworks? 

Christian Hager

----- Original Message ----- 
  From: Christian Hager 
  To: [email protected] 
  Sent: Thursday, September 21, 2006 5:42 PM
  Subject: Blitz Javaspaces with Plugins (Classloader Problem)


  Hello again,

  I started today to use Blitz in our Apllication. Hereby I encountered the following problem and now I'm hoping anyone here could help me solving it.

  I'm trying to use Blitz together with the JPF Plugin Framework used in our Application (http://jpf.sourceforge.net/). But when doing so I encounter a Problem with the classloaders because every Plugin has its own classloader. I'm getting the following Stacktrace.

  Exception in thread "org.ac.sql.rcode.client" java.lang.NoClassDefFoundError: net/jini/core/entry/Entry
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClass(Unknown Source)
   at java.security.SecureClassLoader.defineClass(Unknown Source)
   at java.net.URLClassLoader.defineClass(Unknown Source)
   at java.net.URLClassLoader.access$100(Unknown Source)
   at java.net.URLClassLoader$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClassInternal(Unknown Source)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Unknown Source)
   at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
   at sun.rmi.server.LoaderHandler.loadClass(Unknown Source)
   at java.rmi.server.RMIClassLoader$2.loadClass(Unknown Source)
   at java.rmi.server.RMIClassLoader.loadClass(Unknown Source)
   at net.jini.loader.ClassLoading.loadClass(ClassLoading.java:138)
   at org.dancres.blitz.mangler.EntryMangler.unMangle(EntryMangler.java:92)
   at org.dancres.blitz.remote.BlitzProxy.take(BlitzProxy.java:159)
   at org.ac.sql.rcode.client.RCodeClientPlugin.loop(RCodeClientPlugin.java:142)
   at org.ip.yare.core.YAREplugin.run(YAREplugin.java:497)

  My guess is that the RMIClassLoader cannot see the jini-core.jar which is located in a plugin. I tried to set the classloader using the following

  Thread.currentThread ().setContextClassLoader (super.getManager ().getPluginClassLoader (super.getDescriptor ()));

  Doing so worked fine for the plugin that writes in the Javaspace but when I try to take an entry from the space I get the above error. 

  Thanks in advance for any solutions

  Christian Hager

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