Tomcat : Unable to connect for remote debugging - eclipse

I am trying to debug server side code (running on Tomcat) using eclipse's remote debug option. This issues is showing up intermittently and rest of the times it works just fine. I have made sure
1) Server side has got the latest Jars - I copied the .war file and redeployed.
2) Tomcat is running on debug mode and firewall settings have been modified to allow connections on the debug port.
3) Verified that before the attempt to connect, on the server its listening on the debug port and afterwards it shows that connection has been established.
but Eclipse is throwing an error popup saying "Its unable to connect to the remote VM" and sometimes it times out waiting for a packet #
Should I be checking for some more things? Are there any more log files by eclipse that throws light on what went wrong? Please help

This is can be a solution sometimes if your debugger fails to connect to debugger with an error something like "timed out while waiting for a packet #packetnumber" then it could be because of the low timeout setting and slow network. One can increase the timeout value using debug setting in the eclipse preferences.

Related

Wildfly stops when running in debug mode in Eclipse

I installed Eclipse and the Jboss Tools plugin with Wildfly.
I can run Wildfly in Eclipse in non-debug mode with no problems. But when I start Wildfly in debug, I can use it for a few minutes, and then it suddenly stops processing, the server ends.
I checked the log and there's nothing. What could be wrong?
Please note the JBoss Tools 4.9.0 is validated against 2018-09 but not against 2018-12.
Do you see something in the server log when the server dies ?
We had this issue and it was because we changed our config to close the management port, which had been used to detect that the server had started. Eclipse could no longer detect that the server had started, so it shut down the process after a set time (450 seconds)
To resolve the issue, we did the following in the Eclipse's Overview panel for our JBoss Server:
Changed the Start Timeout to 30, so it would only fail if it actually couldn't start in 30 seconds rather than waiting for 450
Changed our "Server State Detectors" to detect a Web Port for Startup Poller and Process Terminated for Shutdown Poller.
Changed the Server Ports to match our new configuration
Excerpt from JBoss Community Archive
The tooling was unable to verify your server started. Our tooling has several methods to see if your server is up or not. The two most-often used methods are either "Web Port Poller" or "Management Poller".
You can see which your server is using by opening the server object (In Servers view, double-click your server) and on the right side you'll see a section on polling.
If your server adapter (fancy word for the tooling's representation of your server) is using the Management Port Poller, you should make sure your server is actually exposing the management port. For local servers this shouldn't be an issue, since local servers should automatically expose the management port. You may want to verify in the Ports section (also in the server editor) that the management port is correct. To check if the server is up, we run a management command against the server. If the server responds properly, we declare the server to be started.
If you're using the web port poller, then you may want to verify your web port is correct. To verify the server is up, the Web Port Poller opens a URL connection on {serverHost}:{webPort} and sees if we get a valid connection.

Remote Debugging Fails with IntelliJ but works with Eclipse?

I'm attempting to debug a program running in WebSphere Liberty Profile, so I run this on the server:
./server debug
This prints out
Listening for transport dt_socket at address: 7777
In IntelliJ IDEA, version 13.1.3, I try:
Run > Edit Configurations > + > Remote.
I pick Socket, Attach, fill in the hostname, and enter the port number of 7777, give it a name, and then OK.
Run > Debug > Pick the name I just gave it.
It opens a debugger tab and after ~30 seconds it displays the message
Error running (debugger configuration name):
Unable to open debugger port:
java.net.ConnectException "Connection timed out: connect"
(Line breaks added to make it easier to read).
I can then launch Eclipse, Kepler Service Release 2, and do
Run > Debug Configurations... > Remote Java Application > New > give it a name, pick Socket Attach, give it the host name and port number of 7777, click Apply, and Debug.
And it works just fine.
The fact that I can run Eclipse and have it work fine and IntelliJ and have it fail at the same time indicates to me that the problem isn't anywhere on my server and it's not an issue with my network connection.
It seems to me that the problem must lie somewhere in how I've set up IntelliJ. So my question is: what could I have done right with Eclipse that I'm getting wrong with IntelliJ?
The error message shows that IntelliJ IDEA can't establish a network connection to the debuggee process. One common reason for this problem is a local firewall rule that blocks network connections from IntelliJ IDEA.

JBoss 7.1 doesn't work after installation and configuration

JBoss doesn't start
and it shows the following error message after trying to connect:
Server JBoss 7.1 Runtime Server was unable to start within 450 second. if the server requires more time, try increasing the timeout in the server editor
When I increase the timeout, it shows the same error message. I tried to change the server and the host name to '172.0.0.1'
Can anyone help me get past this problem or even guide me to a keyword so I can search?

Debug points not working in eclipse for a remote application

I have a Java application running on a WebLogic server. I have kept breakpoints in the doPost() method of the servlet I want to invoke on that server.
When I invoke that servlet, it is not stopping at any of the debug points. The WebLogic port used by the application is 3304. When I give this port in the debug configuration it throws the following error:
Failed to connect to remote VM. Connection refused.
Connection refused: connect
If I give any other ports, e.g. 3305, 3303 it opens the debug view, but the application cannot be debugged.
The JVM will be running on debug port 3304 only. So other ports will not work. The error you get may be because, the debug connection to this port is already made by another machine or client, or an existing connection started by you was not terminated. You will get the exact stacktrace from eclipse, when you click on More details>.
Quick Try: Restart the JVM.(Sorry for this tip if its a production server)
Have you started the VM with these params, which exposes the correct port and starts the server in debug mode.
-Xdebug -Xrunjdwp:transport=dt_socket,address=<port number>

Debugging Play with Eclipse

I am trying to debug my Play application with Eclipse. First I launch it using Run As: Application.launch
That seems to work.
Then I try to connect the debugger using Debug As: Connect JPDA to Application.launch
and I get the error message:
"Failed to connect to remote VM. Connection refused.
Connection refused: connect"
Any idea how to make this work?
As stated in another answer, the error you are getting is exactly the same one that you get when you attempt to connect the debugger for a second time when it is actually already connected.
That being said, if it doesn't seem to explain your case, look for this line when you initially start the application via Run As --> Application.launch:
Listening for transport dt_socket at address: 8000
It tells you on which port it is listening for possible JPDA connections, and if this line is missing then something is wrong. You can modify the Application.launch configuration manually (look at the address part of -Xrunjdwp parameter passed to Java virtual machine) and change the port if necessary. If you make changes you also need to update the Connect JPDA to Application.launch run configuration.
Anyways, that is my suggestion - check that the application is indeed listening for possible debugger connections, and try changing the port that is being used for the purpose.
Check that your application mode is set to dev in your conf/application.conf:
application.mode=dev
Start your application and you should see the following:
Listening for transport dt_socket at address: 8000
Right click on the "Connect JPDA.." launcher and Debug As "Connect JPDA..."
I have recieved this error in the past when i have forgotten that the debugger was already connected. Perhaps it is being launched in another way? Also is it possible that debugging is disabled in the app.conf? Just a few things I would check on.
I always run from the command line and debug from Eclipse, might be worth a tray as well. Also try running in test mode if you aren't.
Shutdown everything and run it again. What happens is that when you execute the debug it does not show you anything and you might think nothing happens. You get this error because you might tried several times and you don't know it is already running.
Firstly you have to start play from console not run as. Then start debugger run as.