cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Eclipse debug issue : Failed to connect to remote VM. Connection refused. Connection refused

Velkumar
18-Opal

Eclipse debug issue : Failed to connect to remote VM. Connection refused. Connection refused

Hi 

 

I'm following this guide to develop a custom extension - ThingWorx Extension Development Guide (ptc.com)

 

When I try to debug an extension from Eclipse I'm getting the below error

 

Velkumar_0-1691154400377.png

 

I have added the below Java options in tomcat

-agentlib:jdwp=transport=dt_socket,address=*:8000,server=y,suspend=n

 

Tomcat Service :

[Unit]
Description=Tomcat 9 servlet container
After=network.target

[Service]
Type=forking

User=tomcat
Group=tomcat

Environment="JAVA_HOME=/usr/lib/jvm/jdk-11.0.11"
Environment="JAVA_OPTS=-agentlib:jdwp=transport=dt_socket,address=*:8000,server=y,suspend=n -Djava.security.egd=file:///dev/urandom -Djava.awt.headless=true"

Environment="CATALINA_BASE=/opt/tomcat/latest"
Environment="CATALINA_HOME=/opt/tomcat/latest"
Environment="CATALINA_PID=/opt/tomcat/latest/temp/tomcat.pid"
Environment="CATALINA_OPTS=-Dserver -Dd64 -XX:+UseG1GC -Dfile.encoding=UTF-8 -Djava.library.path=/opt/tomcat/latest/webapps/Thingworx/WEB-INF/extensions"

ExecStart=/opt/tomcat/latest/bin/startup.sh
ExecStop=/opt/tomcat/latest/bin/shutdown.sh

[Install]
WantedBy=multi-user.target

 

Could some one help me with this

 

Thanks in advance

 

/VR

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @VladimirRosu 

 

Thanks for your support. Port 8000 is open in Linux

Velkumar_0-1691470436533.png

 

It started to work after restarting the machine. I think we need to restart the machine once we make changes to the tomcat service.

 

/VR

View solution in original post

6 REPLIES 6

Article - ""Failed to connect to remote VM. Connection refused." error": https://www.ptc.com/fr/support/article/cs349804

Hi @VladimirN 

 

Thanks for sharing. Is this also applicable to Thingworx?

 

/VR

That article is not applicable for ThingWorx - @VladimirN fyi

 

@Velkumar the main reason you might encounter this is because that socket is not accessible from where you installed Eclipse.

To diagnose this, you should send a couple more details:

1. Is the ThingWorx server you're trying to connect to hosted on your local machine, or on a cloud server? If you're hosted on your local machine, make sure the firewall accepts incoming requests on 8000 (I don't know for sure if firewall applies or not to requests originating from your local machine, that's why this suggestion). If you're hosted on cloud, verify with your provider if it can accept TCP requests on that port (there are appliances that for example only forward HTTP requests, and can't do pure TCP; also, maybe because of security reasons, they might only allow as incoming ports the HTTP ones, at which stage you're really blocked.)

 

2. If you're localhost, can you check if the port is in waiting mode after you started ThingWorx? Meaning: are you really sure that those settings resulted in that port being opened? And check the port also before you start tomcat - maybe there's another program listening on it?

HI @VladimirRosu 

 

1. We have hosted this instance in Local VM based on Linux. And port 8000 is opened 

2. Could you help me how to check port status 

 

I tried the same method with a Windows-based Thingworx Instance. It works perfectly there 

 

/VR

Is that port open in the VM for incoming connections at the VM's firewall level? Often Linux distro firewalls disable any incoming connections.

For point 2: I know the windows command, which is "netstat -aon | find "8000"", but if you search on internet, you'll find the linux equivalent.

Note a port might be open in the VM, but the firewall might restrict incoming connections to it (as shared above)

Hi @VladimirRosu 

 

Thanks for your support. Port 8000 is open in Linux

Velkumar_0-1691470436533.png

 

It started to work after restarting the machine. I think we need to restart the machine once we make changes to the tomcat service.

 

/VR

Top Tags