RMI- and ClassLoader-Problem: [message #46497] |
Tue, 25 January 2005 15:21 |
Eclipse User |
|
|
|
Originally posted by: tai.qnamic.com
Our company is evaluating the option of migrating our products (Platform and
PlanOpt) into the eclipse RCP-Plugin-environment. Unfortunately I'm running
into some RMI- and ClassLoader-problems:
I've create our dependent products as plugin-projects in eclipse:
- Platform (contains basic classes) and
- PlanOpt (dependent on Platform containing our agent-server and a
Swing-Gantt-Chart communication with a agent via RMI)
Further on I've created a Project-Plugin EclipseTest (dependent on Platform
and PlanOpt), which embeds the Gantt-Chart in a SampleView. The Dependencies
looks like this:
EclipseTest-Plugin
PlanOpt-Plugin
Platform-Plugin
Unfortunately my Gantt-Chart cannot be displayed in the SampleView (cannot
find the class in PlanOpt):
ClassNotFoundException:
com.qnamic.planopt.base.model.PlanAgentProxyImpl_Stub (no security manager:
RMI class loader disabled)
Suggested by another posting I've implemented my own EclipseClassLoader
(which starts correctly). My Loader contaisn the Bundles Platform and
PlanOpt for retrieving the needed classes from the dependent plugins via
bundle.loadClass()... but the same exception occurs.
I've solved this by adding my SampleView (derived from ViewPart) whis
one-liner:
SampleView.createPartControl(Composite parent) {
....
Thread.currentThread().setContextClassLoader(this.getClass() .getClassLoader(
));
....
Now if a trigger an action in my Gantt (the action triggers a command passed
from the Gantt through and executed by the agent-server , which in return
passes some data back to the Gantt).
Unfortunately my Test-Plugin always come with same exception:
java.rmi.UnmarshalException: error unmarshalling return; nested exception
is:
java.lang.ClassNotFoundException:
com.qnamic.planopt.base.command.CreateADMObjectCommand (no security manager:
RMI class loader disabled)
....also on the agent-server:
java.rmi.ServerException: RemoteException occurred in server thread; nested
exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception
is:
java.lang.ClassNotFoundException:
com.qnamic.planopt.ui.notification.OReqDataPackage (no security manager: RMI
class loader disabled)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.ja va:292)
at sun.rmi.transport.Transport$1.run(Transport.java:148)
The funny things is: the command is passed and restarting the client just
shows the changes on the gantt.
These additionals infos might help:
In all Plugin-Manifests I've entered the dependencies (PlanOpt depends on
Platform, EclipseTest depends on PlanOpt and Platform). In the
Project-Properties>Java-Build-Path>Export-Tab I've also checked the checkbox
"Plug-in Dependencies".
The interesting thing is: when I select in the Java-Build-Path>Projects-Tab
e.g. the Project "Platform", then an error-message appears on top: "Build
path contains duplicate entry 'Platform' for project PlanOpt". I assume this
is fine because it should be covered by the checkbox "Plug-in Depencies"?
I've also tried to implement in all core-classes in the projects Platform
and PlanOpt this one-liner:
Thread.currentThread().setContextClassLoader(this.getClass() .getClassLoader(
));
....unfortunately without success :-(
Please help an Eclipse-Rookie :o)
Tai
|
|
|
|
Powered by
FUDForum. Page generated in 0.03052 seconds