Assembled lite version.

Change-Id: I48e60fffd9219a97923e7c388f4f97bcda416d3f
diff --git a/full/src/main/java/de/ids_mannheim/korap/filter/AuthFilter.java b/full/src/main/java/de/ids_mannheim/korap/filter/AuthFilter.java
index 0807d23..79d5511 100644
--- a/full/src/main/java/de/ids_mannheim/korap/filter/AuthFilter.java
+++ b/full/src/main/java/de/ids_mannheim/korap/filter/AuthFilter.java
@@ -1,4 +1,4 @@
-package de.ids_mannheim.korap.web.filter;
+package de.ids_mannheim.korap.filter;
 
 import com.sun.jersey.spi.container.ContainerRequest;
 import com.sun.jersey.spi.container.ContainerRequestFilter;
diff --git a/full/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java b/full/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java
index ac16556..19e091c 100644
--- a/full/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java
+++ b/full/src/main/java/de/ids_mannheim/korap/handlers/EntityDao.java
@@ -265,12 +265,12 @@
         catch (DuplicateKeyException e) {
             jlog.error("Could not create user account with username: {}",
                     user.getUsername());
-            throw new DatabaseException(user.getUsername(), "korap_users",
+            throw new DatabaseException(e, user.getUsername(), "korap_users",
                     StatusCodes.ENTRY_EXISTS, "Username exists.",
                     user.getUsername());
         }
         catch (DataAccessException e) {
-            throw new DatabaseException(user.getUsername(), "korap_users",
+            throw new DatabaseException(e, user.getUsername(), "korap_users",
                     StatusCodes.ENTRY_EXISTS, "Username exists.",
                     user.getUsername());
         }
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 86e9da9..a43d6f0 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
@@ -1,4 +1,4 @@
-package de.ids_mannheim.korap.web;
+package de.ids_mannheim.korap.server;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -8,6 +8,7 @@
 import de.ids_mannheim.korap.config.ContextHolder;
 import de.ids_mannheim.korap.config.KustvaktClassLoader;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
+import de.ids_mannheim.korap.web.KustvaktBaseServer;
 import de.ids_mannheim.korap.web.service.BootableBeanInterface;
 
 /**
@@ -26,9 +27,10 @@
 
         if (kargs.getConfig() != null)
             BeansFactory.loadFileContext(kargs.getConfig());
-        else
+        else{
+            kargs.setConfig("default-config.xml");
             BeansFactory.loadClasspathContext("default-config.xml");
-
+        }
         kargs.setRootPackages(new String[] { "de.ids_mannheim.korap.web.utils",
                 "de.ids_mannheim.korap.web.service.full" });
         rootPackages = "de.ids_mannheim.korap.web.utils;"
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/service/full/AdminService.java b/full/src/main/java/de/ids_mannheim/korap/web/service/full/AdminService.java
index d3694b8..67be146 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/service/full/AdminService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/service/full/AdminService.java
@@ -32,10 +32,10 @@
 import de.ids_mannheim.korap.resources.ResourceFactory;
 import de.ids_mannheim.korap.security.PolicyCondition;
 import de.ids_mannheim.korap.security.ac.PolicyBuilder;
+import de.ids_mannheim.korap.server.KustvaktServer;
 import de.ids_mannheim.korap.user.User;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.utils.TimeUtils;
-import de.ids_mannheim.korap.web.KustvaktServer;
 import de.ids_mannheim.korap.web.filter.AdminFilter;
 import de.ids_mannheim.korap.web.filter.PiwikFilter;
 import de.ids_mannheim.korap.web.utils.KustvaktResponseHandler;
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/service/full/AnnotationService.java b/full/src/main/java/de/ids_mannheim/korap/web/service/full/AnnotationService.java
index 102ed8b..5055e56 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/service/full/AnnotationService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/service/full/AnnotationService.java
@@ -27,8 +27,8 @@
 import de.ids_mannheim.korap.entity.AnnotationPair;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
+import de.ids_mannheim.korap.filter.AuthFilter;
 import de.ids_mannheim.korap.utils.JsonUtils;
-import de.ids_mannheim.korap.web.filter.AuthFilter;
 import de.ids_mannheim.korap.web.filter.DemoUserFilter;
 import de.ids_mannheim.korap.web.filter.PiwikFilter;
 import de.ids_mannheim.korap.web.utils.KustvaktResponseHandler;
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/service/full/AuthService.java b/full/src/main/java/de/ids_mannheim/korap/web/service/full/AuthService.java
index 2802ceb..96f345c 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/service/full/AuthService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/service/full/AuthService.java
@@ -7,13 +7,14 @@
 import de.ids_mannheim.korap.config.BeansFactory;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
+import de.ids_mannheim.korap.filter.AuthFilter;
 import de.ids_mannheim.korap.interfaces.AuthenticationManagerIface;
 import de.ids_mannheim.korap.security.auth.BasicHttpAuth;
+import de.ids_mannheim.korap.server.KustvaktServer;
 import de.ids_mannheim.korap.user.*;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.utils.KustvaktLogger;
 import de.ids_mannheim.korap.utils.ServiceInfo;
-import de.ids_mannheim.korap.web.KustvaktServer;
 import de.ids_mannheim.korap.web.filter.*;
 import de.ids_mannheim.korap.web.utils.KustvaktResponseHandler;
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/service/full/DocumentService.java b/full/src/main/java/de/ids_mannheim/korap/web/service/full/DocumentService.java
index 83dee9c..df23da8 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/service/full/DocumentService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/service/full/DocumentService.java
@@ -5,9 +5,9 @@
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.handlers.DocumentDao;
 import de.ids_mannheim.korap.resources.Document;
+import de.ids_mannheim.korap.server.KustvaktServer;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.utils.KustvaktLogger;
-import de.ids_mannheim.korap.web.KustvaktServer;
 import de.ids_mannheim.korap.web.filter.AdminFilter;
 import de.ids_mannheim.korap.web.utils.KustvaktResponseHandler;
 import org.slf4j.Logger;
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/service/full/KustvaktService.java b/full/src/main/java/de/ids_mannheim/korap/web/service/full/KustvaktService.java
index c4db1b8..7c7b647 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/service/full/KustvaktService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/service/full/KustvaktService.java
@@ -1,8 +1,9 @@
 package de.ids_mannheim.korap.web.service.full;
 
+import de.ids_mannheim.korap.server.KustvaktServer;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.utils.ServiceInfo;
-import de.ids_mannheim.korap.web.KustvaktServer;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/service/full/OAuthService.java b/full/src/main/java/de/ids_mannheim/korap/web/service/full/OAuthService.java
index 67a11ef..778ac27 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/service/full/OAuthService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/service/full/OAuthService.java
@@ -5,14 +5,14 @@
 import de.ids_mannheim.korap.config.*;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
+import de.ids_mannheim.korap.filter.AuthFilter;
 import de.ids_mannheim.korap.handlers.OAuth2Handler;
 import de.ids_mannheim.korap.interfaces.AuthenticationManagerIface;
 import de.ids_mannheim.korap.interfaces.EncryptionIface;
+import de.ids_mannheim.korap.server.KustvaktServer;
 import de.ids_mannheim.korap.user.*;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.utils.StringUtils;
-import de.ids_mannheim.korap.web.KustvaktServer;
-import de.ids_mannheim.korap.web.filter.AuthFilter;
 import de.ids_mannheim.korap.web.filter.BlockingFilter;
 import de.ids_mannheim.korap.web.filter.DemoUserFilter;
 import de.ids_mannheim.korap.web.filter.PiwikFilter;
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/service/full/SearchService.java b/full/src/main/java/de/ids_mannheim/korap/web/service/full/SearchService.java
index 3358eb4..617385e 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/service/full/SearchService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/service/full/SearchService.java
@@ -40,6 +40,7 @@
 import de.ids_mannheim.korap.config.KustvaktConfiguration.BACKENDS;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
+import de.ids_mannheim.korap.filter.AuthFilter;
 import de.ids_mannheim.korap.interfaces.AuthenticationManagerIface;
 import de.ids_mannheim.korap.query.serialize.MetaQueryBuilder;
 import de.ids_mannheim.korap.query.serialize.QuerySerializer;
@@ -60,7 +61,6 @@
 import de.ids_mannheim.korap.utils.StringUtils;
 import de.ids_mannheim.korap.web.ClientsHandler;
 import de.ids_mannheim.korap.web.SearchKrill;
-import de.ids_mannheim.korap.web.filter.AuthFilter;
 import de.ids_mannheim.korap.web.filter.DemoUserFilter;
 import de.ids_mannheim.korap.web.filter.PiwikFilter;
 import de.ids_mannheim.korap.web.utils.KustvaktResponseHandler;
diff --git a/full/src/main/java/de/ids_mannheim/korap/web/service/full/UserService.java b/full/src/main/java/de/ids_mannheim/korap/web/service/full/UserService.java
index b36ff99..f18d72f 100644
--- a/full/src/main/java/de/ids_mannheim/korap/web/service/full/UserService.java
+++ b/full/src/main/java/de/ids_mannheim/korap/web/service/full/UserService.java
@@ -10,13 +10,13 @@
 import de.ids_mannheim.korap.config.URIParam;
 import de.ids_mannheim.korap.exceptions.KustvaktException;
 import de.ids_mannheim.korap.exceptions.StatusCodes;
+import de.ids_mannheim.korap.filter.AuthFilter;
 import de.ids_mannheim.korap.interfaces.AuthenticationManagerIface;
+import de.ids_mannheim.korap.server.KustvaktServer;
 import de.ids_mannheim.korap.user.*;
 import de.ids_mannheim.korap.utils.JsonUtils;
 import de.ids_mannheim.korap.utils.StringUtils;
 import de.ids_mannheim.korap.utils.TimeUtils;
-import de.ids_mannheim.korap.web.KustvaktServer;
-import de.ids_mannheim.korap.web.filter.AuthFilter;
 import de.ids_mannheim.korap.web.filter.BlockingFilter;
 import de.ids_mannheim.korap.web.filter.DemoUserFilter;
 import de.ids_mannheim.korap.web.filter.PiwikFilter;
diff --git a/full/src/main/resources/default-config.xml b/full/src/main/resources/default-config.xml
index 94a9c53..33e19a7 100644
--- a/full/src/main/resources/default-config.xml
+++ b/full/src/main/resources/default-config.xml
@@ -59,7 +59,7 @@
 
 	<!-- props are injected from default-config.xml -->
 	<bean id="kustvakt_config" class="de.ids_mannheim.korap.config.KustvaktConfiguration">
-		<property name="properties" ref="props" />
+		<constructor-arg name="properties" ref="props" />
 	</bean>
 
 	<!--class="org.apache.commons.dbcp2.BasicDataSource" -->
@@ -284,4 +284,10 @@
 		class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
 		<property name="dataSource" ref="dataSource" />
 	</bean>
+	
+	<!-- Krill -->
+	<bean id="search_krill"
+          class="de.ids_mannheim.korap.web.SearchKrill">
+        <constructor-arg value="${krill.indexDir}"/>
+    </bean>
 </beans>
\ No newline at end of file
diff --git a/full/src/main/resources/kustvakt.conf b/full/src/main/resources/kustvakt.conf
index 3ef0604..8d04c92 100644
--- a/full/src/main/resources/kustvakt.conf
+++ b/full/src/main/resources/kustvakt.conf
@@ -1,5 +1,5 @@
 ## index dir
-krill.indexDir= src/test/resources/sample-index
+krill.indexDir= ../sample-index
 
 krill.index.commit.count = 134217000
 krill.index.commit.log = log/krill.commit.log