Tomcat remote debugging

Answered

I know that there are tons of posts about this topic, but none of them seem to help me.

So what I am trying to do is enable the tomcat remote debugging tool in intelliJ 2017.2.3 Ultimate edition. I am running intelliJ on a windows machine and tomcat 8 on an ubuntu machine on the same network.

I've mapped the tomcat webapp folder to an smb share for deployment, which seems to work fine.

However I can't seem to get the debugging or JMX working... at least not both at the same time.

 

currently my setenv.sh file looks like this:

export CATALINA_OPTS="-agentlib:jdwp=transport=dt_socket,address=1043,server=y,suspend=n"
export JAVA_OPTS="-Dcom.sun.management.jmxremote=0.0.0.0 -Dcom.sun.management.jmxremote.port=1044 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false"

 

and if i run "netstat -lp | grep <tomcat-pid>":

tcp 0 0 *:1043 *:* LISTEN 4363/java
tcp6 0 0 [::]:8009 [::]:* LISTEN 4363/java
tcp6 0 0 [::]:http [::]:* LISTEN 4363/java
tcp6 0 0 [::]:1044 [::]:* LISTEN 4363/java
tcp6 0 0 [::]:47381 [::]:* LISTEN 4363/java
tcp6 0 0 [::]:https [::]:* LISTEN 4363/java
tcp6 0 0 [::]:56544 [::]:* LISTEN 4363/java
tcp6 0 0 localhost:8005 [::]:* LISTEN 4363/java

 

but when I try to deploy with intelliJ i get the following error:

Error running 'run on remote'
Unable to connect to the 192.168.1.181:1044, reason:
java.rmi.ConnectException: Connection refused to host: 127.0.1.1; nested exception is:
java.net.ConnectException: Connection refused: connect

 

I've tried changing the address in the setenv.sh file to 127.0.0.1, 127.0.1.1 and 192.168.1.181, but nothing seems to work.

So does anyone know what it is that I am doing wrong?

0
1 comment

Are you sure port 1044 is open on the remote machine firewall? Can you telnet to it from your Windows machine?

0

Please sign in to leave a comment.