Fixed unrecognized application/json and velocity template.
Change-Id: I2c718fbdba86fcdc20fd20893c3c8f803809f460
diff --git a/core/Changes b/core/Changes
index 7434a31..3b341f8 100644
--- a/core/Changes
+++ b/core/Changes
@@ -1,5 +1,5 @@
version 0.59.10
-07/02/2018
+20/02/2018
- updated hibernate and reflection versions (margaretha)
- added Changes file (margaretha)
- merged BeanConfigBaseTest to BeanConfigTest in /full (margaretha)
@@ -7,6 +7,7 @@
- updated library versions and java environment (margaretha)
- added status codes (margaretha)
- moved validation.properties (margaretha)
+ - fixed unrecognize media-type application/json (margaretha)
version 0.59.9
08/11/2017
diff --git a/core/pom.xml b/core/pom.xml
index a8420e4..9089163 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -261,7 +261,7 @@
<dependency>
<groupId>de.ids_mannheim.korap</groupId>
<artifactId>Krill</artifactId>
- <version>0.56.1</version>
+ <version>0.56.2</version>
<exclusions>
<exclusion>
<groupId>org.xerial</groupId>
diff --git a/core/src/main/java/de/ids_mannheim/korap/web/KustvaktBaseServer.java b/core/src/main/java/de/ids_mannheim/korap/web/KustvaktBaseServer.java
index 904e04e..8496d04 100644
--- a/core/src/main/java/de/ids_mannheim/korap/web/KustvaktBaseServer.java
+++ b/core/src/main/java/de/ids_mannheim/korap/web/KustvaktBaseServer.java
@@ -24,7 +24,7 @@
public abstract class KustvaktBaseServer {
protected static KustvaktConfiguration config;
-
+
protected static String rootPackages;
protected static KustvaktArgs kargs;
@@ -62,35 +62,37 @@
return kargs;
}
- protected void start(){
-
- if (kargs.port == -1){
+ protected void start () {
+
+ if (kargs.port == -1) {
kargs.setPort(config.getPort());
}
Server server = new Server();
-
- ServletContextHandler contextHandler = new ServletContextHandler(
- ServletContextHandler.NO_SESSIONS);
+
+ ServletContextHandler contextHandler =
+ new ServletContextHandler(ServletContextHandler.NO_SESSIONS);
contextHandler.setContextPath("/");
contextHandler.setInitParameter("contextConfigLocation",
"classpath:" + kargs.getConfig());
-
+
ServletContextListener listener = new ContextLoaderListener();
contextHandler.addEventListener(listener);
ServletHolder servletHolder = new ServletHolder(new SpringServlet());
servletHolder.setInitParameter(
"com.sun.jersey.config.property.packages", rootPackages);
+ servletHolder.setInitParameter(
+ "com.sun.jersey.api.json.POJOMappingFeature", "true");
servletHolder.setInitOrder(1);
contextHandler.addServlet(servletHolder, config.getBaseURL());
ServerConnector connector = new ServerConnector(server);
connector.setPort(kargs.port);
connector.setIdleTimeout(60000);
-
+
server.setHandler(contextHandler);
-
+
server.setConnectors(new Connector[] { connector });
try {
server.start();