weirongxu / coc-kotlin

Intelligent Kotlin support for coc.nvim
MIT License
58 stars 1 forks source link

Launching server "kotlin" Failed #14

Open shanur00 opened 2 weeks ago

shanur00 commented 2 weeks ago

Result from CocInfo

## versions

vim version: NVIM v0.10.2
node version: v22.9.0
coc.nvim version: 0.0.82-'9fd8578 2024-09-21 00:59:00 +0900'
coc.nvim directory: C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim
term: undefined
platform: win32

## Log of coc.nvim

2024-11-04T06:22:11.765 INFO (pid:16656) [extension:coc-tabnine] - Using tabnine from C:\Users\SHAHNUR\AppData\Local\coc\extensions\coc-tabnine-data\binaries\4.202.0\x86_64-pc-windows-gnu\TabNine.exe
2024-11-04T06:22:12.282 INFO (pid:16656) [plugin] - coc.nvim initialized with node: v22.9.0 after 1110
2024-11-04T06:22:12.284 INFO (pid:16656) [services] - LanguageClient Json language server state change: stopped => starting
2024-11-04T06:22:12.335 INFO (pid:16656) [language-client-index] - Language server "json" started with 14684
2024-11-04T06:22:12.362 INFO (pid:16656) [attach] - receive notification: highlight []
2024-11-04T06:22:12.692 INFO (pid:16656) [services] - LanguageClient Json language server state change: starting => running
2024-11-04T06:22:12.711 INFO (pid:16656) [services] - service json started
2024-11-04T06:22:13.379 ERROR (pid:16656) [server] - unhandledRejection  Promise {
  <rejected> Error: spawn EINVAL
      at ChildProcess.spawn (node:internal/child_process:420:11)
      at Object.spawn (node:child_process:761:9)
      at C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim\build\index.js:123553:47
      at async LanguageClient.createConnection (C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim\build\index.js:122923:28)
      at async LanguageClient._start (C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim\build\index.js:122554:30) {
    errno: -4071,
    code: 'EINVAL',
    syscall: 'spawn'
  },
  dispose: [Function (anonymous)]
} Error: spawn EINVAL
    at ChildProcess.spawn (node:internal/child_process:420:11)
    at Object.spawn (node:child_process:761:9)
    at C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim\build\index.js:123553:47
    at async LanguageClient.createConnection (C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim\build\index.js:122923:28)
    at async LanguageClient._start (C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim\build\index.js:122554:30) {
  errno: -4071,
  code: 'EINVAL',
  syscall: 'spawn'
}
2024-11-04T06:22:18.571 INFO (pid:16656) [attach] - receive notification: runCommand [ 'workspace.showOutput' ]
2024-11-04T06:22:20.668 INFO (pid:16656) [attach] - receive notification: highlight []
2024-11-04T06:22:24.631 INFO (pid:16656) [attach] - receive notification: highlight []
2024-11-04T06:22:25.820 INFO (pid:16656) [attach] - receive notification: highlight []
2024-11-04T06:22:27.832 INFO (pid:16656) [attach] - receive notification: highlight []
2024-11-04T06:22:28.293 INFO (pid:16656) [attach] - receive notification: highlight []
2024-11-04T06:22:30.467 INFO (pid:16656) [attach] - receive notification: highlight []
2024-11-04T06:22:40.103 INFO (pid:16656) [attach] - receive notification: highlight []
2024-11-04T06:22:40.939 INFO (pid:16656) [attach] - receive notification: highlight []
2024-11-04T06:22:41.256 INFO (pid:16656) [attach] - receive notification: highlight []
2024-11-04T06:22:42.286 INFO (pid:16656) [attach] - receive notification: highlight []
2024-11-04T06:22:42.746 INFO (pid:16656) [attach] - receive notification: highlight []
2024-11-04T06:22:45.094 INFO (pid:16656) [attach] - receive notification: highlight []
2024-11-04T06:22:45.948 INFO (pid:16656) [attach] - receive notification: highlight []
2024-11-04T06:23:39.589 INFO (pid:16656) [attach] - receive notification: highlight []
2024-11-04T06:23:42.692 INFO (pid:16656) [attach] - receive notification: showInfo []

Workspace showOutput

[11/4/2024, 6:19:16 AM 593] [debug]: Looking for Java in PATH
[11/4/2024, 6:19:16 AM 598] [info]: Activating Kotlin Language Server...
[11/4/2024, 6:19:16 AM 599] [info]: Connecting via Stdio.
[11/4/2024, 6:19:16 AM 600] [info]: Creating client at C:\Users\SHAHNUR\AppData\Local\coc\extensions\coc-kotlin-data\langServerInstall\server\bin\kotlin-language-server
[11/4/2024, 6:19:16 AM 610] [error]: Error: Error: Launching server "kotlin" using command C:\Users\SHAHNUR\AppData\Local\coc\extensions\coc-kotlin-data\langServerInstall\server\bin\kotlin-language-server failed.
    at error (C:\Users\SHAHNUR\AppData\Local\coc\extensions\node_modules\coc-kotlin\lib\extension.js:1:38312)
    at async t.activate (C:\Users\SHAHNUR\AppData\Local\coc\extensions\node_modules\coc-kotlin\lib\extension.js:1:68256)
    at async C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim\build\index.js:127355:27

