I've been attempting to set up a remote debug configuration in IntelliJ.
The application itself is deployed via tomcat7 plug on the command line and works as expected.
Now I would like to debug this application and am unsure how to connect a remote debugger in this case.
I have edited tomcat startup.bat
set JDPA_ADDRESS=8080 set JDPA_TRANSPORT=dt_socket
and set up a remote config in IntelliJ
When the debugger configuration gets run, "handshake failed" error appears.
Port 8080 is usually a HTTP port used by Tomcat, your debugger port must be different.
Related
According to home page of gradle tomcat plugin FAQ section:
How do I remote debug my Tomcat started up by the plugin?
I need to add the following environment property:
GRADLE_OPTS = -Xdebug Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
During run of container I should see information that it listens on particular port: Listening for transport dt_socket at address: 5005, but in my case it's not working.
How I can configure it properly ? I'm running intellij idea 14.1 Ultimate.
In my case it worked as I started the Tomcat in the IDE itself and not the CLI.
For that I created two run/debug configurations, one for Tomcat and one to Remote connect the debugger to the Tomcat process.
For the Remote configuration, use the port 5005 like mentioned in the plugin FAQ debug section.
For the Tomcat configuration, you have to set the JVM settings explicitly. Simply put -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 as a value into the JVM options textfield in the Gradle run/debug config.
After both configurations have been created and properly configured, first run the Tomcat process and then connect to it by debugging the Remote configuration.
You can find an entire spring-mvc example and an detailed solution here.
I have Tomcat 7 running in my local machine. I deployed a War file and it works fine.
I am trying to debug this application from eclipse.
I set the following in startup.bat file:
set JPDA_ADDRESS=8000
set JPDA_TRANSPORT=dt_socket
When I run the startup.bat file from command line, it opens another window and starts tomcat. In the first line I see that debugger is getting started on the port 8000 (something like dt_xxx port 8000). So I can confirm the debugger is started.
I configured Eclipse Remote debugging in the debug configuration and attached source for the war file deployed (selected the project). Gave the port and servername (localhost:8000).
Set a breakpoint in the Servlet which is called from the browser. When I open the URL, I don't see anything happening in eclipse (I expected it to hit the breakpoint).
What could be wrong?
I know you can debug by just clicking the debug icon in Eclipse. Is it possible to start WebLogic from the command line with debugging and still debug? When I do that, in Eclipse under server I see that the status is "Started", not "Debugging". Can this only be done by setting up remote debugging?
You need to add parameters to the JAVA_OPTIONS in the startWebLogic.cmd (or startWebLogic.sh):
-Xrunjdwp:transport=dt_socket,server=y,address=1044,suspend=n -Xdebug
Then, in Eclipse you have to use remote debugging indeed.
Add a new Remote Java Application in the Debug Configurations (via the menu: Run - Debug Configurations).
Make sure the correct project is selected (Browse button) and fill in localhost in Host and 1044 in Port. The other options you can leave unchanged.
If you click debug you should be able to see your remote WebLogic running in the Debug perspective.
If you see a WebLogic started under Servers, you are looking at an embedded server and not at the one you started via the command line. Make sure to stop any embedded server before starting via the command line as they will not be able to run on the same port together anyway.
How can I configure remote debugging in Eclipse with JBOSS server 4.x version?
So far,
Step1: I have modified the run.confg file. By uncommenting the below line. Sample JPDA settings for remote socket debugging:
JAVA_OPTS="$JAVA_OPTS -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
Step2 : Then I configured Eclipse in debug configurations. It's saying:
Failed to connect to remote VM. Connection refused.
What you are asking is not specific to either Java EE or JBoss 4.x - you can debug any Java process in case you specified the remote debugging runtime parameters when starting the JVM.
In your setting the -Xdebug parameter is missing, so your line would be:
JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n"
Now it should be able to connect, in case you are using the correct host and your specified port 8787. In case it's still not working, it's most likely a firewall issue blocking the port.
I configured the debug configurations for remote debugging my maven project. I set the host as localhost and the port as 7000. I even ran the following command as the launch was not working:
java -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=7000,suspend=n
However it is still not launching the remote VM and I cannot proceed with my debugging.
It gives the same error as:
Failed to connect to remote VM.Connection refused.
How should I proceed with solving this problem ?
you can issue the follwoing command from command prompt. mvnDebug jetty:run-exploded antrun:run Then you wil come to know on which port your jetty is listening to after that go to run->debug configuration from there you can debug your server.
In debug configuration you can find the option Remote Java Application here create one new debug configuration for new Remote java Application and also here you can define your new server
again mvnDebug jetty:run-exploded now you should see your new port.