12

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

Yash
  • 11,486
  • 4
  • 19
  • 35
gaurav001
  • 167
  • 1
  • 1
  • 8

8 Answers8

16

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.

Abdollah
  • 4,579
  • 3
  • 29
  • 49
2

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

1

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:

Community
  • 1
  • 1
Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • Worklight 6.1.0.1 JS Full error: Error occurred during initialization of VM agent library failed to init: jdwp ERROR: Cannot load this JVM TI agent twice, check your java command line for duplicate jdwp options. I want to see the response coming from "invokeHttp", watch any variable value. I use WL.Logger for now. – gaurav001 Jun 04 '14 at 08:49
  • I am able to see the logs but to stop execution on breakpoints then debug and watch expression. For that I right click the adapter.xml and the Debug->Debug Configuration->Debug Button. I get the error on Debug Button click. – gaurav001 Jun 04 '14 at 10:04
  • You are confusing JavaScript and Java. If you're using JavaScript in your adapter code, then you can't debug it as if it were Java code and place breakpoints & debug it with tools meant for Java... You can do this for you **JavaScript** only on client-side code, not server – Idan Adar Jun 04 '14 at 10:06
  • Sorry for the confusion ... I have Worklight Adapter having "Adapter.xml", "Adapter-impl.js" And I want to debug the procedure in "Adapter-impl.js". So basically it is server side javascript that I want to debug. – gaurav001 Jun 04 '14 at 10:22
  • My answer then answers exactly that. See the second link in it. – Idan Adar Jun 04 '14 at 10:35
  • Followed the steps in the second link got the error added link. – gaurav001 Jun 05 '14 at 11:04
  • I don't understand what that means. Explain yourself. – Idan Adar Jun 05 '14 at 11:06
  • You should not change anh setup of your Eclipse other than what I wrote in the link. Start with a new Eclipse and follow ONLY those instructions – Idan Adar Jun 05 '14 at 11:42
  • @gaurav001 we cannot start server as debug when jvm.options file of the server already configured -agentlib:jdwp parameter for JVM debugging agent. We can 'Start' the server instead and change to create a 'Remote Java Application' of Debug category launching profile instead and let it attach to port 10777 of the server, or you can change prepend -D at head of -agentlib:jdwp parameter of jvm.options file and then we can 'Debug' a server directly. – Daniel Yang Oct 21 '14 at 04:03
1

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

rtgher
  • 149
  • 7
0

set JPDA_ENABLE=0 in your start script

Simas Joneliunas
  • 2,890
  • 20
  • 28
  • 35
Lytous Zhang
  • 61
  • 1
  • 1
0

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

-1

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

  • Answers on StackOverflow should be written in English and use descriptive text to describe what is being shown and give instructions. A sequence of screenshots, particularly when the UI is in a different language, is not a very useful answer. – William Price May 22 '22 at 20:44
-2

Try this instead: use run command to launch program

stayfool
  • 43
  • 4