Attaching a remote debug to tanuki service wrapper application - java

I am attempting to configure an application for remote debugging. I am attempting to use the instructions under https://wrapper.tanukisoftware.com/doc/english/qna-eclipse-remote.html and have added the following lines to my wrapper.conf
wrapper.java.additional.16=-Xdebug
wrapper.java.additional.17=-Xrunjdwp:transport=dt_socket,address=8001,server=y,suspend=y
When I start my application using console console the application does not freeze with the following:
Listening for transport dt_socket at address: 8001
instead it carries on running and I cannot connect to it. Can anyone advise what settings I may be missing in order to allow the application to be remotely debugged.

One of the earlier configuration number was commented out
#wrapper.java.additional.13
This appears to mean that 14,15,16,17 were also ignored. I re-numbered these and can now debug.

Related

Play activator debug gets terminated on trying to remote debug from eclipse

I am new to play framework. I have an existing play application. I am supposed to understand it and make enhancements. So I am running the application on my windows 7 machine. It runs fine. On using debug(activator -jvm-debug), the jvm starts listening on default port 9999. Till this point everything is fine. When I start debugging it as a remote java application from my eclipse, the process listening on the port 9999 gets terminated. I have been monitoring the activity on Windows Resource Monitor. I have no clue where to check for the issue. Any help will be greatly appreciated
Thank you
The common things that you can check for a generic situation like
Message: “Failed to connect to remote VM. Connection Refused”
1) Have you setup the remote VM to accept connections?
java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=10000,suspend‌​=n yourServer
2) Is there a firewall in the way? Are you specifying the correct host / port?

java remote debug with jetty and IntelliJ

I have a SpringMvc based application project hosted in Jetty and managed by Maven3. I want debug program in remote server JVM. So, on the server side I set java options to the Jetty server.
-Xdebug -Xrunjdwp:transport=dt_socket,address=10.0.5.60:50019,server=y,suspend=n
Then start the jetty server.
jetty server listening on the debug port
Everything seems fine. Then I config a remote profile in IntelliJ
IntelliJ remote debug profile
And start Debug, console shows
Connected to the target VM, address: '10.0.5.60:50019', transport: 'socket'
Wow, seems good. Bug things always happens, The breakpoints can't stop when I visit the running code. That was strange!
I promise I have logs to show that the break-point code must been exec-ed.
So, any one can give a hint to me? Thanks for ur great help.

Debug code on one machine, run JBoss on another

Is it possible to setup JBoss server on one machine (PC) and then connect to it from another machine (laptop) ? I want to be able to run/deploy my application on the server on the PC and through Intellij on the laptop debug my code using that JBoss instance on the PC. I'm running a domain version of JBoss. Right now I have both the server and client running on the same machine. I'm not sure how to get around doing it, thanks for any help.
Yes it is possible to remote debug your application.
If you look at the first lines in the startup script standalone.[sh|bat], you'll see that debug agent can be enabled with the --debug command switch.
Switching this debug option will enable the JPDA and will listen on port 8787 by default.
This can also be achieved using JAVA_OPTS (look at the end of standalone.conf[.bat])
Once you started WildFly, you'll need to add a remote debug configuration in IntelliJ using the IP and port of your server. Here is the official documentation.
For remote deployment, you should have a look at the jboss-cli.
In Eclipse you can connect as follows, I'm sure Intellij must have something similar as well:
Run-> Debug Configuration->Remote Java Application. Here you can define the Host and Port of the application server, irrespective of it's location, be it local or any remote location.

debugging mpi java

How does one debug mpijava code. Ideally, I would want to debug it on the same machine with eclipse with a master and a client running and attached to the same eclipse. Though these might be two processes but since eclipse can debug multiple running threads, may be that is possible ?
Run server with options:
-Xdebug -Xrunjdwp:transport=dt_socket,address=8998,server=y
Then run eclipse and connect to 8998 port. See How To Debug a Remote Java Application for details.

Debug an external process?

I'm working with a certain external server product which happens to be proprietary. However, I do have the ability to modify the server's startup scripts. What I'd like to do is essentially set debugging breakpoints in the custom module code which I'm writing so as to be able to fix a bug I'm experiencing in my code.
Is there a way to do this, integrating Eclipse with debugging an external process?
If that certain external server product is a Java server, you should be able to debug your code running in it through standard Java remote debugging.
In Eclipse, open the Debug configurations and add a new configuraion of type "Remote Java Application", and enter the hostname of the server and the port the remote debugger listens to.
In the server startup script, you may need to add an additional Java option to enable remote debugging for the JVM and specify the port. Something like this (excerpt from the JBoss startup config file):
# Sample JPDA settings for remote socket debugging
JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
(address - 8787 in this case - is the port to connect to)

Categories

Resources