@Override
protected void run(Environment environment, Namespace namespace, T configuration) throws Exception {
Preconditions.checkArgument(!configuration.getHttpConfiguration().getRootPath().equals("/"), "Dropwizard must be running on a non-root path");
final HttpConfiguration nonSSLConfig = new HttpConfiguration();
nonSSLConfig.setPort(8080);
nonSSLConfig.setRootPath(configuration.getHttpConfiguration().getRootPath());
nonSSLConfig.setConnectorType(HttpConfiguration.ConnectorType.NONBLOCKING);
final DebugServer debug = new DebugServer(configuration, nonSSLConfig.getPort(), nonSSLConfig.getRootPath());
final int debugPort = debug.run();
final Server server = new ServerFactory(nonSSLConfig,
environment.getName()).buildServer(environment);
logBanner(environment.getName(), logger);
try {
server.start();
for (ServerLifecycleListener listener : environment.getServerListeners()) {
listener.serverStarted(server);
}
} catch (Exception e) {
logger.error("Unable to start server, shutting down", e);
server.stop();
debug.stop();
}
logger.info("====> Running in Hybrid Debug mode - port " + debugPort + " will proxy between GWT and DropWizard; port "
+ nonSSLConfig.getPort() + " will hit regular compiled app");
logger.info("Now start gwt in hosted mode using gwt:run or gwt:debug");
}