Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Language support for Java throwing exception while triggering Jakarta or MicroProfile snippets in an empty file for both Java 17 and Java 21 #345

Open
gilbysunil14 opened this issue Oct 15, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@gilbysunil14
Copy link

Language support for java is throwing the following exception while triggering Jakarta or MicroProfile snippets in an empty java file. This is happening for java versions 17 and 21.

The exception can be seen by following the below steps:

  1. Take the output tab in the VS code and select Language Support for Java
  2. Create an empty java file.
  3. Trigger Jakarta snippet like rest_class or MicroProfile snippet like mpreadiness.
REC-20241015133906.mp4

The exception in the Language Support for Java is as follows:

Oct 15, 2024 1:39:52 PM org.eclipse.lsp4mp.jdt.internal.core.java.completion.JavaCompletionDefinition collectCompletionItems
SEVERE: Error while calling collectCompletionItems
java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.core.IJavaElement.getElementType()" because "element" is null
	at org.eclipse.lsp4mp.jdt.internal.faulttolerance.java.MicroProfileFaultToleranceCompletionParticipant.getFallbackAnnotation(MicroProfileFaultToleranceCompletionParticipant.java:102)
	at org.eclipse.lsp4mp.jdt.internal.faulttolerance.java.MicroProfileFaultToleranceCompletionParticipant.collectCompletionItems(MicroProfileFaultToleranceCompletionParticipant.java:72)
	at org.eclipse.lsp4mp.jdt.internal.core.java.completion.JavaCompletionDefinition.collectCompletionItems(JavaCompletionDefinition.java:59)
	at org.eclipse.lsp4mp.jdt.core.PropertiesManagerForJava.lambda$5(PropertiesManagerForJava.java:239)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at org.eclipse.lsp4mp.jdt.core.PropertiesManagerForJava.completion(PropertiesManagerForJava.java:237)
	at org.eclipse.lsp4mp.jdt.internal.core.ls.MicroProfileDelegateCommandHandlerForJava.getCompletionForJava(MicroProfileDelegateCommandHandlerForJava.java:293)
	at org.eclipse.lsp4mp.jdt.internal.core.ls.MicroProfileDelegateCommandHandlerForJava.executeCommand(MicroProfileDelegateCommandHandlerForJava.java:92)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler$1.run(WorkspaceExecuteCommandHandler.java:230)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:47)
	at org.eclipse.jdt.ls.core.internal.handlers.WorkspaceExecuteCommandHandler.executeCommand(WorkspaceExecuteCommandHandler.java:220)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$4(JDTLanguageServer.java:606)
	at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87)
	at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
	at java.base/java.util.concurrent.CompletableFuture$Completion.exec(CompletableFuture.java:483)
	at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:387)
	at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1312)
	at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1843)
	at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1808)
	at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:188)
@gilbysunil14 gilbysunil14 added the bug Something isn't working label Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

1 participant