{
Server server = serverManager.getServer(configuration.getProfileName());
if (ServerController.isServerStarted(server))
{
throw new LifecycleException(
"The server is already running! " +
"Managed containers does not support connecting to running server instances due to the " +
"possible harmfull effect of connecting to the wrong server. Please stop server before running or " +
"change to another type of container.");
}
serverManager.startServer(server.getName());
createContext(server);
deploymentManager = createDeploymentManager(server);
}
catch (Exception e)
{
throw new LifecycleException("Could not connect to container", e);
}
}