editor extension plugin does not allow dynamic classloading [message #167178] |
Mon, 08 December 2003 09:05 |
Eclipse User |
|
|
|
Originally posted by: news_reply.lindeijer.nl
Hello,
I'm developing a plugin and I'm expriencing a problem that seems simmilar to
that the problem experienced by Adib Saikale 11/21/2003. Unfortunately, his
problem is not resolved, and i don't understand his work-around.
I'm creating a plugin X that uses jini technology. Jini itself is not the
problem, i'm experienced using the jini lookup service required by plugin X.
First, I've created another plugin Y that contains classes that do jini
lookup discovery for me, and these classes use the
net.jini.discovery.LookupDiscovery class. Plugin Y refers to three
jar-libraries (via its xml file), two of which are the jini libraries
jini-core and jini-ext,
an one is my custom jar file containing classes I defined, such as one
called AgileSpace.
If I import plugin Y into a regular java project and create an instance of a
class called AgileSpace then I find the jini lookup service as expected.
This implies that plugin Y can do the job, and all three jar-files are on
the classpath, and are put on the classpath via Y's plugin.xml file.
Plugin X defines an extension point for org.eclipse.ui.editors. When I
import plugin Y into my new plugin X and then run the plugin in a new
runtime-workbench all is well as long as i don't initiate jini lookup
discovery. Before I initiate jini lookup discovery is use all kinds of
classes defined in plugin Y.
If i do initiate jini lookup discovery things break down just before
success: after the
reggie-dl.jar is downloaded from the jini lookup service's codebase. This
implies alot has allready gone well. The exception is as follows:
Dec 4, 2003 10:05:58 PM
net.jini.discovery.LookupDiscovery$UnicastDiscoveryTask run
INFO: exception occurred during unicast discovery
java.lang.NoClassDefFoundError: net/jini/core/lookup/ServiceRegistrar
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:509)
at
java.security.SecureClassLoader.defineClass(SecureClassLoade r.java:123)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:246)
at java.net.URLClassLoader.access$100(URLClassLoader.java:54)
at java.net.URLClassLoader$1.run(URLClassLoader.java:193)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:262)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:322 )
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:207)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:42 7)
at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:15 9)
at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.ja va:629)
at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java :257)
at net.jini.loader.ClassLoading.loadClass(ClassLoading.java:153 )
at
net.jini.io.MarshalInputStream.resolveClass(MarshalInputStre am.java:310)
at
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream .java:1503)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.ja va:1425)
at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStre am.java:1616)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java :1264)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java: 322)
at net.jini.io.MarshalledInstance.get(MarshalledInstance.java:3 70)
at
com.sun.jini.discovery.DiscoveryV1.doUnicastDiscovery(Discov eryV1.java:412)
at net.jini.discovery.LookupDiscovery$11.run(LookupDiscovery.ja va:2987)
at java.security.AccessController.doPrivileged(Native Method)
at
net.jini.discovery.LookupDiscovery.doUnicastDiscovery(Lookup Discovery.java:2
984)
at
net.jini.discovery.LookupDiscovery.access$2800(LookupDiscove ry.java:610)
at
net.jini.discovery.LookupDiscovery$UnicastDiscoveryTask.run( LookupDiscovery.
java:1564)
at com.sun.jini.thread.TaskManager$TaskThread.run(TaskManager.j ava:324)
The exception itself implies that the instance of my class AgileSystem is
created and that plugin Y is available to plugin X. The class
net.jini.core.lookup.ServiceRegistrar is in the jini-core.jar file. The fact
that com.sun.jini.thread.TaskManger is mentioned in the trace means that the
jini-ext.jar file is on the plugin's classpath. Because plugin Y works
within the jdt-perspective means that jini-core.jar can also be found if
jini-ext.jar can be found.
I have set the secutity policy to grant all permissions. This is
demonstrated by the fact that reggie-dl.jar is downloaded.
So what can be wrong? I've been looking at this exception trace for three
days now, I simply don't understand whats wrong. A minor improvement is
achieved in a put jini-core.jar and jini-ext.jar in the javaHome/jre/lib/ext
directory, but then a class-cast exception occurs.
Dec 4, 2003 10:28:46 PM
net.jini.discovery.LookupDiscovery$UnicastDiscoveryTask run
INFO: exception occurred during unicast discovery
com.sun.jini.discovery.DiscoveryProtocolException
at
com.sun.jini.discovery.DiscoveryV1.doUnicastDiscovery(Discov eryV1.java:434)
at net.jini.discovery.LookupDiscovery$11.run(LookupDiscovery.ja va:2987)
at java.security.AccessController.doPrivileged(Native Method)
at
net.jini.discovery.LookupDiscovery.doUnicastDiscovery(Lookup Discovery.java:2
984)
atnet.jini.discovery.LookupDiscovery.access$2800(LookupDisco very.java:610)
at
net.jini.discovery.LookupDiscovery$UnicastDiscoveryTask.run( LookupDiscovery.
java:1564)
at com.sun.jini.thread.TaskManager$TaskThread.run(TaskManager.j ava:324)
Caused by: java.lang.ClassCastException: com.sun.jini.reggie.RegistrarProxy
at
com.sun.jini.discovery.DiscoveryV1.doUnicastDiscovery(Discov eryV1.java:412)
... 6 more
If I export the plugin and install it in eclipse and activate the plugin (by
opening a particular file) the same problems occur. So.. What is different
within a org.eclipse.ui.editors plugin context with respect to a regular
java development context/perspective. And this difference in context effects
dynamic class loading, so it seems.
Also, how can I improve the information feedback? For example, I would like
the VM
to be verbose wrt class loading, but I cant find the output; it seems only
System.out is piped to the console.
Well... any suggestions? Making a minimal code plugin is not so easy because
one should configure a jini lookup service in the local network.
Thanks,
David.
|
|
|
Powered by
FUDForum. Page generated in 0.03473 seconds