Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cross-project-issues-dev] Is it acceptable to have two providers?

On Mon, Feb 13, 2012 at 4:00 AM, Ed Willink <ed@xxxxxxxxxxxxx> wrote:

Xtext gives me a dependency that loads
Acceleo gives me a dependency that loads

Both provide so I'm not surprised that Hudson gives me:
java.lang.LinkageError: loader constraint violation: loader (instance of
org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) previously initiated
loading for a different type with name "com/google/common/collect/SetMultimap"

Usually with 2 bundles supplying the same package you'll see ClassCastException (from SetMultipmap to SetMultimap, a head scratcher :-)  That this is a linkage indicates that some configuration of the bundles is causing the same classloader to try and load the same class from 2 different locations.  Maybe one of the Equinox guys can suggest what kind of configuration might cause this error?

Did Guava absorb, and that's why it includes those packages (instead of consuming them from the next version of the bundle)?

I see the problem in an JUnit test run as a plugin test. The same JUnit test run as an ordinary test has no problem, so perhaps there is a relative loading order of and that can be enforced to avoid the problem.

For a regular JUnit test, it's standard classpath rules ... it'll load the first class it finds on the classpath.  Whatever order the jars appear, it's happy with them.  Fixing them for JUnit Plugin tests probably means making sure that 1) and are both correctly versioned and export their packages versioned (it sounds like they do) and 2) the plugins that consume them are also following OSGi conventions (set a minimum baseline, don't re-export any packages, use Import-Package if possible).


Paul Webster
Hi floor.  Make me a sammich! - GIR

Back to the top