Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 292879 - Exception when running unit tests using Eclipse testing framework
Summary: Exception when running unit tests using Eclipse testing framework
Status: CLOSED DUPLICATE of bug 297769
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Runtime (show other bugs)
Version: 3.5   Edit
Hardware: PC Linux-GTK
: P3 critical (vote)
Target Milestone: ---   Edit
Assignee: platform-runtime-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-21 07:31 EDT by Michael Spector CLA
Modified: 2009-12-15 11:43 EST (History)
3 users (show)

See Also:


Attachments
List of plug-ins presenting while running unit test (8.21 KB, application/octet-stream)
2009-11-19 10:53 EST, Michael Spector CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Spector CLA 2009-10-21 07:31:21 EDT
I'm opening this bug, since I don't have an idea how to debug this issue. Please  advice!

java.lang.LinkageError: loader constraint violation in interface itable initialization: when resolving method "org.eclipse.core.internal.plugins.PluginDescriptor.getPlugin()Lorg/eclipse/core/runtime/Plugin;" the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) of the current class, org/eclipse/core/internal/plugins/PluginDescriptor, and the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) for interface org/eclipse/core/runtime/IPluginDescriptor have different Class objects for the type org/eclipse/core/runtime/Plugin used in the signature
    at org.eclipse.core.internal.plugins.PluginRegistry.getPluginDescriptor(PluginRegistry.java:117)
    at org.eclipse.core.internal.plugins.PluginRegistry.getPluginDescriptor(PluginRegistry.java:104)
    at org.eclipse.core.runtime.Platform.getPlugin(Platform.java:761)
    at org.eclipse.core.internal.preferences.legacy.InitLegacyPreferences.init(InitLegacyPreferences.java:43)
    at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.applyRuntimeDefaults(PreferenceServiceRegistryHelper.java:146)
    at org.eclipse.core.internal.preferences.PreferencesService.applyRuntimeDefaults(PreferencesService.java:367)
    at org.eclipse.core.internal.preferences.DefaultPreferences.applyRuntimeDefaults(DefaultPreferences.java:163)
    at org.eclipse.core.internal.preferences.DefaultPreferences.loadDefaults(DefaultPreferences.java:236)
    at org.eclipse.core.internal.preferences.DefaultPreferences.load(DefaultPreferences.java:232)
    at org.eclipse.core.internal.preferences.EclipsePreferences.create(EclipsePreferences.java:307)
    at org.eclipse.core.internal.preferences.EclipsePreferences.internalNode(EclipsePreferences.java:543)
    at org.eclipse.core.internal.preferences.EclipsePreferences.node(EclipsePreferences.java:669)
    at org.eclipse.core.internal.preferences.AbstractScope.getNode(AbstractScope.java:38)
    at org.eclipse.core.runtime.preferences.DefaultScope.getNode(DefaultScope.java:68)
    at org.eclipse.ui.preferences.ScopedPreferenceStore.getDefaultPreferences(ScopedPreferenceStore.java:250)
    at org.eclipse.ui.preferences.ScopedPreferenceStore.setDefault(ScopedPreferenceStore.java:638)
    at org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin.initializePreferences(TasksUiPlugin.java:821)
    at org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin.start(TasksUiPlugin.java:481)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:352)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:280)
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:408)
    at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111)
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:449)
    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:252)
    at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:326)
Comment 1 Michael Spector CLA 2009-10-21 07:34:11 EDT
This happens only when running Unit Tests. Running the same Eclipse instance in a usual way is OK.
Comment 2 Michael Spector CLA 2009-11-18 09:43:46 EST
Moving to Platform component, may be I'll get answer there.
Comment 3 John Arthorne CLA 2009-11-18 15:47:23 EST
It looks like you are using the very old (pre 3.0??) registry API, and the same class names from the old & new API are colliding. Your best bet is to move away from requiring org.eclipse.core.runtime.compatibility and just use the API in org.eclipse.equinox.registry instead. Or perhaps this is Mylyn - what version of Eclipse platform and Mylyn are you using?
Comment 4 Oleg Besedin CLA 2009-11-18 17:27:44 EST
Not much can be said without steps to reproduce.

In addtion to what John suggested, the other possible source for a problem like this is if you added plugins directly into the build path (Properties -> Java build path -> Projects) bypassing bundle dependency mechanism.

Please attach a sample that allows us to reproduce the problem.
Comment 5 Michael Spector CLA 2009-11-19 10:33:05 EST
(In reply to comment #3)
> It looks like you are using the very old (pre 3.0??) registry API, and the same
> class names from the old & new API are colliding. Your best bet is to move away
> from requiring org.eclipse.core.runtime.compatibility and just use the API in
> org.eclipse.equinox.registry instead. Or perhaps this is Mylyn - what version
> of Eclipse platform and Mylyn are you using?

I cannot move away from requiring org.eclipse.core.runtime.compatibility, since it is required by the Eclipse Unit test framework. This happens when I run Unit tests from the PDE builder. What do you need for re-production?
Comment 6 Michael Spector CLA 2009-11-19 10:37:27 EST
(In reply to comment #4)
> Not much can be said without steps to reproduce.
> 
> In addtion to what John suggested, the other possible source for a problem like
> this is if you added plugins directly into the build path (Properties -> Java
> build path -> Projects) bypassing bundle dependency mechanism.
> 
> Please attach a sample that allows us to reproduce the problem.

What kind of sample? I have a whole process (PDE headless) of building my feature, this happens while running unit tests from customTargets.xml. None of my features requires org.eclipse.core.runtime.compatibility, but it seems like it is required by at least these:

org.eclipse.ant.optional.junit_3.2.200.jar
org.eclipse.wst.xml.xpath.core_1.0.0.v200904240436.jar
org.eclipse.datatools.oda.cshelp_1.1.1.v200907031118.jar
Comment 7 Michael Spector CLA 2009-11-19 10:43:13 EST
I'm moving this to critical since it's very critical for me to solve this issue. Any suggestions regarding how to find why this happens are very welcome.
Comment 8 Michael Spector CLA 2009-11-19 10:53:33 EST
Created attachment 152595 [details]
List of plug-ins presenting while running unit test
Comment 9 Thomas Watson CLA 2009-12-15 11:43:38 EST

*** This bug has been marked as a duplicate of bug 297769 ***