Running multiple tomcat instances in debug mode

Answered

Hi,

I have multiple services running in tomcat so I broke them in two groups:one tomcat instance consisting of stable services (artifacts) and one consisting of the one I'm working on.

If I ran any of them in debug mode alone, there was no problem. However when I tried to start the other one in debug mode, I got the below error.


I knew that when running in debug mode, Intellij used the debugging port specified at Edit Configuration > Startup/Connection > Debug > Port. My default port is 55154 so I tried to change it to a different port for the other tomcat instance. I have tried several port numbers from low to high but none worked.

Is there anything else I need to do to make it work?

 

Thanks!

0
4 comments

Did you modify ports in server.xml so that 2 Tomcat instances can be started and stopped at the same time?

0

These ports have to be different:

Also, the ports used to stop the server and connector in server.xml must be different for 2 instances:

<Server port="8005" shutdown="SHUTDOWN">

<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
1

Serge,

I don't need 2 instances to start and stop at the same time becauseI would like to keep the stable one running all the time, and I only need to redeploy the one I'm working when necessary.

Regarding your first screenshot about debugging ports, I did have different ports for 2 instances.

Regarding your second screenshot, I have just realized that I changed the HTTP port but forgot to change the JMX port. I updated it and tried again and BOOM!! ... it did the trick. Both of my instances are running properly now.

I didn't do any thing with the server.xml since I thought Intellij would take care of that for me.

I used the same tomcat for both of the instances. Per my understanding IntelliJ would clone it to [User folder]\.IntelliJIdea2017.1\system\tomcat\ . After seeing your comment, I checked the 2 server.xml in the above folder and saw that the shutdown ports were different. It means IntelliJ does take care of that automatically. 

Thanks!

0

Great, thanks for the information.

0

Please sign in to leave a comment.