I have Solr 5.1 and JDK 1.8 installed on my system right now. I want to debug the Solr server but when I try this command:
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=9000 -jar start.jar
I'm getting this error:
ERROR: JDWP Non-server transport dt_socket server=y suspend=y address=9000 must have a connection address specified through the 'address=' option
ERROR: JDWP invalid option: -agentlib:jdwp=transport=dt_socket server=y suspend=y address=9000
Any idea how to fix this issue?
Go to the eclipse menu and select Run->Debug Configuration; it opens Debug Configuration setup. On the Debug configuration window, create a new “Remote Java Application” configuration. Select the project to be debugged and give it a Name. Select connection type, Socket Attach, or Socket Listen.
Debugging Solr in IntellijHit the + button and select Remote . Give this configuration a name, and set the port number to the port number passed in the address command above (here it'd be 4044). Now start the debugging session, and viola! You should be able to set breakpoints and work in the Solr/Lucene codebase.
Starting the Application With Remote Debugging Enabled jar + start a server socket at port 8998 and publish the debugging messages using the Java Debug Wire Protocol (jdwp) there. Other than address, server, and transport, there are other sub-options available for -Xrunjdwp option — for example: suspend.
A Java program can be debugged simply by right clicking on the Java editor class file from Package explorer. Select Debug As → Java Application or use the shortcut Alt + Shift + D, J instead.
It shoould be something like this
java "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=9000" -jar start.jar
It's working now
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With