gaurav001
gaurav001

Reputation: 167

ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options

I am using Eclipse plugin "IBM Worklight Developer Edition".

I am trying to debug the adapter procedure code. For that I tried to do some debug configurations but it said Server already running(debug button disabled). So I stopped the server then again tried debug configuration, this time the button was enabled but on console I got "ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options."

Please help me to do debug configuration.

enter image description here

Upvotes: 12

Views: 36977

Answers (9)

Aleksei Nefedov
Aleksei Nefedov

Reputation: 1

I've got the same error message you've got, it's because of the Java Debug Wire Protocol (JDWP) agent is being loaded more than once, which is not allowed. This usually happens when the JVM is started with multiple -agentlib:jdwp or -Xrunjdwp options.

set JPDA_OPTS=-agentlib:jdwp=transport=%JPDA_TRANSPORT%,address=%JPDA_ADDRESS%,server=y,suspend=%JPDA_SUSPEND%

In my case I'm migrating to Tomcat 10 and copied the script file from the old environment.

To resolve this issue, you'll need to ensure that the jdwp options are specified only once in your Tomcat server's startup configuration (catalina script file).

Upvotes: 0

Federico Pellegatta
Federico Pellegatta

Reputation: 174

I ran into the same problem using IBM WebSphere Server 8.5 integrated into Intellij IDEA Ultimate v2022.1.3. I solved it by going to change the server settings from the WAS console. In fact, by default the server enables debugging service at server startup. To solve it, just check the relevant item.

Go to: Server > WebSphere Application Server > yourServer

Under the configuration tab, click on 'Debug service', and remove the check from 'Enable service at server startup' as shown in the following image. Uncheck 'Enable Service at server startup'

Make sure to save your changes

Upvotes: 0

Luis Alfonso Ponce
Luis Alfonso Ponce

Reputation: 39

Disable the service during server startup

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Upvotes: -1

Ravindu Kottahachchi
Ravindu Kottahachchi

Reputation: 91

I had following errors in my Intellij Idea when debugging enter image description here

I Was able to fix it by unchecking the below mentioned "Pass environment variables" option in debug configuration "Startup/Connection" tab

enter image description here

Upvotes: 2

Lytous Zhang
Lytous Zhang

Reputation: 61

set JPDA_ENABLE=0 in your start script

Upvotes: 0

Abdollah
Abdollah

Reputation: 5177

You must start the server using the "Run" button instead of "Debug". You have set jdwp option in launch configurations and hit "Debug", while hitting "Debug" sets another jdwp option, so you get that error.

Upvotes: 18

rtgher
rtgher

Reputation: 169

this is pretty straightforward. you have the same argument twice somewhere in your vm arguments. Try referring to this post: ERROR: Cannot load this JVM TI agent twice starting Oracle WebLogic Server 12.1.3.0

Upvotes: 1

stayfool
stayfool

Reputation: 43

Try this instead: use run command to launch program

Upvotes: -2

Idan Adar
Idan Adar

Reputation: 44516

It would great if you could edit your question and supply more information...

  • Worklight version
  • Java or JS?
  • The full error exception and trace
  • What is the problem you are trying to debug?

If you are trying to debug Java in your adapters, you can follow the instructions in this video:

If you are trying to debug JavaScript in your adapters, you can review the answer in this question:

Upvotes: 1

Related Questions