JDT throws ClassNotFoundException while instantiating ExecutableExtensionFactory [message #1719173] |
Tue, 05 January 2016 14:48  |
Eclipse User |
|
|
|
My application includes both an XText DSL and the JDT (the Java editor, among other things). When run from Eclipse all is well, but when I run from an exported executable, the following happens:
When I open a Java editor on a Java source file, org.eclipse.jdt.core throws org.eclipse.core.runtime.CoreException: Plug-in org.eclipse.xtext.ui.shared was unable to load class org.eclipse.xtext.ui.shared.internal.ExecutableExtensionFactory.
This is caused by java.lang.NoClassDefFoundError: org/eclipse/xtext/ui/guice/AbstractGuiceAwareExecutableExtensionFactory.
And this is caused by java.lang.ClassNotFoundException: org.eclipse.xtext.ui.guice.AbstractGuiceAwareExecutableExtensionFactory cannot be found by org.eclipse.xtext.ui.shared_2.9.1.v201512180746.
I believe this to be related to org.eclipse.xtext.ui.shared declaring an extension to org.eclipse.jdt.core.compilationParticipant as class org.eclipse.xtext.ui.shared.internal.ExecutableExtensionFactory:org.eclipse.xtext.builder.smap.DebugSourceInstallingCompilationParticipant. JDT tries to instantiate ExecutableExtensionFactory but can't find AbstractGuiceAwareExecutableExtensionFactory.
Is this a problem in the way I've exported my application? Am I holding something wrong?
The full trace is as follows:
!ENTRY org.eclipse.jdt.core 4 2 2016-01-05 14:38:00.107
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jdt.core".
!STACK 1
org.eclipse.core.runtime.CoreException: Plug-in org.eclipse.xtext.ui.shared was unable to load class org.eclipse.xtext.ui.shared.internal.ExecutableExtensionFactory.
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.throwException(RegistryStrategyOSGI.java:194)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.j
ava:178)
at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:905)
at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
at org.eclipse.jdt.internal.core.JavaModelManager$CompilationParticipants$1.run(JavaModelManager.java:344)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.jdt.internal.core.JavaModelManager$CompilationParticipants.getCompilationParticipants(JavaModelManager.java:339)
at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.notifyParticipants(ReconcileWorkingCopyOperation.java:239)
at org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:95)
at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:729)
at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:789)
at org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1250)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:126)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.access$0(JavaReconcilingStrategy.java:108)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy$1.run(JavaReconcilingStrategy.java:89)
at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.reconcile(JavaReconcilingStrategy.java:87)
at org.eclipse.jdt.internal.ui.text.java.JavaReconcilingStrategy.initialReconcile(JavaReconcilingStrategy.java:178)
at org.eclipse.jdt.internal.ui.text.CompositeReconcilingStrategy.initialReconcile(CompositeReconcilingStrategy.java:114)
at org.eclipse.jdt.internal.ui.text.JavaCompositeReconcilingStrategy.initialReconcile(JavaCompositeReconcilingStrategy.java:136)
at org.eclipse.jface.text.reconciler.MonoReconciler.initialProcess(MonoReconciler.java:105)
at org.eclipse.jdt.internal.ui.text.JavaReconciler.initialProcess(JavaReconciler.java:406)
at org.eclipse.jface.text.reconciler.AbstractReconciler$BackgroundThread.run(AbstractReconciler.java:173)
Caused by: java.lang.NoClassDefFoundError: org/eclipse/xtext/ui/guice/AbstractGuiceAwareExecutableExtensionFactory
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:272)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:632)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:588)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:540)
at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:527)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)
at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:327)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:402)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:352)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:344)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:573)
at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
... 22 more
Caused by: java.lang.ClassNotFoundException: org.eclipse.xtext.ui.guice.AbstractGuiceAwareExecutableExtensionFactory can
not be found by org.eclipse.xtext.ui.shared_2.9.1.v201512180746
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:439)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:352)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:344)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 38 more
|
|
|
|
|
|
Re: JDT throws ClassNotFoundException while instantiating ExecutableExtensionFactory [message #1720177 is a reply to message #1720160] |
Thu, 14 January 2016 17:11  |
Eclipse User |
|
|
|
Theory: it's a race condition.
Scenario A: My plug-in activates before org.eclipse.jdt.core. My Activator needs SharedStatusModule from org.eclipse.xtext.ui.shared and loads it. There's no need to access org.eclipse.xtext.ui from .shared, so that optional dependency is dropped/ignored. Later, org.eclipse.jdt.core activates and creates CompilationParticipants. It finds org.eclipse.xtext.ui.shared, tries to make a ExecutableExtensionFactory, finds no BundleWire (or whatever it should be at that point) representing org.eclipse.xtext.ui so never looks there, eventually finds no AbstractGuiceAwareExecutableExtensionFactory, and fails. That's my original scenario.
Scenario B: org.eclipse.jdt.core activates before my plug-in and starts instantiating CompilationParticipants. It tries to create org.eclipse.xtext.ui.shared.internal.ExecutableExtensionFactory, recognizes that the dependency on org.ecliplse.xtext.ui is necessary, so it looks there, finds AbstractGuiceAwareExecutableExtensionFactory, and successfully creates everything. Later, my plug-in activates, looks for SharedStateModule, finds it, and they all execute happily ever after.
The only thing that happened when I added an additional type between my Factory and the AbstractGuiceAware one was to make my activation take just a beat longer, giving org.eclipse.jdt.core a chance to get to org.eclipse.xtext.ui.shared before I did. Or, if there's no multi-threading in there, it did nothing and I'm going to have intermittent problems with this depending on solar flares, phases of the moon, and whether a butterfly in Munich sneezes once or twice.
So, again, probably not your bug/issue. But does it sound plausible, if not necessarily reproducible? Where do I file it? (Bugzilla, yeah, but which product etc.?)
Thanks!
|
|
|
Powered by
FUDForum. Page generated in 0.04505 seconds