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

Debugging doesn't work #876

Open
Tracked by #1099
jtomaszewski opened this issue May 3, 2021 · 2 comments
Open
Tracked by #1099

Debugging doesn't work #876

jtomaszewski opened this issue May 3, 2021 · 2 comments
Assignees
Labels
bug Something isn't working debugging
Milestone

Comments

@jtomaszewski
Copy link

jtomaszewski commented May 3, 2021

Extension Name: vscode-gradle
Extension Version: 3.6.1
OS Version: os x newest
VSCode version: 1.55.2

Describe the bug

I managed to set up the task using gradle.javaDebug option:

image

image

I marked breakpoint in the test code:

image

Yet when running the task in debug mode, whole task is being run, but debugger doesn't really launch.

image

I enabled debug mode of gradle and here's the

Output from "Gradle Tasks"

[warn] [gradle-server] Adding modules:domain:cleanTest to ensure task output is cleared before debugging
[debug] Get daemon status
[error] Error running build: modules:domain:test: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-6.2-bin.zip'.
[error] Unable to start Java debugging: The task completed without the debugger being attached
[error] [gradle-server] Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-6.2-bin.zip'.
[debug] Get daemon status

However please note: I noticed that the "error"s appear only after the whole test task ends.

If I run the task manually using CLI (./gradlew :modules:domain:test --debug-jvm), then the gradlew is waiting for IDE to connect it:

image

Not sure however how this extension does it though.

Any ideas how can I fix it / debug this problem more closely?

To Reproduce

Can't provide, this is a private repo ;/

Expected behavior

Debugger should launch and stop on a breakpoint

Screenshots
If applicable, add screenshots to help explain your problem.

Does the bug still exist if you disable all other extensions?

Haven't tried. (From Java-related extensions, I only have the recommended Java ones; nothing else I think that would interfere with this one.)


P.S. I wanted to run that debug task with argument --tests="io.ailo.ledger.payment.service.AutoPayLiabilityServiceTest" but it doesn't work:

image
image

Should I create separate issue for that?

@jtomaszewski jtomaszewski added the bug Something isn't working label May 3, 2021
@jtomaszewski jtomaszewski changed the title Debugging doesn't work - output log shows "Error running build: test: Could not execute build using Gradle distribution" Debugging doesn't work May 3, 2021
@CsCherrYY CsCherrYY added this to the backlog milestone Aug 19, 2021
@CsCherrYY CsCherrYY mentioned this issue Nov 22, 2021
7 tasks
@Pfeil
Copy link

Pfeil commented Nov 26, 2021

Same issue here. Some details:

Extension Name: vscode-gradle
Extension Version: 3.8.4
OS Version: Mac OS X 10.15.7 x86_64 (Catalina)
VSCode version: 1.62.3

Configured gradle version (via gradlew): 7.3
Globally installed gradle version: none
Task to debug: bootRun

It's a spring boot application, not sure if this is relevant. Running it via the play button next to the task works fine, debugging has the same behaviour as described above:

> Executing task: gradle: bootRun <


> Configure project :
Using default profile for pit-service

> Task :generateMainEffectiveLombokConfig1

> Task :bootRun
Listening for transport dt_socket at address: 63469
<===========--> 85% EXECUTING [45s]
> :bootRun

@ozzy92
Copy link

ozzy92 commented May 12, 2023

I'm having this same problem, but I used to be able to just start a debug configuration to attach to the printed port (annoying, but possible.). Recently our project was upgrade to jdk 11, and now I don't get the port printed in the console. I just see this hanging forever

<========-----> 66% CONFIGURING [12s]
> :server

If I ctrl-c the process, it then prints out that it was waiting on a port

> Configure project :server
<=============> 100% CONFIGURING [1m 7s]
> IDLE
Picked up JAVA_TOOL_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=localhost:56062
Listening for transport dt_socket at address: 56062


FAILURE: Build failed with an exception.

* Where:
Build file '/<snip>/server/build.gradle' line: 2

* What went wrong:
<snip>

Does anyone know how to solve this? I can't see the port until I kill the process. Is there a way to set the port or having it print plain text somehow?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working debugging
Projects
None yet
Development

No branches or pull requests

5 participants