Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » RMI- and ClassLoader-Problem:
RMI- and ClassLoader-Problem: [message #46497] Tue, 25 January 2005 15:21 Go to next message
Eclipse UserFriend
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
Re: RMI- and ClassLoader-Problem: [message #47323 is a reply to message #46497] Fri, 25 March 2005 10:59 Go to previous message
Genady Beryozkin is currently offline Genady BeryozkinFriend
Messages: 410
Registered: July 2009
Senior Member
This has been asked numerous times in this newsgroup. Please search for
"rmi" and "classloader" to see all the posts.

Genady

Genady Beryozkin
http://www.genady.net/



eclipse wrote:

>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
>
>
>
>
Previous Topic:Problem inside of FrameworkCommandInterpreter.java
Next Topic:LinkageError / IncompatibleClassChangeError
Goto Forum:
  


Current Time: Fri Apr 26 01:37:30 GMT 2024

Powered by FUDForum. Page generated in 0.02830 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top