Search code examples
tomcatintellij-ideatomcat8

Failing to run Tomcat in IntelliJ IDEA


I'm trying to use IntelliJ IDEA to run a Tomcat server but failing to so, I keep getting the following error code:

Application Server was not connected before run configuration stop, reason: java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.CommunicationException [Root exception is java.rmi.ConnectIOException: error during JRMP connection establishment; nested exception is: java.net.SocketException: Connection reset]

As seen in the following picture: https://i.sstatic.net/yqYav.png

Also, I manage to run a Tomcat server in CMD, but it just doesn't seem to work in IntelliJ. This is a pic of me running Tomcat in CMD succesfully and trying to connect to the same port in the IntelliJ (obviously failing to do so) but it does seem to be trying to connect, as in there is nothing really blocking the connection: https://i.sstatic.net/OYIvK.png

I tried every solution I could find:

  • specify the same port for both JMX and RMI conversation (here and here)
  • configure the Tomcat server again (here)
  • make the the path to the Tomcat files is correct (here)
  • made sure no Firewall/antivirus is blocking the network connection.
  • uninstall and install again both IntelliJ and Tomcat
  • specify the IP (here)
  • using different ports

Thanks!


Solution

  • The problem was solved.

    Running the Apache Tomcat Installer instead of just downloading the zip solved it.