Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remote Debugging Java - Solr

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?

like image 213
donthurtme Avatar asked Jun 15 '15 05:06

donthurtme


People also ask

How do I remotely debug a Java program?

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.

How do I debug SOLR?

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.

How do I remote debug a jar file?

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.

How do you debug a Java app?

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.


1 Answers

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

like image 192
donthurtme Avatar answered Oct 21 '22 01:10

donthurtme