diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/application/ApplicationImpl.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/application/ApplicationImpl.java index b631836c8..1838bb3ff 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/application/ApplicationImpl.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/application/ApplicationImpl.java @@ -171,14 +171,17 @@ public class ApplicationImpl implements Application { ss.info(this, "Started the ContentTripleSource: " + contentTripleSource); - ConfigurationTripleSource configurationTripleSource = app - .getConfigurationTripleSource(); - configurationTripleSource.startup(app, css); - ss.info(this, "Started the ConfigurationTripleSource: " - + configurationTripleSource); + // Ensure that we haven't failed setting up the content triple store before continuing + if (!ss.isStartupAborted()) { + ConfigurationTripleSource configurationTripleSource = app + .getConfigurationTripleSource(); + configurationTripleSource.startup(app, css); + ss.info(this, "Started the ConfigurationTripleSource: " + + configurationTripleSource); - configureJena(); - prepareCombinedTripleSource(app, ctx); + configureJena(); + prepareCombinedTripleSource(app, ctx); + } } private void configureJena() { diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/triplesource/impl/sdb/SDBConnectionSmokeTests.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/triplesource/impl/sdb/SDBConnectionSmokeTests.java index 3246d2c07..5cdd73130 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/triplesource/impl/sdb/SDBConnectionSmokeTests.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/triplesource/impl/sdb/SDBConnectionSmokeTests.java @@ -94,7 +94,22 @@ public class SDBConnectionSmokeTests { try (Connection conn = DriverManager .getConnection(url, connectionProps)) { - // Just open the connection and close it. + // We have an SQL connection - see if we have any XSD Strings in the database + String skip = props.getProperty("skip.Jena3StringTest", "false"); + if (!Boolean.parseBoolean(skip)) { + try { + Statement stmt = conn.createStatement(); + ResultSet rs = stmt.executeQuery("SELECT COUNT(1) AS total FROM Nodes WHERE datatype='http://www.w3.org/2001/XMLSchema#string'"); + if (rs != null && rs.next()) { + long total = rs.getLong("total"); + if (total > 0) { + ss.fatal("XSD Strings exist in Nodes table. Requires upgrade for Jena 3"); + } + } + } catch (SQLException e) { + // Ignore SQL Exception here, as it likely represents a triple store that's not initialised yet. + } + } } catch (SQLException e) { ss.fatal("Can't connect to the database: " + PROPERTY_DB_URL + "='" + url + "', " + PROPERTY_DB_USERNAME + "='" + username