Unable to run Tomcat because of JMX

Answered

When I Run project I got:

"Application Server was not connected before run configuration stop, reason:
Unable to ping server at localhost:1099"

1099 is my JMX port. When I manually use JConsole to connect localhost:1099, then it works. I use Ubuntu 16.04, Tomcat 8, JDK 1.8.

How can I fix this?

Best regards.

2
18 comments

Try adding -Djavaee.jmxremote.authenticate=false in Help | Edit Custom VM Options and restart IntelliJ IDEA. The issue should be resolved in one of the next updates.

https://www.jetbrains.com/idea/nextversion/ should work out of the box.

0
Avatar
Permanently deleted user

It still doesn't work.

0
Avatar
Permanently deleted user

Hi 

When i start the server it will show below error 

Application Server was not connected before run configuration stop, reason: Unable to ping server at localhost:1099

 

could you please assist on that

below are the screenshot for ref

0

Do you have any proxy/firewall/antivirus?

0

Please try with the new Tomcat installation that has unmodified configuration. If it doesn't help, share the logs (Help | Compress Logs and Show in ...) and the screenshots of the run/debug configuration used for Tomcat (all the tabs including Startup/Connection). You can upload the files here: https://uploads.services.jetbrains.com/.

0
Avatar
Permanently deleted user

I had similar issue on Ubuntu 16.04 + Tomcat 7 + JDK 1.8.

I also had error "unable to resolve host localhost.localdomain" when i try to start/stop Tomcat.

I edited my server hosts file (/etc/hosts). I were missing the domain. For example:

I had line like:
127.0.0.1 localhost

I changed it to:

127.0.0.1 localhost.localdomain localhost

After that changes i can run project in the Intellij.

I found this solution here: https://askubuntu.com/a/455570

0
Avatar
Permanently deleted user

I've been getting this a lot lately on Windows 10.  I change the port and it still happens.  I check for a app running on that port and there is nothing.  I really wish the app could just try again on a different port until it works.

1
Avatar
Permanently deleted user

Just started happening to me on Windows 10 this week. So far haven't figured it out.

1
Avatar
Permanently deleted user

I've resolved the issue I was seeing. Apparently Intellij doesn't like either the use of a startup.bat in general or the specific JAVA_OPTS I was using in that file which was:

set "JAVA_OPTS=-Djavax.net.debug=all"
 
I reviewed the idea.log and there is no indication of this being a problem in there. The symptoms were Intellij hanging during startup, simply stopping once the Tomcat manager was started and not deploying the war. Hitting stop on Tomcat resulted in the seemingly unrelated error code (see below). It's unfortunate that there's not a better indication of what is really happening. Hopefully this note prevents someone else from losing half a day or more.
applications server was not connected before run configuration stop, reason unable to ping server at localhost:1099
0

This JAVA_OPTS overrides what IntelliJ IDEA is passing to Tomcat, hence the problem.

0
Avatar
Permanently deleted user

Think I resolved it, I had to remove the Umbrella Roaming Client app the company keeps installing on my machine and it started to work again.  Now today, it continues to work and the company re-installed the app, so odd.

0

I encountered this in the last week. I like to run Tomcat with CATALINA_BASE set up, even locally, so that I can track updates to Tomcat without a lot reconfiguration.

I landed here after some Google-fu. Serge Baranov hints at the problem, especially true when leveraging `CATALINA_BASE` with environments bootstrapped through `setenv.(sh|bat)`, but doesn't elaborate. 

IntelliJ, when set up to leverage `CATALINA_BASE`, copies this directory to the application caches, i.e., on the Mac  `~/Library/Caches/JetBrains/IntelliJIdea2021.1/tomcat/983be14b-1fd1-495c-ac2b-f39d5edd52d0` 

I added the following to my `setenv.sh` to address the problem, the specifics taken from the Tomcat Monitoring and Management documentation.

CATALINA_OPTS="$CATALINA_OPTS \
  -Dapp.env=dev \
  -Djava.rmi.server.hostname=localhost \
  -Dcom.sun.management.jmxremote.host=localhost"
export CATALINA_OPTS="$CATALINA_OPTS -DFOO=BAR"

Hope this helps someone.

Update (4/18/2022):

I've updated the instructions.

Formerly, the script included arguments to bind to 1099. This was based on the documentation, and not invalid, but attachs the CATALINA_BASE process to the port. When using IntelliJ to restart, or otherwise perform actions with Tomcat, you may first get a Bind error, and then a second attempt works. 

Since IntelliJ requires the port number in the Tomcat configuration, I've removed those specific instructions for the port binding. This corrects the "double stop/redeploy" issue.

My setup (4/18/2022):

Tomcat 9.0.58
Java 17
IntelliJ IDEA 2022.1 (Ultimate Edition)
Build #IU-221.5080.210, built on April 11, 2022
Runtime version: 11.0.14.1+1-b2043.25 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 12.3.1

1

Thanks Tim Stone, you're great

0

I have the same problem for the last two months. I solved the problem by excluding the folder containing my project and the gragent.jar file that is used to run the debugger from the Windows virus scanner.

Hope this can help.

0

The here at the beginning of this post described issue still exists even with IntelliJ build
 
IntelliJ IDEA 2025.2.3 (Ultimate Edition)
Build #IU-252.26830.84, built on October 2, 2025

No matter which jmx port is configured via the tomcat plugin in IntelliJ
or if it's configured via JavaOpts params or whatever I always get the same error message. The server is actually
started in the background and IntelliJ disconnects from the server. It's annyoing.

Here the error message (with any other port it would be the same, and the port is not engaged,
no firewall is running, via shell the server can be started also with same jmx configurations):

Error message:

“Application Server was not connected before run configuration stop, reason: Unable to ping server at localhost:5003”

IntelliJ console output:

[2025-10-17 06:29:01,194] Artifact update:war: Waiting for server connection to start artifact deployment…
Tomcat started.
Disconnected from server

0

Oliver Nilsson Please submit a ticket at https://intellij-support.jetbrains.com/hc/requests/new with the logs via Help | Collect Logs and Diagnostic Data and with the full output from the IDE Run console for the server. Specify the server version and what modifications to the server configs were made.

0

Please sign in to leave a comment.