From b2f1f05921ea7d2c04cb88c70fae58f620d81b4d Mon Sep 17 00:00:00 2001
From: Tor-Einar Skog <tor-einar.skog@nibio.no>
Date: Fri, 8 Feb 2019 13:35:37 +0100
Subject: [PATCH] Minor changes

---
 nb-configuration.xml                          |  1 +
 pom.xml                                       | 74 ++++---------------
 .../vips/core/service/ModelResourceImpl.java  |  4 +-
 .../vips/model/factory/ModelFactory.java      |  4 +-
 4 files changed, 19 insertions(+), 64 deletions(-)

diff --git a/nb-configuration.xml b/nb-configuration.xml
index e9e56b5..00dea3e 100755
--- a/nb-configuration.xml
+++ b/nb-configuration.xml
@@ -18,5 +18,6 @@ Any value defined here will override the pom.xml file value but is only applicab
         <netbeans.hint.license>nibio_open_source_license.ftl</netbeans.hint.license>
         <org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>WildFly</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_deploy_2e_server>
         <org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>1.7-web</org-netbeans-modules-maven-j2ee.netbeans_2e_hint_2e_j2eeVersion>
+        <netbeans.hint.jdkPlatform>JDK_1.8_SUN</netbeans.hint.jdkPlatform>
     </properties>
 </project-shared-configuration>
diff --git a/pom.xml b/pom.xml
index 0156729..5ef3e3f 100755
--- a/pom.xml
+++ b/pom.xml
@@ -12,75 +12,27 @@
 
   <dependencies>
     <dependency>
-      <groupId>javax.servlet</groupId>
-      <artifactId>servlet-api</artifactId>
-      <version>2.5</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>javax.servlet.jsp</groupId>
-      <artifactId>jsp-api</artifactId>
-      <version>2.1</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.jboss.resteasy</groupId>
-      <artifactId>resteasy-jaxrs</artifactId>
-      <version>3.0.9.Final</version>
-      <scope>provided</scope> 
-    </dependency>
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-core</artifactId>
-      <version>2.4.1</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>com.fasterxml.jackson.core</groupId>
-      <artifactId>jackson-databind</artifactId>
-      <version>2.4.1</version>
-    </dependency>
-    <dependency>
-      <groupId>javax.persistence</groupId>
-      <artifactId>persistence-api</artifactId>
-      <version>1.0</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-      <groupId>javax.transaction</groupId>
-      <artifactId>jta</artifactId>
-      <version>1.1</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
-         <groupId>org.reflections</groupId>
-         <artifactId>reflections</artifactId>
-         <version>0.9.9</version>
-     </dependency>
-    <dependency>
-      <groupId>no.nibio.vips.common</groupId>
-      <artifactId>VIPSCommon</artifactId>
-      <version>1.0-SNAPSHOT</version>
-      <scope>provided</scope>
-    </dependency>
-    <dependency>
+    <groupId>org.reflections</groupId>
+    <artifactId>reflections</artifactId>
+    <version>0.9.11</version>
+</dependency>
+<dependency>
       <groupId>com.thetransactioncompany</groupId>
       <artifactId>cors-filter</artifactId>
       <version>1.7.1</version>
     </dependency>
     <dependency>
-      <groupId>javax</groupId>
-      <artifactId>javaee-web-api</artifactId>
-      <version>6.0</version>
+      <groupId>no.bioforsk.vips.common</groupId>
+      <artifactId>VIPSCommon</artifactId>
+      <version>1.0-SNAPSHOT</version>
       <type>jar</type>
-      <scope>provided</scope>
     </dependency>
     <dependency>
-        <groupId>com.bedatadriven</groupId>
-        <artifactId>jackson-datatype-jts</artifactId>
-        <version>2.2</version>
-  </dependency>   
-  
+      <groupId>com.bedatadriven</groupId>
+      <artifactId>jackson-datatype-jts</artifactId>
+      <version>2.2</version>
+      <type>jar</type>
+    </dependency>
   </dependencies>
 
   <build>
diff --git a/src/main/java/no/nibio/vips/core/service/ModelResourceImpl.java b/src/main/java/no/nibio/vips/core/service/ModelResourceImpl.java
index 6db9d15..13e0c99 100755
--- a/src/main/java/no/nibio/vips/core/service/ModelResourceImpl.java
+++ b/src/main/java/no/nibio/vips/core/service/ModelResourceImpl.java
@@ -19,6 +19,8 @@
 
 package no.nibio.vips.core.service;
 
+import java.net.URL;
+import java.net.URLClassLoader;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -51,7 +53,7 @@ public class ModelResourceImpl implements ModelResource{
     
     @Context
     HttpServletRequest servletRequest;
-     
+    
     /**
      * Lists all models available in this instance, using default language (English)
      * @return list of all models available
diff --git a/src/main/java/no/nibio/vips/model/factory/ModelFactory.java b/src/main/java/no/nibio/vips/model/factory/ModelFactory.java
index f78c1f4..4edc675 100755
--- a/src/main/java/no/nibio/vips/model/factory/ModelFactory.java
+++ b/src/main/java/no/nibio/vips/model/factory/ModelFactory.java
@@ -135,7 +135,7 @@ public class ModelFactory {
             reflections = new Reflections(topDomain);
             subTypes.addAll(reflections.getSubTypesOf(Model.class));   
         }
-         
+                 
         /**
          * Iterates and instantiates one object for each class
          */
@@ -158,7 +158,7 @@ public class ModelFactory {
                        throw new DuplicateModelIdException(message);
                    }
                    //System.out.println("Model " + model.getModelName() + " with id=" + model.getModelId().toString() + " was found");
-               } catch (    InstantiationException | IllegalAccessException | DuplicateModelIdException ex) {
+               } catch (    InstantiationException | IllegalAccessException | DuplicateModelIdException | NoClassDefFoundError ex) {
                    Logger.getLogger(ModelFactory.class.getName()).log(Level.SEVERE, null, ex);
                }
         }
-- 
GitLab