Skip to content

invalid thread access when invoking content-assist for spring data query methods #990

Closed

Description

@martinlippert

(using the latest STS 4.18.0 CI build on top of Eclipse 2023-03 builds)

I am experimenting with the new content-assist for Spring Data repository query methods and hit this:

org.eclipse.core.commands.ExecutionException: While executing the action, an exception occurred
	at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:126)
	at org.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:97)
	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.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.execute(HandlerServiceHandler.java:156)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:488)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:485)
	at org.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:213)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:389)
	at org.eclipse.ui.internal.handlers.LegacyHandlerService.executeCommand(LegacyHandlerService.java:366)
	at org.springframework.tooling.ls.eclipse.commons.commands.InvokeContentAssistCommandHandler.lambda$0(InvokeContentAssistCommandHandler.java:34)
	at org.eclipse.core.runtime.jobs.Job$2.run(Job.java:187)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: org.eclipse.swt.SWTException: Invalid thread access
	at org.eclipse.swt.SWT.error(SWT.java:4918)
	at org.eclipse.swt.SWT.error(SWT.java:4833)
	at org.eclipse.swt.SWT.error(SWT.java:4804)
	at org.eclipse.swt.widgets.Display.error(Display.java:1209)
	at org.eclipse.swt.widgets.Display.checkDevice(Display.java:708)
	at org.eclipse.swt.widgets.Display.getSystemCursor(Display.java:2097)
	at org.eclipse.swt.custom.BusyIndicator.setBusyCursor(BusyIndicator.java:198)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:64)
	at org.eclipse.ui.texteditor.ContentAssistAction.run(ContentAssistAction.java:84)
	at org.eclipse.ui.texteditor.RetargetTextEditorAction.run(RetargetTextEditorAction.java:232)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:474)
	at org.eclipse.jface.commands.ActionHandler.execute(ActionHandler.java:123)
	... 18 more

Activity

  1. added this to the 4.18.0.RELEASE milestone on Mar 8, 2023
  2. martinlippert commented on Mar 8, 2023

    @martinlippert
    MemberAuthor

    This seems to happen when I type (for example): findBy, invoke content-assist, and select FirstName from the list of proposals.

  3. BoykoAlex commented on Mar 8, 2023

    @BoykoAlex
    Contributor

    I suppose this issue has to do with eclipse API backward compatibility. The fact that the compiler error in the build was that the call to UIJob.create(...) returned instance of Job rather than UIJob explains the odd stack trace.
    Now I explicitly create a UIJob using the constructor thus I expect the exception described above to be gone.
    I wasn't able to reproduce this exception by the way...
    (Fixed with 709cb4d)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions