Tomcat Remote Debug - How to configure JNDI port

Hi,

I would like to configure remote debuging for my web application deployed on Tomcat, but I have to specify JNDI port. My application does not use JNDI and AFAIK you cannot expose Tomcat JNDI server. Unfortunatly I cannot leave it blank, becouse JNDI port is required on Tomcat Remote Debug Configuration Dialog.

What should I do to set the JNDI port?

Thanks in advance for help!

3 comments
Comment actions Permalink

Hello

To start Tomcat with JNDI/JMX interface enabled, you should pass the following VM parameters to it on startup:
-Dcom.sun.management.jmxremote=

-Dcom.sun.management.jmxremote.port=<port number>
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false

I.e. you should include these parameters to JAVA_OPTS environment variable.
Than, you should specify <port number> in the Tomcat remote run configuration as the value of the 'JNDI port' field.
Please note, that JNDI port is needed by the remote run configuration to deploy artifacts to the remote Tomcat instance.



So if you will deploy your artifacts not from IDEA but from outside -- have deployments list of the remote run configuration empty -- then 'JNDI port' field is not required and even will be hidden.

Yet you still should be able to debug your artifacts sources from IDEA in this case.


Regards,
Michael
0
Comment actions Permalink

Thank you for the response, but unfortunately I still cannot connect to the remote server.
 
I can connect to it using JConsole, so it means JMX is configured correctly. but IntelliJ still says that
 
"Unable to connect to the some.server:some_port"

BTW: Why IntelliJ does not use Tomcat Manager to redeploy application?
 
Best regards,
Krzysztof Rajda

0
Comment actions Permalink

Hello,

JConsole could be used to connect to the Tomcat instance in several ways.
To verify if JMX was enabled on the server you should choose 'Remote process' (even if your Tomcat instance is running locally) and enter
'service:jmx:rmi:///jndi/rmi://localhost:<port number>/jmxrmi' as the address to connect (replace 'localhost' with your host address/name if it is remote).

Is this the way you have tested JMX connection with JConsole?

Do you have your Tomcat instance running locally or remotely?

Could it be possible that your firewall is blocking access to the JMX port?

As for Tomcat Manager -- it is Tomcat-specific way, while JMX is more generic and is supported by most of the application servers --
that's why it was chosen as the IDEA's way to manage Tomcat instances.


Regards,
Michael
0

Please sign in to leave a comment.