Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] Osgi class loading question

I really need to look at the code to suggest anything specific, but as a
guess, you cannot easily share classes between code in eclipse plugins
and in maven plugin.

For example, if you add a jar with
"edu/umd/cs/findbugs/config/UserPreferences" in your eclipse plugin this
won't work, because Maven will load a different copy of the class. There
is a way to make this work, but it is rather involved and I would
consider using reflection instead.

--
Regards,
Igor

On 10-11-27 07:40 PM, Benson Margulies wrote:
I've got as plugin that depends on the findbugs plugin. It very nearly
works, except that one seemingly innocent call leads to ...

Strangely (from my point of view) this happens when invoking a method
of this UserPreferences class. Obtaining that object from a call into
findbugs wasn't a problem, but calling into it is.

java.lang.LinkageError: loader constraint violation: loader (instance
of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader)
previously initiated loading for a different type with name
"edu/umd/cs/findbugs/config/UserPreferences"
_______________________________________________
m2e-dev mailing list
m2e-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/m2e-dev


Back to the top