tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <>
Subject Re: How to start & stop embedding Tomcat correctly?
Date Fri, 01 Jul 2011 09:21:45 GMT
On 01/07/2011 10:07, Rehtron wrote:
> Dear all,
> I use org.apache.catalina.startup.Tomcat to do unit test,  but the instance
> of which cannot be started or stopped correctly.
> I start and stop embedding tomcat for each test case, but first test can be
> passed, the second one will be failed by 503 Service,  unavailable, the
> tomcat.start() method has been invoked, but the tomcat return 503 error.

Take a look at how Tomcat does this in it's own unit tests. Tomcat uses
a new port for each test to prevent this sort of problem.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message