开发者

Cannot run project from IntelliJ IDEA because of jdwp error

开发者 https://www.devze.com 2023-03-06 04:51 出处:网络
I have a project in IntelliJ IDEA I want to run locally. When I click its debug button it says: ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.

I have a project in IntelliJ IDEA I want to run locally. When I click its debug button it says:

ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options.
Disconnected from server
Error occurred durin开发者_如何转开发g initialization of VM
agent library failed to init: jdwp

When I click the run button it works. What is the matter?


This is probably too late to help you, but maybe it will help somebody else. The answer is based on a support forum posting by Aleksei Sosnovski.

This can happen when your JAVA_OPTS contains two -Xrunjdwp arguments. E.g., one of these arguments might come from the server start script invoked by IntelliJ to start the container, and another may be added by IntelliJ itself. You can check by looking at JAVA_OPTS in the log when launching the container without debug. If you see an -Xrunjdwp argument, just find where it is set in the container startup script, and remove it.


I guess you already are debugging the server app? In this case it's not possible to connect another instance of debugger.


Most likely the problem happens because you have specified the debugging options in the "VM parameters" field of your run configuration. Everything will work if you remove them.


I had the same problem in my case -Xrunjdwp was set twice: one in the IDEA debug configuration and again in the system variables in CATAALINA_OPTS.

once I removed it from system variables (inside the IDEA it is read only) problem was fixed


Thanks for the tips, it helped me work out the problem too. Mine was due to having set DEBUG_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005

In my catalina.bat


  1. check server.xml if you have jvmEntries get rid of that entry from server.xml

    <!-- <jvmEntries xmi:id="JavaVirtualMachine_1" classpath="" bootClasspath="" verboseModeClass="false" verboseModeGarbageCollection="false" verboseModeJNI="false" runHProf="false" hprofArguments="" debugMode="false" debugArgs="-Djava.compiler=NONE -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=7777" genericJvmArguments="">
    

  2. Open admin console (http://localhost:9060/ibm/console/login.do)

    Application servers > server1 > Debugging service

    un-check Enable service at server startup if checked restart server.

Cannot run project from IntelliJ IDEA because of jdwp error


On Intellij uncheck the 'Pass environment variables' box in Run/Debug configuration

Cannot run project from IntelliJ IDEA because of jdwp error

0

精彩评论

暂无评论...
验证码 换一张
取 消