Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Access Classpath from "child" Plugin by "parent" plugin
Access Classpath from "child" Plugin by "parent" plugin [message #462534] Tue, 30 January 2007 09:39 Go to next message
Eclipse UserFriend
Originally posted by: eclipse.hmersch.de

Hi,

I've looked to Eclipse RCP some time and now starting to develop a set
of plugins. All of them share some common libraries, thus I packed them
together in a common-plugin. It works just fine for now.

And my problem comes here:
One of the "child" plugins (means, it depends on the common-plugin) uses
and includes a library (Xmlbeans compiled XMLSchema), which is used by
another library within the common plugin (XFire).

The Child-Plugin now tries to communicate with a server using the
XFire-library by using an interface from the Child-Plugins-Classpath.
And complains about:
"Illegal argument. interface my.package.Interface is not visible from
class loader"
The reason is clear: The Xfire cant access the child plugin's libraries.

I read a lot of the FAQ dealing with the classloader, but none of them
target this "reverse classpath access issue".

How could I solve this?
I dont want to bundle XFire several times to all Child Plugins neither
can pack all "Xmlbeans compiled XMLSchema" mlibs to the common package.

Thanks in advance,
Henning
Re: Access Classpath from "child" Plugin by "parent" plugin [message #462540 is a reply to message #462534] Tue, 30 January 2007 12:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: askme.fake.net

On Tue, 30 Jan 2007 10:39:57 +0100, Henning Mersch wrote:

> Hi,
>
> I've looked to Eclipse RCP some time and now starting to develop a set of
> plugins. All of them share some common libraries, thus I packed them
> together in a common-plugin. It works just fine for now.
>
> And my problem comes here:
> One of the "child" plugins (means, it depends on the common-plugin) uses
> and includes a library (Xmlbeans compiled XMLSchema), which is used by
> another library within the common plugin (XFire).
>
> The Child-Plugin now tries to communicate with a server using the
> XFire-library by using an interface from the Child-Plugins-Classpath. And
> complains about:
> "Illegal argument. interface my.package.Interface is not visible from
> class loader"
> The reason is clear: The Xfire cant access the child plugin's libraries.
>

What? Hmm. So the child plugin needs access to the common-plugin's
libraries which includes XFire. OK. How did you accomplish that?


> I read a lot of the FAQ dealing with the classloader, but none of them
> target this "reverse classpath access issue".
>
> How could I solve this?
> I dont want to bundle XFire several times to all Child Plugins neither can
> pack all "Xmlbeans compiled XMLSchema" mlibs to the common package.
>
> Thanks in advance,
> Henning


I think this issue is common to hibernate users because silly hibernate
wont allow you to tell it which classloader to use... Anyway, my answer
which I think is the proper one is to create a service plugin that does
the XFire stuff at the request of either the child plugin or the common
plugin. You would pass the classes to that plugin and it would do its
thing on them. I don't like cross plugin library mish mashing.

A quick and dirty solution is to make your child plugin a fragment. But
this eventually fails because Eclipse does not use fragments this way and
so they do not test them this way much. But on the bright side you get to
contribute to Eclipse by finding all the bugs in fragments ;)
Re: Access Classpath from "child" Plugin by "parent" plugin [message #462587 is a reply to message #462534] Tue, 30 January 2007 23:56 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
I think that the buddy classloading will help you here.

http://www.eclipsezone.com/articles/eclipse-vms/

In short, you'd have:

Eclipse-BuddyPolicy: registered

in one, and

Eclipse-RegisterBuddy: org.example.foo

in the other.

Alex.
Re: Access Classpath from "child" Plugin by "parent" plugin [message #462826 is a reply to message #462587] Thu, 01 February 2007 10:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: ngs_NOSPAM_.mystical.de

Hi Alex,

Alex Blewitt wrote:
> I think that the buddy classloading will help you here.
>
> http://www.eclipsezone.com/articles/eclipse-vms/
PERFECT !
Great - This was exactly I was searching for!

Just one short note:
> Eclipse-RegisterBuddy: org.example.foo
The article mentioned, this should be the "Bundle-Name:" of the
"common plugin", but in my case it has to be the
"Bundle-SymbolicName:".

Anyway - THANKS for this articel (and providing the URL to me)!

Best regards - Henning
Re: Access Classpath from "child" Plugin by "parent" pl [message #462862 is a reply to message #462826] Thu, 01 February 2007 14:52 Go to previous message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
Yes, it should be the symbolic name and not the text display name. Thanks for pointing it out; I'll try and get it updated.

Alex.
Previous Topic:Obligations if I copy EPL'd source code and include in commercial product
Next Topic:delete-key doesn't work
Goto Forum:
  


Current Time: Wed Oct 09 20:26:34 GMT 2024

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

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

Back to the top