vscode-gradle icon indicating copy to clipboard operation
vscode-gradle copied to clipboard

can not connect to gradle server

Open liuzqt opened this issue 4 years ago • 5 comments

not able to connect to gradle server, restart didn't help.

The log I found in gradle task OUTPUT:

[info] [gradle-server] Server started, listening on 55456
[error] Error connecting to gradle server: Failed to connect before the deadline
[error] The client has state: SHUTDOWN
[info] Gradle client connected to server

Let me know if I can do anything to help investigate the issue.

java version:

openjdk version "11.0.11" 2021-04-20
OpenJDK Runtime Environment GraalVM CE 21.1.0 (build 11.0.11+8-jvmci-21.1-b05)
OpenJDK 64-Bit Server VM GraalVM CE 21.1.0 (build 11.0.11+8-jvmci-21.1-b05, mixed mode, sharing)

OS: macOS 10.15.6

vscode version:

Version: 1.60.2
Commit: 7f6ab5485bbc008386c4386d08766667e155244e
Date: 2021-09-22T11:59:27.195Z (2 days ago)
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Darwin x64 19.6.0

liuzqt avatar Sep 24 '21 17:09 liuzqt

Which way are you using to import your project, Gradle wrapper, specific Gradle version or local Gradle distribution?

CsCherrYY avatar Sep 27 '21 06:09 CsCherrYY

How should I specify the way that vscode import Gradle project? My project has a Gradle wrapper of version 7.0.2, and I also used the wrapper to run Gradle tasks. I guess vscode was using that Gradle wrapper as well

liuzqt avatar Sep 27 '21 17:09 liuzqt

You can check the setting java.import.gradle.wrapper.enabled, you're using Gradle wrapper when it's enabled. If so, could you check if you can correctly execute via Gradle CLI (./gradlew)? BTW, I noticed the following info in your messages:

[info] Gradle client connected to server

It shows when the client connected to the server successfully. In this case, does the Gradle Projects view still show nothing?

CsCherrYY avatar Sep 28 '21 01:09 CsCherrYY

@CsCherrYY java.import.gradle.wrapper.enabled is true, so vscode should be using the gradle wrapper in my project dir.

Regarding the log, sorry I noticed that it's finally connected...... but the failure connection window pop up every time I start(or restart or reload) vscode...... The initial log is

[info] [gradle-server] Server started, listening on 55456(some random port actually)
[error] Error connecting to gradle server: Failed to connect before the deadline
[error] The client has state: SHUTDOWN

and the error window popup, after I click retry, it will finally connect and I should be able to see things under Gradle Projects

liuzqt avatar Sep 29 '21 23:09 liuzqt