xml-library classloader clashes

hi ...
recently i have created a small plugin for intellij that supports
another project of mine. the interesting thing is, that this plugin
delivers its own jaxen, xpath, jdom classes and works without problems.
recently i played around with the excellent jira-plugin and discovered
problems when both plugins are installed at the same time. the jira
plugin bundles its own xml-libs (again jaxen, xpath, ...). my assumption
is that somehow the classloaders (if there are distinct classloaders for
each plugin) get confused because of the different versions of the same
class. actually it are the same classes (same version) but at another
position. does anyone of you have noticed something similar???
what would be the right solution for this problem??? is there the
possibility to provide central libraries as xpath or jaxen only once for
the plugins (beside from copying them by hand into the intellij/lib
directory)?

thanks in advance

cK

8 comments

Yes, the plugins are sharing one classloader :(
Christian Köstlin wrote:

hi ...
recently i have created a small plugin for intellij that supports
another project of mine. the interesting thing is, that this plugin
delivers its own jaxen, xpath, jdom classes and works without problems.
recently i played around with the excellent jira-plugin and discovered
problems when both plugins are installed at the same time. the jira
plugin bundles its own xml-libs (again jaxen, xpath, ...). my assumption
is that somehow the classloaders (if there are distinct classloaders for
each plugin) get confused because of the different versions of the same
class. actually it are the same classes (same version) but at another
position. does anyone of you have noticed something similar???
what would be the right solution for this problem??? is there the
possibility to provide central libraries as xpath or jaxen only once for
the plugins (beside from copying them by hand into the intellij/lib
directory)?

thanks in advance

cK


0

Sven Krause wrote:

Yes, the plugins are sharing one classloader :(

oops??? is this a bug or a feature??? do some strategies exist
to bundle important libraries as individual plugins for use for all
other plugins (i guess the newest version of the libs should almost ever
be ok (if the plugins that use a particular lib are still under
development/improvement))???

thanks in advance

cK

0

Christian Köstlin wrote:

oops??? is this a bug or a feature???

Its the way as its implemented. It has the advantage that you can extend
already existing plugins.

do some strategies exist
to bundle important libraries as individual plugins for use for all
other plugins (i guess the newest version of the libs should almost ever
be ok (if the plugins that use a particular lib are still under
development/improvement))???

The could be a way:
Your required libraries become an own plugin. So the user can deselect it,
if its conflict with other plugins. If all plugins follows this strategie
the user can build its own configuration. All this works of course onle, if
no concurrent libs are required from multiple plugins.


Sven

0

On 2004/02/05 08:46, Sven Krause wrote:

Yes, the plugins are sharing one classloader :(


That could be a bug. In
http://www.intellij.net/tracker/idea/quickSearch?searchText=14763 Eugene
Zhuravlev says:
"Each IDEA plugin is loaded in a separate classloader (so called
"plugin-loader") to prevent library conflicts. "


Bas

0

Bas Leijdekkers wrote:

>> Yes, the plugins are sharing one classloader :(

That could be a bug. In
http://www.intellij.net/tracker/idea/quickSearch?searchText=14763 Eugene
Zhuravlev says:
"Each IDEA plugin is loaded in a separate classloader (so called
"plugin-loader") to prevent library conflicts. "

mhhh ... i searched a little more and made the following experiment:
i used a small util-class for stringmanipulation that was delivered with
one plugin without problems from within another plugin -> the
classloader do get mixed up.

im not sure how to resolve the problem .. in the tracker one solution is
to remove "double" libraries, which is not possible if i do not want to
change plugins from other people :))
as described before in this thread one solution would be to bundle all
relevant libraries that could be used in some plugins into separate
plugins ...
but then it should be made for sure what classes are accessible from
what plugin ... perhaps dependencies would be a solution (ala osgis
import or eclipses requires statements) .. additional the pluginmanager
would have to resolve dependencies ... everything is alot of work ...

mhhh .. what would you sugest???

regards
christian koestlin

0

On 2004/02/06 00:11, Christian Köstlin wrote:

mhhh .. what would you sugest???


I would suggest filing a bug report. Please post a link to it here, so
people can vote for it.

Each plugin should have it's own class loader (which I think is the case
now). The bug: That class loader should only load library classes from
it's own jar's (not from the jars of other plugins), then from jdk
libraries and then from idea libraries.

I would file a bug myself, but you have seen this behavior and can
reproduce it. I on the other hand am only thinking about developing a
plugin, but have never done that:-)

Regards,
Bas

0

Bas Leijdekkers wrote:

On 2004/02/06 00:11, Christian Köstlin wrote:

>> mhhh .. what would you sugest???


I would suggest filing a bug report. Please post a link to it here, so
people can vote for it.

Each plugin should have it's own class loader (which I think is the case
now). The bug: That class loader should only load library classes from
it's own jar's (not from the jars of other plugins), then from jdk
libraries and then from idea libraries.

I would file a bug myself, but you have seen this behavior and can
reproduce it. I on the other hand am only thinking about developing a
plugin, but have never done that:-)

should the issue contain a small example "test" for the desired behavior???

cK

0

On 2004/02/06 11:42, Christian Köstlin wrote:

Bas Leijdekkers wrote:

>> On 2004/02/06 00:11, Christian Köstlin wrote:
>>
>>> mhhh .. what would you sugest???
>>
>>
>> I would suggest filing a bug report. Please post a link to it here, so
>> people can vote for it.
>>
>> Each plugin should have it's own class loader (which I think is the case
>> now). The bug: That class loader should only load library classes from
>> it's own jar's (not from the jars of other plugins), then from jdk
>> libraries and then from idea libraries.
>>
>> I would file a bug myself, but you have seen this behavior and can
>> reproduce it. I on the other hand am only thinking about developing a
>> plugin, but have never done that:-)

should the issue contain a small example "test" for the desired behavior???


I'm sure they would appreciate that, but it is not required.

0

Please sign in to leave a comment.