Fixed setting spring config path.
Change-Id: Ib741d68cc9dc4cc09fbda8337a880740f7a9b778
diff --git a/core/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java b/core/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
index b072f3c..d113e6e 100644
--- a/core/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
+++ b/core/src/main/java/de/ids_mannheim/korap/server/KustvaktBaseServer.java
@@ -35,6 +35,7 @@
public abstract class KustvaktBaseServer {
protected static KustvaktConfiguration config;
+ protected static String springConfig = "default-config.xml";
protected static String rootPackages;
protected static KustvaktArgs kargs;
@@ -100,13 +101,14 @@
ServletContextHandler contextHandler =
new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
contextHandler.setContextPath("/");
+
if (kargs.getSpringConfig()!=null) {
contextHandler.setInitParameter("contextConfigLocation",
"file:" + kargs.getSpringConfig());
}
else {
contextHandler.setInitParameter("contextConfigLocation",
- "classpath:" + kargs.getSpringConfig());
+ "classpath:" + this.springConfig);
}
ServletContextListener listener = new ContextLoaderListener();
@@ -145,7 +147,7 @@
System.exit(-1);
}
}
-
+
@Setter
public static class KustvaktArgs {
diff --git a/full/src/main/java/de/ids_mannheim/korap/server/KustvaktServer.java b/full/src/main/java/de/ids_mannheim/korap/server/KustvaktServer.java
index 8e23f82..098d68c 100644
--- a/full/src/main/java/de/ids_mannheim/korap/server/KustvaktServer.java
+++ b/full/src/main/java/de/ids_mannheim/korap/server/KustvaktServer.java
@@ -39,10 +39,6 @@
if (kargs == null)
System.exit(0);
- if (kargs.getSpringConfig() == null){
- kargs.setSpringConfig("default-config.xml");
- }
-
server.start();
}
}
diff --git a/lite/src/main/java/de/ids_mannheim/korap/server/KustvaktLiteServer.java b/lite/src/main/java/de/ids_mannheim/korap/server/KustvaktLiteServer.java
index 7203b4b..2a9ea8b 100644
--- a/lite/src/main/java/de/ids_mannheim/korap/server/KustvaktLiteServer.java
+++ b/lite/src/main/java/de/ids_mannheim/korap/server/KustvaktLiteServer.java
@@ -32,7 +32,7 @@
config = new KustvaktConfiguration();
config.loadBasicProperties(properties);
- kargs.setSpringConfig("lite-config.xml");
+ springConfig = "lite-config.xml";
server.start();
}