javaVSCode
javaVSCode copied to clipboard
JBoss EAP Standalone Remote Debugging
Hi everyone,
I'm trying to debug some custom application deployed in JBoss EAP. My setup for it is like so:
- standalone.conf enabled the following property:
JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n" - started jboss standalone on Terminal:
./standalone.sh --debug - Visual Studio Code's task.json has nothing special and works fine:
{ "version": "0.1.0", "command": "mvn", "isShellCommand": true, "showOutput": "always", "suppressTaskName": true, "tasks": [ { "taskName": "clean package", "args": [ "-Plocal-deploy", "clean", "package", "wildfly:deploy" ], "isBuildCommand": true } ] } - Visual Studio Code's launch.json I've tried this:
{ "name": "Debug JBoss", "type": "java", "request": "launch", "stopOnEntry": true, "cwd": "${fileDirname}", "startupClass": "${fileBasename}", //"jdkPath": "${env:JAVA_HOME}/bin", "jdkPath": "/usr/local/java/jdk1.8.0_102/bin", "options": [ "-classpath", "\"${fileDirname};.\"" ], "externalConsole": true, "debugServer": 8787 }
With remote server started in debug mode, the console shows this when I try to connect to it:
Debugger failed to attach: handshake failed - received >Content-Length< - expected >JDWP-Handshake<
Does anyone has the same problem? Thank you for the help by the way.
There might be a mistake with "debugServer": 8787, I think it should be "remotePort": 5005 instead.