5

I am using IntelliJ 2017.3 with Payara 4.1.2.172. I used to just start the server from the command line had a Remote Debug running on port 9009, and everything used to work fine. enter image description here

Then I set up an plugged in server with attached modules in IntelliJ, to enable HotSwap. I run this server in debug mode, and it works fine.

Now, if I don't use the plugged in server, but want to start the server as previous, when I run the debug remote, I get the following:

Error

Error running 'Debug Glassfish OSM': Unable to open debugger port (localhost:9009): java.net.ConnectException "Connection refused: connect"

I have run a netstat and there's nothing running on port 9009.

Question

How do I get the remote debug working on the server?

More info

The domail.xml has:

<system-property name="JAVA_DEBUGGER_PORT" value="9009"></system-property>

And in the server-config JVM Settings:

enter image description here

More info

I set the above 'Enable' checkbox to on, but now I get the following error when I try start the server, i.e. the server won't start now. (netstat shows noting running on port 9009)

ERROR: transport error 202: connect failed: Connection refused ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510) JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugInit.c:750]

If I set it to off in the damain.cml, I still get the error and am unable to start the server.

<java-config classpath-suffix="" debug-options="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=${JAVA_DEBUGGER_PORT}" debug-enabled="true" system-classpath="">
Richard
  • 8,193
  • 28
  • 107
  • 228
  • This has no relation to IntelliJ IDEA since the port of the externally started server is not accepting the connections. – CrazyCoder Jul 06 '18 at 09:45
  • *Debug* checkbox is disabled in your server settings according to the provided screenshot, therefore the server is not listening for the debugger on port 9009. – CrazyCoder Jul 06 '18 at 09:52
  • @CrazyCoder - thanks, the reason I mention IntelliJ, is because I only started getting this error after I enabled HotSwap in IntelliJ. Now I get the error even if I don't use the HotSwap config. – Richard Jul 06 '18 at 09:52
  • @CrazyCoder - thanks I will enable it, and try. – Richard Jul 06 '18 at 10:07
  • 1
    It seems something is blocking the 9009 port. Try setting the debug port to something else, e.g. 9019 in both Payara Server and IntelliJ settings. – OndroMih Jul 10 '18 at 07:31

3 Answers3

3
  1. In glassfish\domains\domain1\config\domain.xml :

<java-config classpath-suffix="" debug-options="-agentlib:jdwp=transport=dt_socket,address=9009,server=y,suspend=n" java-home="C:\Program Files\Java\jdk1.8.0_162" debug-enabled="true" system-classpath="">

or in http://localhost:4848/common/index.jsf Glassfish 4 debug-enabled="true" address=9009,server=y,suspend=n 2. In current Idea - Server Run Configuration - Debug - Port - address Server Run Configuration - Debug - Port - address

RoutesMaps.com
  • 1,628
  • 1
  • 14
  • 19
0

I had the same problem and this solution also did the trick for me: Provide the IP 127.0.0.1 in the Intellij Debug configuration instead of the host name "localhost", in case you're using this hostname.

enter image description here

Ikbel
  • 1,817
  • 1
  • 17
  • 30
0

I have simple solution on that but its not permanent fix on this issue. You can invalidate and restart your IntelliJ Idea and try again to debug your codebase.