question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

lsp4e: ClassCastException

See original GitHub issue

When opening an xhtml-file (for JSF), then Eclipse throws nearly every few seconds (as long as this file is opened) this stacktrace:

java.lang.IllegalArgumentException: java.lang.ClassCastException@146089e7
	at jdk.internal.reflect.GeneratedMethodAccessor113.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.lsp4e.LSPEclipseUtils.getDocument(LSPEclipseUtils.java:610)
	at org.eclipse.lsp4e.operations.rename.LSPRenameHandler.setEnabled(LSPRenameHandler.java:110)
	at org.eclipse.ui.internal.handlers.HandlerProxy.setEnabled(HandlerProxy.java:229)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.canExecute(E4HandlerProxy.java:76)
	at jdk.internal.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:58)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:317)
	at org.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:251)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:173)
	at org.eclipse.e4.core.commands.internal.HandlerServiceHandler.isEnabled(HandlerServiceHandler.java:62)
	at org.eclipse.core.commands.Command.isEnabled(Command.java:832)
	at org.eclipse.ui.menus.CommandContributionItem.isEnabled(CommandContributionItem.java:917)
	at org.eclipse.ui.menus.CommandContributionItem.updateMenuItem(CommandContributionItem.java:531)
	at org.eclipse.ui.menus.CommandContributionItem.update(CommandContributionItem.java:484)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:858)
	at org.eclipse.jface.action.MenuManager.update(MenuManager.java:858)
	at org.eclipse.ui.internal.Workbench.updateActiveWorkbenchWindowMenuManager(Workbench.java:3152)
	at org.eclipse.ui.internal.Workbench.lambda$0(Workbench.java:3134)
	at org.eclipse.jface.bindings.BindingManager.fireBindingManagerChanged(BindingManager.java:901)
	at org.eclipse.jface.bindings.BindingManager.setActiveBindings(BindingManager.java:2181)
	at org.eclipse.jface.bindings.BindingManager.recomputeBindings(BindingManager.java:1742)
	at org.eclipse.jface.bindings.BindingManager.contextManagerChanged(BindingManager.java:691)
	at org.eclipse.core.commands.contexts.ContextManager.fireContextManagerChanged(ContextManager.java:164)
	at org.eclipse.core.commands.contexts.ContextManager.setActiveContextIds(ContextManager.java:295)
	at org.eclipse.e4.ui.services.ContextServiceAddon$1.changed(ContextServiceAddon.java:49)
	at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:105)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.processScheduled(EclipseContext.java:356)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.set(EclipseContext.java:372)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.activate(EclipseContext.java:659)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.activateBranch(EclipseContext.java:668)
	at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener$1.run(ShellActivationListener.java:99)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener.processWindow(ShellActivationListener.java:95)
	at org.eclipse.e4.ui.internal.workbench.swt.ShellActivationListener.handleEvent(ShellActivationListener.java:65)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1156)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4560)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1526)
	at org.eclipse.swt.widgets.Shell.windowDidBecomeKey(Shell.java:2314)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:6325)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
	at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:228)
	at org.eclipse.swt.widgets.Widget.becomeKeyWindow(Widget.java:389)
	at org.eclipse.swt.widgets.Shell.becomeKeyWindow(Shell.java:533)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:6044)
	at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
	at org.eclipse.swt.internal.cocoa.NSWindow.close(NSWindow.java:57)
	at org.eclipse.swt.widgets.Shell.destroyWidget(Shell.java:819)
	at org.eclipse.swt.widgets.Widget.release(Widget.java:1372)
	at org.eclipse.swt.widgets.Control.release(Control.java:2970)
	at org.eclipse.swt.widgets.Widget.dispose(Widget.java:694)
	at org.eclipse.jface.window.Window.close(Window.java:335)
	at org.eclipse.jface.dialogs.Dialog.close(Dialog.java:988)
	at org.eclipse.ui.internal.statushandlers.InternalDialog.close(InternalDialog.java:651)
	at org.eclipse.jface.dialogs.Dialog.okPressed(Dialog.java:948)
	at org.eclipse.jface.dialogs.Dialog.buttonPressed(Dialog.java:468)
	at org.eclipse.ui.internal.statushandlers.InternalDialog.buttonPressed(InternalDialog.java:185)
	at org.eclipse.jface.dialogs.Dialog.lambda$0(Dialog.java:619)
	at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:84)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:252)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4565)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1522)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1545)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1530)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1324)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4351)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3927)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1154)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:338)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1045)
	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:551)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:156)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:152)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:136)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:401)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:596)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1467)

Screenshot at Feb 07 15-23-39

When saving the xhtml-file, I also get this error:

An internal error occurred during: "Refreshing JSF information about: L/myproj/src/main/webapp/WEB-INF/jsf/users.xhtml".
Cannot invoke "org.eclipse.core.runtime.IPath.segment(int)" because "fullPath" is null

Is that because of wwd?

  • Eclipse IDE Version: 2021-12 (4.22.0)
  • Wild Web Developer version 0.10.12.202201271151

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mickaelistriacommented, Feb 7, 2022

Can I upgrade it manually to 0.20.2?

yes.

it was already included in eclipse (or wwd?).

Both 😉

0reactions
nimo23commented, Feb 7, 2022

Ok, the updated version removed the error. Thanks again.

Read more comments on GitHub >

github_iconTop Results From Across the Web

EMF » Class cast exception when saving to XML
All, I am getting an error when trying to save an EMF object graph. All my /EMF code was generated from a set...
Read more >
ClassCastException in org.eclipse.lsp4j.jsonrpc. ...
i am getting this ClassCastException in org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(NotificationMessage) Nov 21, ...
Read more >
Eclipse fails after installing JBoss Tools
Eclipse does not start anymore. Can anybody help me, to fix this problem? My setup: Eclipse Version: Neon 2; OS: Fedora 25; JBoss...
Read more >
[JBoss] Eclipse ClassCastException On Xhtml Files
I am using eclipse in project and it is freezing frequently. I found some error codes on error log panel.Workspace is new.I can't...
Read more >
Example usage for org.eclipse.jface.viewers TreeViewer ...
Prototype. @Override public ITreeSelection getStructuredSelection() throws ClassCastException ... From source file:org.eclipse.lsp4e.outline.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found