I wrote a simple http service using ballerina to send a post request and generate OpenAPI specification. I wanted to debug my code using java debug.
Operating System: Windows 11 Pro.
After setting up environment variable, and running the OpenAPI command I got the following error.
e.g:
$env:BAL_JAVA_DEBUG = '5005'bal openapi -i \main.bal
ERROR: JDWP unable to get necessary JVMTI capabilities.
I fixed this issue by replacing the JAVA_OPTS value in bal.bat file locally into the value given for Command line arguments for remote JVM in the IntelliJ IDEA. Then it worked fine.
replaced this:
set JAVA_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%BAL_JAVA_DEBUG%
with this:
set JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005
Description
I wrote a simple http service using ballerina to send a post request and generate OpenAPI specification. I wanted to debug my code using java debug.
Operating System: Windows 11 Pro.
After setting up environment variable, and running the OpenAPI command I got the following error. e.g:
$env:BAL_JAVA_DEBUG = '5005'
bal openapi -i \main.bal
ERROR: JDWP unable to get necessary JVMTI capabilities.
I fixed this issue by replacing the
JAVA_OPTS
value inbal.bat
file locally into the value given for Command line arguments for remote JVM in the IntelliJ IDEA. Then it worked fine.replaced this:
set JAVA_OPTS=-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=%BAL_JAVA_DEBUG%
with this:
set JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005