From d35e5986dee8168d49988ebcd9547dea1c3009fa Mon Sep 17 00:00:00 2001 From: SC Date: Wed, 17 Jan 2018 16:46:50 -0800 Subject: [PATCH 1/2] minimal attempt at fixing #232 (lego catalogs) --- .../main/java/owltools/cli/SolrCommandRunner.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/OWLTools-Runner/src/main/java/owltools/cli/SolrCommandRunner.java b/OWLTools-Runner/src/main/java/owltools/cli/SolrCommandRunner.java index 70a7546b0..4cc4e31ca 100644 --- a/OWLTools-Runner/src/main/java/owltools/cli/SolrCommandRunner.java +++ b/OWLTools-Runner/src/main/java/owltools/cli/SolrCommandRunner.java @@ -555,13 +555,15 @@ else if (opts.nextEq("--noExitIfLoadFails")) { // Check to see if the global url has been set. String url = sortOutSolrURL(globalSolrURL); + // Ensure that legoCatalogs is defined, even is empty. + if( legoCatalogs == null ){ + legoCatalogs = new ArrayList(); + LOG.info("Missing lego catalogs..."); + } + // Only proceed if our environment was well-defined. - if( legoCatalogs == null || legoFiles == null || legoModelPrefix == null || - legoCatalogs.isEmpty() || legoFiles.isEmpty() ){ + if( legoFiles == null || legoModelPrefix == null || legoFiles.isEmpty() ){ String details = ""; - if (legoCatalogs == null || legoCatalogs.isEmpty()) { - details += "Missing catalog"; - } if (legoFiles == null || legoFiles.isEmpty()) { details += " Missing legoFiles"; } @@ -574,7 +576,7 @@ else if (opts.nextEq("--noExitIfLoadFails")) { LOG.info("Start Loading models, count: "+legoFiles.size()); // Ready the environment for every pass. ParserWrapper pw = new ParserWrapper(); - // Add all of the catalogs. + // Add all of the catalogs; possibly none. for( File legoCatalog : legoCatalogs ){ pw.addIRIMapper(new CatalogXmlIRIMapper(legoCatalog)); } From b2878b1b5185775a8a0ccb6bae1ff49fe26f8342 Mon Sep 17 00:00:00 2001 From: kltm Date: Thu, 18 Jan 2018 13:04:55 -0800 Subject: [PATCH 2/2] Update SolrCommandRunner.java `info` to `warn` --- .../src/main/java/owltools/cli/SolrCommandRunner.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OWLTools-Runner/src/main/java/owltools/cli/SolrCommandRunner.java b/OWLTools-Runner/src/main/java/owltools/cli/SolrCommandRunner.java index 4cc4e31ca..302fc3b25 100644 --- a/OWLTools-Runner/src/main/java/owltools/cli/SolrCommandRunner.java +++ b/OWLTools-Runner/src/main/java/owltools/cli/SolrCommandRunner.java @@ -558,7 +558,7 @@ else if (opts.nextEq("--noExitIfLoadFails")) { // Ensure that legoCatalogs is defined, even is empty. if( legoCatalogs == null ){ legoCatalogs = new ArrayList(); - LOG.info("Missing lego catalogs..."); + LOG.warn("Missing lego catalogs..."); } // Only proceed if our environment was well-defined. @@ -573,7 +573,7 @@ else if (opts.nextEq("--noExitIfLoadFails")) { LOG.error("Lego environment not well defined--skipping: "+details); exit(-1); }else{ - LOG.info("Start Loading models, count: "+legoFiles.size()); + LOG.warn("Start Loading models, count: "+legoFiles.size()); // Ready the environment for every pass. ParserWrapper pw = new ParserWrapper(); // Add all of the catalogs; possibly none.