Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 547748

Summary: Get persistent and fatal NoClassDefFoundError: org/eclipse/jdt/core/IElementChangedListener opening pom.xml file
Product: [Eclipse Project] JDT Reporter: David M. Karr <davidmichaelkarr>
Component: CoreAssignee: Stephan Herrmann <stephan.herrmann>
Status: CLOSED NOT_ECLIPSE QA Contact:
Severity: normal    
Priority: P3 CC: stephan.herrmann
Version: 4.11   
Target Milestone: 4.12 RC1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description David M. Karr CLA 2019-05-28 18:34:34 EDT
Today I'm finding that every time I try to open a pom.xml file, I get a "Multiple problems have occurred" dialog, with a detail of "An error has occurred. See error log for more details.
org/eclipse/jdt/core/IElementChangedListener".  Even worse, when I dismiss the dialog, it just displays again.  I tried many times to dismiss it, and it just redisplays.  My only option is killing Eclipse.

When restarting Eclipse, the pom.xml file is still displayed, and an error dialog comes up saying "'Loading referenced grammars' has encountered a problem", with a detail of "An internal error occurred during: "Loading referenced grammars".
org/eclipse/jdt/core/IElementChangedListener".

When I dismiss this dialog, it does not reappear.

I've tested this sequence several times now.

Note that I recently updated plugins, and I saw that there was an update to Spring IDE, one of my installed plugins.  I see deep in the "Caused by" that Spring IDE is mentioned.  This may only be a Spring IDE issue, but I'm still posting this here just in case.  I've also filed a similar ticket in the Spring JIRA.

