Access Classpath from "child" Plugin by "parent" plugin [message #462534] |
Tue, 30 January 2007 09:39 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 ;)
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05787 seconds