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:
Take the output tab in the VS code and select Language Support for Java
Create an empty java file.
Trigger Jakarta snippet like rest_class or MicroProfile snippet like mpreadiness.
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)
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:
https://github.com/user-attachments/assets/e0578abf-3a08-4922-a8e3-fcf4bbce415a
The exception in the Language Support for Java is as follows: