1

In reference with one of the articles: Howto embed Tomcat 6?

I understood how to embed tomcat in a java application. Thanks for that. However I need to know if there is any elegant method provided by org.apache.catalina.startup.Embedded to check if the container is already started or not?

For example, if I create a batch file for the example given in the link above and click it twice; second time it would fail with JVM_BIND error; tomcat is running.

Please help.

Community
  • 1
  • 1
Yani
  • 43
  • 1
  • 1
  • 4

1 Answers1

-1

You could use the example code given on the Tomcat wiki

http://wiki.apache.org/tomcat/HowTo#How_do_I_check_whether_Tomcat_is_UP_or_DOWN.3F_There_is_no_status_command

Note: This doesnt use Embedded

It is trying to connect to the Tomcat ip:port and seeing if it responds.

JoseK
  • 31,141
  • 14
  • 104
  • 131