Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
martinlippert opened this issue Mar 8, 2023 · 2 comments

Comments

@martinlippert
Copy link
Member

(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
@martinlippert
Copy link
Member Author

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

@BoykoAlex
Copy link
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)

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants