| .. | .. |
|---|
| 118 | 118 | Properties props = new Properties();
|
|---|
| 119 | 119 | props.put("javax.persistence.jdbc.password", securisModule.getPassword());
|
|---|
| 120 | 120 | props.put("javax.persistence.jdbc.url", securisModule.getUrl(securisModule.getAppDir()));
|
|---|
| 121 | | - LOG.info("BD Url: {} {}", securisModule.getUrl(securisModule.getAppDir()), securisModule.getPassword());
|
|---|
| 121 | + //LOG.info("BD Url: {} {}", securisModule.getUrl(securisModule.getAppDir()), securisModule.getPassword());
|
|---|
| 122 | 122 | jpaPersistModule.properties(props);
|
|---|
| 123 | 123 |
|
|---|
| 124 | 124 | injector = Guice.createInjector(securisModule, new RequestsModule(), jpaPersistModule);
|
|---|
| .. | .. |
|---|
| 150 | 150 | QueuedThreadPool threadPool = new QueuedThreadPool();
|
|---|
| 151 | 151 | threadPool.setMaxThreads(50);
|
|---|
| 152 | 152 |
|
|---|
| 153 | | - server = new Server(Config.getInt(Config.KEYS.SERVER_PORT, 9080));
|
|---|
| 153 | + server = new Server();
|
|---|
| 154 | +
|
|---|
| 155 | + ServerConnector httpConnector = new ServerConnector(server);
|
|---|
| 156 | + httpConnector.setPort(Config.getInt(Config.KEYS.SERVER_PORT, 9080));
|
|---|
| 157 | + httpConnector.setHost(Config.get(Config.KEYS.SERVER_HOSTNAME, "0.0.0.0"));
|
|---|
| 158 | + server.addConnector(httpConnector);
|
|---|
| 159 | +
|
|---|
| 154 | 160 | ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
|
|---|
| 155 | 161 | context.setContextPath("/");
|
|---|
| 156 | 162 | context.addEventListener(injector.getInstance(GuiceResteasyBootstrapServletContextListener.class));
|
|---|
| .. | .. |
|---|
| 176 | 182 |
|
|---|
| 177 | 183 | ErrorPageErrorHandler errorHandler = new ErrorPageErrorHandler();
|
|---|
| 178 | 184 | context.setErrorHandler(errorHandler);
|
|---|
| 179 | | - LOG.info("Error Handlers: " + context.getErrorHandler());
|
|---|
| 180 | 185 | ContextHandlerCollection contexts = new ContextHandlerCollection();
|
|---|
| 181 | 186 |
|
|---|
| 182 | 187 | contexts.setHandlers(new Handler[] {
|
|---|
| .. | .. |
|---|
| 204 | 209 | // sslContextFactory.setTrustStorePassword("curist3c");
|
|---|
| 205 | 210 | sslContextFactory.checkKeyStore();
|
|---|
| 206 | 211 | sslContextFactory.setNeedClientAuth(false);
|
|---|
| 207 | | - LOG.info("Protocol: {}", sslContextFactory.getProtocol());
|
|---|
| 208 | 212 |
|
|---|
| 209 | 213 | ServerConnector sslConnector = new ServerConnector(server, new SslConnectionFactory(sslContextFactory,HttpVersion.HTTP_1_1.asString()), new HttpConnectionFactory(https_config));
|
|---|
| 210 | 214 | sslConnector.setPort(Config.getInt(Config.KEYS.SERVER_SSL_PORT, 9443));
|
|---|
| .. | .. |
|---|
| 217 | 221 | try {
|
|---|
| 218 | 222 | server.start();
|
|---|
| 219 | 223 | savePID();
|
|---|
| 224 | + CONSOLE.info("Server running in: {}", String.format("http://%s:%d", httpConnector.getHost(), httpConnector.getPort()));
|
|---|
| 220 | 225 | server.join();
|
|---|
| 221 | 226 | } catch (Exception e) {
|
|---|
| 222 | 227 | LOG.error("Error starting SeCurisServer", e);
|
|---|