Tomcat Remote Debug - How to configure JNDI port


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!

Comment actions Permalink


To start Tomcat with JNDI/JMX interface enabled, you should pass the following VM parameters to it on startup:<port number>

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.

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

Comment actions Permalink


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.


Please sign in to leave a comment.