LinkageError thrown when attempting to pass instance of class between 2 eclipse plugins

Posted by Ed on Stack Overflow See other posts from Stack Overflow or by Ed
Published on 2010-04-13T16:48:30Z Indexed on 2010/04/13 16:53 UTC
Read the original article Hit count: 469

I have found many people with simliar issues but no soultions...basically I have two eclipse plug-ins that both in ther class path rely on the same jar.

The UI plug-in replies on the Driver plug-in (implementing a custom ODA driver and UI for it). Both rely on a jar containing some other classes of mine and is called plugin-dto.jar

When the UI plug-in calls a method on one of the classes in the Driver plug-in that returns an object whose class is found in the plugin-dto jar I get the error:

java.lang.LinkageError: Class com/test/reporting/NrDsDriverProvider violates loader constraints
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.defineClass(DefaultClassLoader.java:183)
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.defineClass(ClasspathManager.java:576)
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findClassImpl(ClasspathManager.java:546)
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClassImpl(ClasspathManager.java:477)
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass_LockClassLoader(ClasspathManager.java:465)
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:445)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:211)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:381)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:457)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:398)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:105)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
    at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

Any ideas how I get around this issue?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about eclipse

Related posts about plugins