@Override
public void run() {
if (container.getTomcat() != null && container.getTomcat().getServer().getState() != LifecycleState.DESTROYED) {
try {
if (!classpathAsWar) {
container.undeploy(warFile.getAbsolutePath());
}
container.stop();
} catch (final Exception e) {
getLog().error("can't stop TomEE", e);
}