All Apps and Add-ons

Oracle JDBC for DB connect, NoClassDefFound

potatok
Explorer

I'm testing the DB connect to Oracle. I've been having problems with JDBC drivers. Where should I put the drivers exactly? and which files are needed?

Thanks.
Will

2013-03-19 10:52:41.103 dbx3480:ERROR:BridgeSession - Exception occured while executing command: java.lang.NoClassDefFoundError: Could not initialize class oracle.jdbc.driver.DMSFactory
java.lang.NoClassDefFoundError: Could not initialize class oracle.jdbc.driver.DMSFactory
at oracle.jdbc.driver.PhysicalConnection.createDMSSensors(PhysicalConnection.java:3855)
at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:641)
at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:237)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:566)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at com.splunk.dbx.sql.type.impl.AbstractDatabaseType.connect(AbstractDatabaseType.java:123)
at com.splunk.dbx.sql.type.impl.Oracle.connect(Oracle.java:48)
at com.splunk.dbx.sql.Database.connect(Database.java:445)
at com.splunk.dbx.sql.Database.validateConnectionParameters(Database.java:377)
at com.splunk.dbx.sql.validate.DatabaseValidator.invoke(DatabaseValidator.java:29)
at com.splunk.bridge.session.BridgeSession.call(BridgeSession.java:92)
at com.splunk.bridge.session.BridgeSession.call(BridgeSession.java:30)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)

0 Karma
1 Solution

potatok
Explorer

I'm running CentOS 6.2 with Splunk 5.0.2. Java 1.6.0_43

ojdbc*.jar was copied to the correct dir.

Then I got
java.lang.ClassNotFoundException: oracle.dms.console.DMSConsole

this is resolved by finding dms.jar from our Oracle server and copy it to the same dir

View solution in original post

0 Karma

splunkIT
Splunk Employee
Splunk Employee

Most likely the issue is caused by the java jre/jdk version used. I had ran into this error on jre 1.6. Once I have upgraded to jre 1.7, the error has stopped occurring. I only needed the ojdbc6.jar in $SPLUNK_HOME/etc/apps/dbx/bin/lib and it has been working fine.

The latest jre/jdk can be obtained here:

http://www.oracle.com/technetwork/java/javase/downloads/index.html

0 Karma

potatok
Explorer

I'm running CentOS 6.2 with Splunk 5.0.2. Java 1.6.0_43

ojdbc*.jar was copied to the correct dir.

Then I got
java.lang.ClassNotFoundException: oracle.dms.console.DMSConsole

this is resolved by finding dms.jar from our Oracle server and copy it to the same dir

0 Karma

ziegfried
Influencer

Please put the file ojdbc6.jar from the Oracle JDBC driver distribution into $SPLUNK_HOME/etc/apps/dbx/bin/lib and restart Splunk.

0 Karma

potatok
Explorer

I'm running CentOS 6.2 with Splunk 5.0.2. Java 1.6.0_43

0 Karma

potatok
Explorer

I have the jar and I restarted Splunk

$ ls -1 /opt/splunk/etc/apps/dbx/bin/lib/ojdbc*
/opt/splunk/etc/apps/dbx/bin/lib/ojdbc5dms.jar
/opt/splunk/etc/apps/dbx/bin/lib/ojdbc5.jar
/opt/splunk/etc/apps/dbx/bin/lib/ojdbc6dms.jar
/opt/splunk/etc/apps/dbx/bin/lib/ojdbc6.jar

From the "Recent DB Connect errors" search, I found this
11:35:36.712 dbx4539:ERROR:BridgeSession - Exception occured while executing command: java.lang.NoClassDefFoundError: Could not initialize class oracle.jdbc.driver.DMSFactory
java.lang.NoClassDefFoundError: Could not initialize class oracle.jdbc.driver.DMSFactory

0 Karma
Get Updates on the Splunk Community!

Splunk Observability Cloud’s AI Assistant in Action Series: Analyzing and ...

This is the second post in our Splunk Observability Cloud’s AI Assistant in Action series, in which we look at ...

Elevate Your Organization with Splunk’s Next Platform Evolution

 Thursday, July 10, 2025  |  11AM PDT / 2PM EDT Whether you're managing complex deployments or looking to ...

Splunk Answers Content Calendar, June Edition

Get ready for this week’s post dedicated to Splunk Dashboards! We're celebrating the power of community by ...