Skip to content
Snippets Groups Projects
Commit 99b17d07 authored by Felix Sidokhine's avatar Felix Sidokhine
Browse files

oddly missing commons in server

parent ca738e13
No related branches found
No related tags found
No related merge requests found
......@@ -51,6 +51,7 @@ public class CRLWorker extends X509Worker<RevocationRequest> {
public CRLWorker(PrivateKey privateKey, X509Certificate certificate) {
super(privateKey, certificate);
if(privateKey == null || certificate == null) return;
this.setDaemon(true);
this.start();
//TODO: The CRL needs to be loaded from memory
......
......@@ -38,6 +38,12 @@
<version>${revision}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.jami</groupId>
<artifactId>jams-common</artifactId>
<version>${revision}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.jami</groupId>
<artifactId>jami-nameserver</artifactId>
......
......@@ -54,10 +54,6 @@ public class Server {
public final static AtomicBoolean isInstalled = new AtomicBoolean(false);
public final static AtomicBoolean activated = new AtomicBoolean(false);
static {
JsoniterRegistry.initCodecs();
}
public static DataStore dataStore;
//This one gets loaded via JAR, to make it more flexible.
public static CertificateAuthority certificateAuthority;
......@@ -69,7 +65,7 @@ public class Server {
public Server(AppUpdater appUpdater, String port, String serverCertificate, String serverPrivateKey) {
Server.appUpdater = appUpdater;
JsoniterRegistry.initCodecs();
String[] args = {port, serverCertificate, serverPrivateKey};
if ((args.length > 0)) main(args);
......
......@@ -51,9 +51,7 @@ import static net.jami.jams.server.Server.certificateAuthority;
@Slf4j
public class TomcatLauncher {
private final Tomcat tomcat = new Tomcat();
private Connector connector;
private StandardContext context;
private Tomcat tomcat = new Tomcat();
public TomcatLauncher(int port) {
tomcat.getService().addConnector(TomcatConnectorFactory.getNoSSLConnector(port));
......@@ -72,7 +70,7 @@ public class TomcatLauncher {
log.info("Found a valid trust store, injecting into tomcat!");
tomcat.getService().addConnector(TomcatConnectorFactory.getSSLConnectorWithTrustStore(certificateFile, keyFile, port));
} else {
connector = TomcatConnectorFactory.getSSLConnectorWithoutTrustStore(certificateFile, keyFile, port);
Connector connector = TomcatConnectorFactory.getSSLConnectorWithoutTrustStore(certificateFile, keyFile, port);
tomcat.getService().addConnector(connector);
}
this.startServer();
......@@ -81,7 +79,7 @@ public class TomcatLauncher {
public void startServer() {
String jarName = System.getProperty("user.dir") + File.separator + "jams-server.jar";
log.info("JAR Resource File = " + jarName);
context = (StandardContext) tomcat.addWebapp("", new File(System.getProperty("user.dir")).getAbsolutePath());
StandardContext context = (StandardContext) tomcat.addWebapp("", new File(System.getProperty("user.dir")).getAbsolutePath());
context.getJarScanner().setJarScanFilter((jarScanType, s) -> false);
log.info("Serving application from: " + new File(System.getProperty("user.dir")).getAbsolutePath());
......@@ -126,6 +124,7 @@ public class TomcatLauncher {
certificateAuthority.shutdownThreads();
tomcat.stop();
tomcat.destroy();
tomcat = null;
}
} catch (Exception e) {
log.info("Failed to stop tomcat server with error {}", e.getMessage());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment