redhat-developer / vscode-java

Java Language Support for Visual Studio Code
Eclipse Public License 2.0
2.08k stars 442 forks source link

After switching to standard mode, language server exits #1563

Open ewen-r opened 4 years ago

ewen-r commented 4 years ago

[provide a description of the issue] Starting the server in lightweight mode, then switching to standard mode causes the server to exit after a few minutes.

Environment
Steps To Reproduce
  1. Project is opened with language server in lightweight mode. Server seems to be working fine, messages are being sent and responses are being received OK.

  2. Switch language server to standard mode Server seems to start, only to exit after a few minutes. [Trace - 5:08:38 AM] Sending request 'shutdown - (4)'. [Trace - 5:08:38 AM] Received response 'shutdown - (4)' in 50ms. Result: {}

[Trace - 5:08:38 AM] Sending notification 'exit'. No parameters provided.

[Please attach a sample project reproducing the error] Sorry, unable to do so due to company restrictions.

[Please attach [logs]] -1596705089486.log

Additional Informations
testforstephen commented 4 years ago

Could you share the language server log file? See the command below to get the log.

F1 -> Open Java language server log file

ewen-r commented 4 years ago

log.log Here you go.. thanks

jdneo commented 4 years ago

Looks like something wrong when initialize the workspace:

!ENTRY org.eclipse.core.jobs 4 2 2020-08-06 04:52:27.290
!MESSAGE An internal error occurred during: "Initialize workspace".
!STACK 0
java.lang.NullPointerException
    at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer$2.run(JDTLanguageServer.java:297)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

!ENTRY org.eclipse.jdt.ls.core 1 0 2020-08-06 04:53:02.014
!MESSAGE Parent process stopped running, forcing server exit
ewen-r commented 4 years ago

May not be purely related to switching modes but I also see this trace error in the output. Filenames and paths redacted..

[Error - 3:19:01 AM] Sep 22, 2020, 3:19:01 AM Problem getting outline for XXXXXXXXXXXXXXXXXXX.java _/XXXXXXXXXXXXXXXXXXX [in workroot9591bc80] is not on its project's build path Java Model Exception: Java Model Status [/XXXXXXXXXXXXXXXXXXX/snmp [in workroot_9591bc80] is not on its project's build path] at org.eclipse.jdt.internal.core.JavaElement.newJavaModelException(JavaElement.java:583) at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:256) at org.eclipse.jdt.internal.core.Openable.openAncestors(Openable.java:530) at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:250) at org.eclipse.jdt.internal.core.Openable.openAncestors(Openable.java:530) at org.eclipse.jdt.internal.core.CompilationUnit.openAncestors(CompilationUnit.java:1239) at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:250) at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:596) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:326) at org.eclipse.jdt.internal.core.JavaElement.getElementInfo(JavaElement.java:312) at org.eclipse.jdt.internal.core.JavaElement.getChildren(JavaElement.java:267) at org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.getHierarchicalOutline(DocumentSymbolHandler.java:133) at org.eclipse.jdt.ls.core.internal.handlers.DocumentSymbolHandler.documentSymbol(DocumentSymbolHandler.java:78) at org.eclipse.jdt.ls.core.internal.syntaxserver.SyntaxLanguageServer.lambda$2(SyntaxLanguageServer.java:278) at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:75) at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:642) at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:478) at java.base/java.lang.Thread.run(Thread.java:830)