Not able to debug a plugin. Need Help!

Hi,

I have uncommented the line from nuxeo.conf for debugging and restarted Nuxeo.

Added Eclipse remote debugging configuration (see the attached image)

but still I get the error : “Failed to connect to remote VM. Connection refused. Connection refused: connect”

Could someone please help in fixing this ?

FILES:   Eclipse.PNG
0 votes

2 answers

2525 views

ANSWER



Hi,

the line for activating remote debugging in nuxeo.conf ships with a configured port of 8787. Did you change it to match the port 5005 your screenshot shows?

## Sample JPDA settings for remote socket debugging
#JAVA_OPTS=$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n

Regards,

Ronan

1 votes



Yes I did that, earlier it was 8787 and that did not work so I tried other port number i.e. 5005 that also did not work.
07/25/2017

You could also give me some debugging tips to figure out the problem.
07/25/2017

This is standard Eclipse remote debugging, there is nothing specific to Nuxeo about it. Check that the port is opened by Java using a system tool like netstat. Check that it works with any other Java application besides Nuxeo.
07/25/2017

Yes, in nuxeo 9.1, I can easily able to debug source code with Eclipse Luna Release (4.4.0) on remote debugging mode.
07/26/2017

Florent Guillaume you are right it must be something wrong with my setup, yes I am able to debug other java projects. My question do I have to define the main class in Manifest file for the plugin ? I have my code here https://github.com/sherry-ummen/NuxeoLoginPlugin
07/27/2017

Santosh Yadav have you tried debugging a plugin ? if so then could you help ?
07/27/2017

just get source code from git, and import in eclipse. Then restart server in debugged mode by uncommenting following line in nuxeo.conf

JAVA_OPTS=$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n

08/10/2017


You may check if a process is actually listening on port 5005, and check which process, to be sure, the Nuxeo platform is actually listening on that port.

0 votes



I checked, there is a java.exe process listening to that port. I don know which java.exe as I really do not use java so I assume its Nuxeo.
07/25/2017

ohh hmm the state is actually ESTABLISHED when I do nestat -ano , it should be LISTENING ? And why is not LISTENING. I am not sure. Any help ?

And the LISTENING port is 9200 I dont know from where that has come

07/25/2017

You lost me, you say there is a java.exe process listening on that port (5005), and later on you say it is listening on 9200…? You could stop your Nuxeo instance, and check the port, to be sure you don't have a conflict there and/or a zombie process.
07/25/2017

Sorry for that.

So I did close all app and started nuxeo and then run this command C:\Users\sherry.ummen>netstat -ano | find "8787"

TCP 0.0.0.0:8787 0.0.0.0:0 LISTENING 87532

So its listening on 8787 but why 0.0.0.0?

Now I start Eclipse and set the host and port exactly and click debug (note: it did not give me any error nor started any debuger) as above and run the following command C:\Users\sherry.ummen>netstat -ano | find "8787"

TCP 10.0.75.1:8787 10.0.75.1:61593 ESTABLISHED 87532

TCP 10.0.75.1:61593 10.0.75.1:8787 ESTABLISHED 154168

What does it mean ? is my debugger now hooked or what is happening?

Now I try to click on debug in eclipse again then I get the old error "Failed to connect to remote VM. Connection refused.Connection refused: connect"

07/25/2017

0.0.0.0 means all interfaces. ESTABLISHED means that something (likely your Eclipse) has connected. Again this is nothing Nuxeo specific, please ask in a Java forum or an Eclipse forum.
07/25/2017