Is it possible to enable a port in JSVC for remote debugging?

I am running a jsvc application that works absolutely fine, but now I need to enable one port in my application so that I can perform remote debugging. I am performing a task using java.

Is there a way to achieve the above objective? I checked all the JSVC parameters http://commons.apache.org/proper/commons-daemon/jsvc.html , but found nothing.

Here is the code to add the jsvc parameter:

private list getJSVCArgs () {list jsvcArgs = new ArrayList (); jsvcArgs.add (jsvcDir + "/ JSVC"); jsvcArgs.add ("- PidFile"); jsvcArgs.add ("pidfile.pid"); jsvcArgs.add ("- output_file"); jsvcArgs.add ("outfile.txt"); jsvcArgs.add ("- errfile"); jsvcArgs.add ("errfile.txt"); jsvcArgs.add ("- wait"); jsvcArgs.add (String.valueOf (jvmProperties.get ("- wait"))); jsvcArgs.add ("- user"); jsvcArgs.add (System.getProperty ("user.name")); jsvcArgs.add ("- home"); jsvcArgs.add (System.getProperty ("java.home")); return jsvcArgs; }

Now I need to pass this "-agentlib: jdwp = transport = dt_socket, address = 8001, server = y, suspend = n" to JSVC. Does anyone know how to achieve it?

+4
source share
1 answer

Like Wahid himself, you can add the necessary parameters to jsvc:

jsvcArgs.add("-agentlib:jdwp=transport=dt_socket,address=8001‌​,server=y,suspend=n")‌​; 
+1
source

Source: https://habr.com/ru/post/1492705/


All Articles