]> git.aero2k.de Git - tmp/jakarta-migration.git/commitdiff
DRYD-177: Fixed crashing issue with authority definitions with no initial terms defined.
authorremillet <remillet@yahoo.com>
Mon, 6 Nov 2017 16:08:42 +0000 (08:08 -0800)
committerremillet <remillet@yahoo.com>
Mon, 6 Nov 2017 16:08:42 +0000 (08:08 -0800)
services/JaxRsServiceProvider/src/main/java/org/collectionspace/services/jaxrs/CSpaceResteasyBootstrap.java

index 29936c9c50c360a7ea35d6ea0c9c8cb700184d7d..d0ad3dd4db07c2653525afeb41a8d9900dfe545f 100644 (file)
@@ -45,7 +45,10 @@ public class CSpaceResteasyBootstrap extends ResteasyBootstrap {
                        Dispatcher disp = deployment.getDispatcher();
                        disp.getDefaultContextObjects().put(ResourceMap.class, app.getResourceMap());
                        
-                       initializeAuthorities(app.getResourceMap());
+                       String initAuthsString = System.getProperty("org.collectionspace.services.authorities.init", Boolean.TRUE.toString()); // Property can be set in the tomcat/bin/setenv.sh (or setenv.bat) file
+                       if (Boolean.valueOf(initAuthsString) == true) {
+                               initializeAuthorities(app.getResourceMap());
+                       }
                        
                        logger.log(Level.INFO, String.format("%tc [INFO] CollectionSpace Services' JAX-RS application started.", new Date()));
                } catch (Exception e) {
@@ -162,6 +165,10 @@ public class CSpaceResteasyBootstrap extends ResteasyBootstrap {
        Response response = null;
 
        TermList termListElement = authorityInstance.getTermList();
+       if (termListElement == null) {
+               return;
+       }
+       
        for (Term term : termListElement.getTerm()) {
                //
                // Check to see if the term already exists