Tomcat starts twice

When Tomcat starts up, the log file shows the server status.  We can understand how Tomcat works.  Due to different configuration, Tomcat may starts twice and runs two instances.

Why is that?

Let’s take a look at server.xml

<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
  <Context docBase="webabc" path="" reloadable="true" source="org.eclipse.jst.jee.server:webabc"/></Host>
</Host>

The parameter specifies the generic application base under webapps directory. All web applications under that directory will be started by Tomcat.

Further, the parameter specifies an instance for webabc again. It will be called and started again.

That is why Tomcat has two instances.

To solve it, change the “appBase” in <Host> and “docBase” in <Context>.

<Host appBase="" autoDeploy="true" name="localhost" unpackWARs="true">
  <Context docBase="webapps/webabc" path="" reloadable="true" source="org.eclipse.jst.jee.server:webabc"/></Host>
</Host>

Start Tomcat, it will only starts one instance.

oliver

Leave a Reply

Your email address will not be published. Required fields are marked *

ERROR: si-captcha.php plugin says GD image support not detected in PHP!

Contact your web host and ask them why GD image support is not enabled for PHP.

ERROR: si-captcha.php plugin says imagepng function not detected in PHP!

Contact your web host and ask them why imagepng function is not enabled for PHP.