Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 19850

Win 10, Git Bash, gradlew, multiple debug-jvm, specify different ports

$
0
0

Hi,

I have opened five git bash cli windows.

I am in my gradle project, which contains a multitude of build.gradle files for the different subprojects, e.g.:

my-user@my-laptop MINGW64 ~/my-projects/some-project/some-folder (develop)
$ find ./ -name build.gradle
./build.gradle
./folder-a/service-a/build.gradle
./folder-a/service-b/build.gradle
./folder-a/service-c/build.gradle
./service-d/build.gradle
./service-e/build.gradle

I want to start all services with the debug-jvm option enabled, because I want to step through the execution with a remote debugger.

So I begin by starting the first service:

my-user@my-laptop MINGW64 ~/my-projects/some-project/some-folder (develop)
$ ./gradlew -b ./folder-a/service-a/build.gradle bootRun --debug-jvm

This works and my application is started, but starting the second service like so does not work and fails:

my-user@my-laptop MINGW64 ~/my-projects/some-project/some-folder (develop)
$ ./gradlew -b ./folder-a/service-b/build.gradle bootRun --debug-jvm

> Task :service-b:bootRun FAILED
ERROR: transport error 202: bind failed: Address already in use
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugInit.c:750]

Of course I investigated the problem and tried specifying another JDWP port, but it does not give me any status output about the bootRun at all and just prints that its listening on the new port I specified, thus I conclude that the application is not started at all:

my-user@my-laptop MINGW64 ~/my-projects/some-project/some-folder (develop)
$ GRADLE_OPTS="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=6543" ./gradlew -b cloud/service-b/build.gradle bootRun --debug-jvm
Listening for transport dt_socket at address: 6543

I also tried passing in the specific port in a different fashion like this, but it fails with the error that it does not know the arg parameter:

my-user@my-laptop MINGW64 ~/my-projects/some-project/some-folder (develop)
$ ./gradlew -b cloud/service-b/build.gradle bootRun --jvm-args="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=6543"

Problem configuring task :service-b:bootRun from command line.
> Unknown command-line option '--jvm-args'.

Then I tried switching --jvm-args to --jvmArgs, but that lead to the same error.

I am kind of stuck now and would like to ask the Gradle community for help.


Viewing all articles
Browse latest Browse all 19850

Trending Articles