You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[OSGi] Multibindings and AssistedInject JARs need version property for fragment host #1049
The libraries "guice-multibindings" and "guice-assistedinject" are implemented as OSGi fragements for the "com.google.inject" bundle.
If two versions (e.g. 3.0.0 and 4.0.0) of Guice are used within the same OSGi container (Eclipse Equinox) then the following exception occurs:
java.lang.LinkageError: loader constraint violation: loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) previously initiated loading for a different type with name "com/google/inject/Binder"
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:273)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:632)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:586)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:538)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:525)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:325)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:334)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:411)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:361)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:353)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.google.inject.multibindings.Multibinder.newRealSetBinder(Multibinder.java:176)
at com.google.inject.multibindings.Multibinder.newSetBinder(Multibinder.java:132)
I think this is due to the following line within the MANIFEST.MF of each bundle:
Fragment-Host: com.google.inject
The Fragment-Host should not only specify the host bundle but also its version:
Activity
Temporary fix for Guice Multibindings until correct bundles are avail…
Set correct bundle version of fragment host.
Set correct bundle version of fragment host. Fixes #1050 & fixes #1049.
Set correct bundle version of fragment host. Fixes #1050 & fixes #1049.…
Set correct bundle version of fragment host. Fixes #1050 & fixes #1049.…