summaryrefslogtreecommitdiffstats
path: root/dblib/provider
diff options
context:
space:
mode:
authorTimoney, Dan (dt5972) <dtimoney@att.com>2019-02-01 15:45:52 -0500
committerTimoney, Dan (dt5972) <dtimoney@att.com>2019-02-01 15:45:52 -0500
commit66879d0c4c73b9cd371cdffec3a56f25c340a100 (patch)
tree612db31e80ff8cf40f6c7c34e36a87a90f65d310 /dblib/provider
parent1efd16dce0ecedb81039b26b81d1490cadeb3395 (diff)
Hack to force classloader t find mariadb driver
Container is not coming up because dblib is getting ClassNotFoundException for mariadb driver, even though it is installed. To correct this temporarily, updated code to explicitly create a driver object. Change-Id: I210d042be2c71a4392781ad26f858c916dbd7364 Issue-ID: CCSDK-489 Signed-off-by: Timoney, Dan (dt5972) <dtimoney@att.com>
Diffstat (limited to 'dblib/provider')
-rwxr-xr-xdblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java
index 9d797d096..0b8c565f1 100755
--- a/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java
+++ b/dblib/provider/src/main/java/org/onap/ccsdk/sli/core/dblib/DBResourceManager.java
@@ -24,6 +24,7 @@ package org.onap.ccsdk.sli.core.dblib;
import java.io.PrintWriter;
import java.sql.Connection;
+import java.sql.Driver;
import java.sql.SQLDataException;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
@@ -92,6 +93,12 @@ public class DBResourceManager implements DataSource, DataAccessor, DBResourceOb
public DBResourceManager(final Properties properties) {
this.configProps = properties;
+
+ // TODO : hack to force classloader to cache mariadb driver. This shouldnt be necessary,
+ // but for some reason it is (without this, dblib throws ClassNotFound on mariadb driver
+ // and fails to load).
+ Driver dvr = new org.mariadb.jdbc.Driver();
+ dvr = null;
// get retry interval value
retryInterval = getLongFromProperties(properties, "org.onap.dblib.connection.retry", 10000L);