You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by rv...@apache.org on 2013/06/03 21:37:51 UTC
svn commit: r1489122 - in
/jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc:
JenaDriver.java logging/
Author: rvesse
Date: Mon Jun 3 19:37:51 2013
New Revision: 1489122
URL: http://svn.apache.org/r1489122
Log:
Start increasing logging
Removed:
jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/logging/
Modified:
jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/JenaDriver.java
Modified: jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/JenaDriver.java
URL: http://svn.apache.org/viewvc/jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/JenaDriver.java?rev=1489122&r1=1489121&r2=1489122&view=diff
==============================================================================
--- jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/JenaDriver.java (original)
+++ jena/Experimental/jena-jdbc/jena-jdbc-core/src/main/java/org/apache/jena/jdbc/JenaDriver.java Mon Jun 3 19:37:51 2013
@@ -274,6 +274,7 @@ public abstract class JenaDriver impleme
preProcessors = (List<String>) ppObj;
} else {
// Parameter set to some unexpected type
+ LOGGER.error("Driver Parameter " + PARAM_PRE_PROCESSOR + " has unexpected invalid value");
throw new SQLException("Parameter " + PARAM_PRE_PROCESSOR + " was set to a value of unexpected type "
+ ppObj.getClass().getCanonicalName()
+ ", expected either a String or List<String> as the parameter value");
@@ -288,6 +289,7 @@ public abstract class JenaDriver impleme
continue;
try {
+ LOGGER.info("Attempting to initialize pre-processor " + ppClassName);
Class<?> c = Class.forName(ppClassName);
Object i = c.newInstance();
@@ -297,8 +299,11 @@ public abstract class JenaDriver impleme
CommandPreProcessor pp = (CommandPreProcessor) i;
pp.initialize(initProps);
conn.addPreProcessor(pp);
+
+ LOGGER.info("Initialized pre-processor " + ppClassName + " successfully");
} else {
// Otherwise throw an error
+ LOGGER.error("Invalid value for " + PARAM_PRE_PROCESSOR + " parameter, references a class that exists but does not implement the required interface");
throw new SQLException(
"Parameter "
+ PARAM_PRE_PROCESSOR
@@ -308,6 +313,7 @@ public abstract class JenaDriver impleme
}
} catch (ClassNotFoundException e) {
// Unable to find the referenced class
+ LOGGER.error("Invalid value for " + PARAM_PRE_PROCESSOR + " parameter, references a class that did not exist", e);
throw new SQLException(
"Parameter "
+ PARAM_PRE_PROCESSOR
@@ -317,6 +323,7 @@ public abstract class JenaDriver impleme
e);
} catch (InstantiationException e) {
// Unable to instantiate the referenced class
+ LOGGER.error("Invalid value for " + PARAM_PRE_PROCESSOR + " parameter, references a class that exists but does not have an appropriate constructor", e);
throw new SQLException(
"Parameter "
+ PARAM_PRE_PROCESSOR
@@ -326,6 +333,7 @@ public abstract class JenaDriver impleme
e);
} catch (IllegalAccessException e) {
// Referenced class is not accessible
+ LOGGER.error("Invalid value for " + PARAM_PRE_PROCESSOR + " parameter, references a class that exists but is inaccessible", e);
throw new SQLException(
"Parameter "
+ PARAM_PRE_PROCESSOR
@@ -338,6 +346,7 @@ public abstract class JenaDriver impleme
throw e;
} catch (Exception e) {
// Unexpected error
+ LOGGER.error("Invalid value for " + PARAM_PRE_PROCESSOR + " parameter, references a class that attempting to initialize produced an unexpected exception", e);
throw new SQLException(
"Parameter "
+ PARAM_PRE_PROCESSOR
@@ -355,6 +364,7 @@ public abstract class JenaDriver impleme
throw e;
} catch (Exception e) {
abort = true;
+ LOGGER.error("Unexpected exception while establishing a connection", e);
throw new SQLException("Unexpected exception while establishing a connection, see inner exception for details", e);
} finally {
// If something has gone badly wrong close the connection
@@ -456,6 +466,7 @@ public abstract class JenaDriver impleme
ps.put(key, values);
}
} else {
+ LOGGER.warn("Cannot specify parameter " + key + " multiple times in the connection URL");
throw new SQLException("Invalid connection URL parameter " + kvp + " encountered, the parameter " + key
+ " may only be specified once");
}