Repository navigation
Open
Labels
Description
I'm running into an issue / potential bug where my compound launch configuration tries to run multiple services with the same java debug port. This seems to be a non-deterministic issue and the launch configurations that succeed vary.
Here's a version of my launch config:
"version": "0.2.0",
"configurations": [
{
"type": "java",
"name": "AxonServer",
"request": "launch",
"mainClass": "org.springframework.boot.loader.PropertiesLauncher",
"classPaths": [
"${workspaceFolder}/build/AxonServer/axonserver.jar"
],
"console": "internalConsole",
"cwd": "${workspaceFolder}/build/AxonServer",
},
{
"type": "java",
"name": "EurekaServer",
"request": "launch",
"mainClass": "com.company.project.framework.eureka.server.EurekaServerApplication",
"projectName": "com.company.project.framework-eureka-server",
"console": "internalConsole",
},
{
"type": "java",
"name": "Config Service",
"request": "launch",
"mainClass": "com.company.project.config.service.ConfigApplication",
"projectName": "com.company.project-config-service",
"console": "internalConsole",
},
{
"type": "java",
"name": "Framework Service",
"request": "launch",
"mainClass": "com.company.project.framework.FrameworkApplication",
"projectName": "com.company.project-framework",
"console": "internalConsole",
},
{
"type": "java",
"name": "Command Service",
"request": "launch",
"mainClass": "com.company.project.framework.commandservice.CommandApplication",
"projectName": "com.company.project.framework-command-service",
"console": "internalConsole",
},
{
"type": "java",
"name": "Query Service",
"request": "launch",
"mainClass": "com.company.project.framework.queryservice.QueryApplication",
"projectName": "com.company.project.framework-query-service",
"console": "internalConsole",
},
{
"type": "java",
"name": "Generation Service",
"request": "launch",
"projectName": "com.company.project.generation-generation",
"mainClass": "org.springframework.boot.loader.launch.JarLauncher",
"classPaths": [
"${workspaceFolder}/build/generation.jar"
],
"console": "internalConsole",
"cwd": "${workspaceFolder}\\build",
},
],
"compounds": [
{
"name": "Start Microservices",
"configurations": [
"AxonServer",
"EurekaServer",
"Config Service",
"Framework Service",
"Command Service",
"Query Service",
"Generation Service",
],
"stopAll": true,
},
]
I get this error for several services on most launch attempts:
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 45559; nested exception is:
java.net.BindException: Address already in use: bind
jdk.internal.agent.AgentConfigurationError: java.rmi.server.ExportException: Port already in use: 45559; nested exception is:
java.net.BindException: Address already in use: bind
at jdk.management.agent/sun.management.jmxremote.ConnectorBootstrap.startRemoteConnectorServer(ConnectorBootstrap.java:491)
ConnectorBootstrap.java:491
at jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:447)
Agent.java:447
at jdk.management.agent/jdk.internal.agent.Agent.startAgent(Agent.java:603)
Agent.java:603
... (trimmed)
Caused by: java.net.BindException: Address already in use: bindWhen I check that port, one of my other configurations is indeed using that port. This is not a port used by the applications themselves, but presumably the java debug server port. When I stop my applications, those ports are no longer in use. I can also run the non-compound launch configs individually without issue, this is specifically a compound launch config issue.
Reacted by Terrance
Activity
SunBK201 commentedon Dec 28, 2024
I also encountered the same problem, the compounds configuration caused port conflicts.
SunBK201 commentedon Dec 28, 2024
I found a workaround, and we can customize different jmx ports to each different configuration to bypass conflicts:
github-actions commentedon Nov 10, 2025
Hi Sylphrena Kleinsasser (@sylphrena0), I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.
Suggestions & Workarounds
Serialize your launches by adding a small delay before each config. Define a shell task in
tasks.json:{ "label": "delay-500ms", "type": "shell", "command": "sleep 0.5" }Then add to each launch config:
This forces each debug server to bind its port in sequence and avoids clashes.
Run services individually instead of via a compound. That way each debug session picks its own port without race conditions.
File an issue against the Java debug extension (vscode-java-debug) to request deterministic port assignment or configuration options:
https://github.com/microsoft/vscode-java-debug/issues
No direct solution is documented yet for compound launches starting multiple Java debug servers in parallel.
Other references with low confidence
ERROR: JDWP Transport dt_socket failed… – default debug ports (1044/1045) can collide. You may need to free them or choose other ports. ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) when debugging vscode-extension project redhat-developer/vscode-java#3336 (comment)
Cannot Run Java Program… Address already in use – describes killing processes on ports 1044/1045 before launch. Cannot Run Java Program in VSCode Extension Development Host on Debug Mode #1216 (comment)
The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!
Terrance commentedon Feb 13, 2026
This workaround mostly works for me, though I've found sometimes a debug session restart fails with the port in use error again, perhaps because the old port isn't released quick enough? Without the fixed port it seems ok, I assume because it does pick a new random port in that case.
Looking at Copilot's suggestions:
This doesn't scale for microservice-like projects: I needed to space mine out by a second each in order to avoid the conflicts, which leads to some rather lengthy waits towards the end. Baking these delays into the individual services also means starting a single one is subjected to an unnecessary delay.
The same port binding problems happen if you start individual services in quick succession.
That's where we are...
Three months later and this doesn't seem to have happened?