Extension version

Which version of the extension you are running.

Additional context

More information or screenshots.

weirongxu commented 2 weeks ago

There may be a network error when downloading the language server, try deleting the files in C:\Users\SHAHNUR\AppData\Local\coc\extensions\coc-kotlin-data\ and try again.

shanur00 commented 2 weeks ago

Still encounter same problem. Whe I run .bat file

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Content-Length: 127

{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"main      Kotlin Language Server: Version 1.3.12"}}Content-Length: 108

{"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"main      Connected to client"}}

and got this

And also got this in languageserver.kotlin

[Error - 4:47:12 PM] Connection to server kotlin is erroring, write EPIPE. Shutting down server.
Error: write EPIPE
    at afterWriteDispatched (node:internal/stream_base_commons:159:15)
    at writeGeneric (node:internal/stream_base_commons:150:3)
    at Socket._writeGeneric (node:net:958:11)
    at Socket._write (node:net:970:8)
    at writeOrBuffer (node:internal/streams/writable:572:12)
    at _write (node:internal/streams/writable:501:10)
    at Writable.write (node:internal/streams/writable:510:10)
    at C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim\build\index.js:69886:25
    at new Promise (<anonymous>)
    at WritableStreamWrapper.write (C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim\build\index.js:69875:16)
[Error - 4:47:12 PM] Stopping server failed
Error: Client is not running and can't be stopped. It's current state is: 1
    at LanguageClient.shutdown (C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim\build\index.js:122826:17)
    at LanguageClient.stop (C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim\build\index.js:122815:21)
    at LanguageClient.stop (C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim\build\index.js:123378:22)
    at LanguageClient.handleConnectionError (C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim\build\index.js:122974:16)
    at errorHandler (C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim\build\index.js:122918:16)
    at C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim\build\index.js:121991:5
    at CallbackList.invoke (C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim\build\index.js:67712:35)
    at _Emitter.fire (C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim\build\index.js:67771:34)
    at writeErrorHandler (C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim\build\index.js:68770:22)
    at CallbackList.invoke (C:\Users\SHAHNUR\AppData\Local\nvim\plugged\coc.nvim\build\index.js:67712:35)
[Error - 4:47:12 PM] Server initialization failed.
  Message: write EPIPE
  Code: -32099 
[Error - 4:47:12 PM] kotlin client: couldn't create connection to server.
  Message: write EPIPE
  Code: -32099 
[Info  - 4:47:12 PM] Connection to server got closed. Server will restart.
Error: Invalid or corrupt jarfile C:\Users\SHAHNUR\AppData\Local\coc\extensions\coc-kotlin-data\langServerInstall\server\bin\kotlin-language-server
[Error - 4:47:12 PM] java exited with code: 1
Error: Invalid or corrupt jarfile C:\Users\SHAHNUR\AppData\Local\coc\extensions\coc-kotlin-data\langServerInstall\server\bin\kotlin-language-server
[Error - 4:47:13 PM] java exited with code: 1
[Info  - 4:47:13 PM] Connection to server got closed. Server will restart.
[Error - 4:47:13 PM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 4:47:13 PM] kotlin client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
Error: Invalid or corrupt jarfile C:\Users\SHAHNUR\AppData\Local\coc\extensions\coc-kotlin-data\langServerInstall\server\bin\kotlin-language-server
[Info  - 4:47:13 PM] Connection to server got closed. Server will restart.
[Error - 4:47:13 PM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 4:47:13 PM] kotlin client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 4:47:13 PM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 4:47:13 PM] java exited with code: 1
Error: Invalid or corrupt jarfile C:\Users\SHAHNUR\AppData\Local\coc\extensions\coc-kotlin-data\langServerInstall\server\bin\kotlin-language-server
[Error - 4:47:13 PM] Connection to server got closed. Server will not be restarted.
[Error - 4:47:13 PM] Server initialization failed.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 4:47:13 PM] kotlin client: couldn't create connection to server.
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 4:47:13 PM] Restarting server failed
  Message: Pending response rejected since connection got disposed
  Code: -32097 
[Error - 4:47:13 PM] java exited with code: 1
weirongxu commented 2 weeks ago

I simply tested on Windows, and the issue is reproduced in both Neovim and Vscode. It may be a kotlin-language-server issue, or it may be an Open-JDK version incompatible. It takes some time to test and figure out the problem.

weirongxu commented 2 weeks ago

I'll keep testing to see if the current version of kotlin-language-server works on Windows.