In the error log, I see repeated instances of this stacktrace:
------------------
!ENTRY org.eclipse.jface 4 2 2019-05-28 15:11:48.411
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.NoClassDefFoundError: org/eclipse/jdt/core/IElementChangedListener
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.defineClass(ModuleClassLoader.java:279)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.defineClass(ClasspathManager.java:716)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findClassImpl(ClasspathManager.java:639)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:607)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClassImpl(ClasspathManager.java:587)
	at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:566)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:331)
	at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:395)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:473)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:414)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:153)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:612)
	at org.eclipse.wst.common.uriresolver.internal.URIResolverExtensionDescriptor.getResolver(URIResolverExtensionDescriptor.java:81)
	at org.eclipse.wst.common.uriresolver.internal.URIResolverExtensionRegistry.getMatchingURIResolvers(URIResolverExtensionRegistry.java:166)
	at org.eclipse.wst.common.uriresolver.internal.ExtensibleURIResolver.resolve(ExtensibleURIResolver.java:83)
	at org.eclipse.wst.xml.core.internal.modelquery.XMLCatalogIdResolver.resolve(XMLCatalogIdResolver.java:94)
	at org.eclipse.wst.xml.core.internal.modelquery.XMLModelQueryAssociationProvider.resolveGrammarURI(XMLModelQueryAssociationProvider.java:60)
	at org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.XMLAssociationProvider.resolveGrammarURI(XMLAssociationProvider.java:170)
	at org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.CMDocumentManagerImpl.lookupOrCreateResolvedURI(CMDocumentManagerImpl.java:124)
	at org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.CMDocumentManagerImpl.addCMDocumentReference(CMDocumentManagerImpl.java:206)
	at org.eclipse.m2e.editor.xml.PomModelHandler$PomModelQueryAssociationProvider.getCMElementDeclaration(PomModelHandler.java:120)
	at org.eclipse.wst.xml.core.internal.contentmodel.modelqueryimpl.ModelQueryImpl.getCMElementDeclaration(ModelQueryImpl.java:118)
	at org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration$AttributeShowingLabelProvider.getAttributeToShow(XMLContentOutlineConfiguration.java:75)
	at org.eclipse.wst.xml.ui.views.contentoutline.XMLContentOutlineConfiguration$AttributeShowingLabelProvider.getText(XMLContentOutlineConfiguration.java:142)
	at org.eclipse.m2e.editor.xml.PomContentOutlineConfiguration$PomLabelProvider.getText(PomContentOutlineConfiguration.java:231)
	at org.eclipse.jface.viewers.WrappedViewerLabelProvider.getText(WrappedViewerLabelProvider.java:99)
	at org.eclipse.jface.viewers.WrappedViewerLabelProvider.update(WrappedViewerLabelProvider.java:148)
	at org.eclipse.jface.viewers.ViewerColumn.refresh(ViewerColumn.java:144)
	at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:946)
	at org.eclipse.jface.viewers.AbstractTreeViewer$UpdateItemSafeRunnable.run(AbstractTreeViewer.java:120)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:47)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:176)
	at org.eclipse.jface.viewers.AbstractTreeViewer.doUpdateItem(AbstractTreeViewer.java:1025)
	at org.eclipse.jface.viewers.StructuredViewer$UpdateItemSafeRunnable.run(StructuredViewer.java:478)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.ui.internal.JFaceUtil.lambda$0(JFaceUtil.java:47)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:176)
	at org.eclipse.jface.viewers.StructuredViewer.updateItem(StructuredViewer.java:2160)
	at org.eclipse.jface.viewers.AbstractTreeViewer.createTreeItem(AbstractTreeViewer.java:840)
	at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:818)
	at org.eclipse.jface.viewers.TreeViewer.createChildren(TreeViewer.java:604)
	at org.eclipse.jface.viewers.AbstractTreeViewer.createChildren(AbstractTreeViewer.java:766)
	at org.eclipse.jface.viewers.AbstractTreeViewer.internalInitializeTree(AbstractTreeViewer.java:1586)
	at org.eclipse.jface.viewers.TreeViewer.internalInitializeTree(TreeViewer.java:780)
	at org.eclipse.jface.viewers.AbstractTreeViewer.lambda$1(AbstractTreeViewer.java:1571)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1448)
	at org.eclipse.jface.viewers.TreeViewer.preservingSelection(TreeViewer.java:363)
	at org.eclipse.jface.viewers.StructuredViewer.preservingSelection(StructuredViewer.java:1409)
	at org.eclipse.jface.viewers.AbstractTreeViewer.inputChanged(AbstractTreeViewer.java:1565)
	at org.eclipse.jface.viewers.ContentViewer.setInput(ContentViewer.java:282)
	at org.eclipse.jface.viewers.StructuredViewer.setInput(StructuredViewer.java:1686)
	at org.eclipse.wst.sse.ui.internal.contentoutline.ConfigurableContentOutlinePage.setInput(ConfigurableContentOutlinePage.java:696)
	at org.eclipse.wst.sse.ui.StructuredTextEditor.update(StructuredTextEditor.java:3199)
	at org.eclipse.m2e.editor.pom.MavenPomEditor$MavenPomActivationListener.handleActivation(MavenPomEditor.java:1019)
	at org.eclipse.m2e.editor.pom.MavenPomEditor$MavenPomActivationListener$1.run(MavenPomEditor.java:979)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:40)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:185)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3919)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3550)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1173)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1062)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:155)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:644)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:566)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:155)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:661)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:597)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1476)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jdt.core.IElementChangedListener cannot be found by org.springframework.ide.eclipse.xml.namespaces_3.9.9.201905211834-CI-B2250
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:460)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:414)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:153)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	... 85 more
------------------------
Comment 1 David M. Karr CLA 2019-05-28 18:38:19 EDT
I confirmed that when I reverted my configuration to the previous state, from 5/24, I'm not getting this error anymore.
Comment 2 Stephan Herrmann CLA 2019-05-28 19:03:09 EDT
(In reply to David M. Karr from comment #0)
> Today I'm finding that every time I try to open a pom.xml file, I get a
> "Multiple problems have occurred" dialog, with a detail of "An error has
> occurred. See error log for more details.
> org/eclipse/jdt/core/IElementChangedListener".

This interface has not significantly changed since 2011.

> Note that I recently updated plugins, and I saw that there was an update to
> Spring IDE, one of my installed plugins.  I see deep in the "Caused by" that
> Spring IDE is mentioned.  This may only be a Spring IDE issue, but I'm still
> posting this here just in case.  I've also filed a similar ticket in the
> Spring JIRA.

Thanks for saying. The ticket in the Spring JIRA should be the relevant one.


> Caused by: java.lang.ClassNotFoundException:
> org.eclipse.jdt.core.IElementChangedListener cannot be found by
> org.springframework.ide.eclipse.xml.namespaces_3.9.9.201905211834-CI-B2250

This means, Spring IDE is not correctly wired to JDT/Core. 

Closing. Feel free to re-open if you can reproduce this without Spring installed (which I strongly doubt).