Getting error while connecting to oracle

573 views
Skip to first unread message

Biswajit Nanda

unread,
Nov 16, 2015, 10:12:39 AM11/16/15
to dbfit
Getting the following error while trying to connect to oracle. Got to know that this error comes as for licencing, oracle jdbc is not included in the lib folder. But which jdbc driver I need to download. Can anybody guide me please? 

Regards, 
BN

java.lang.Error: Cannot load Oracle database driver oracle.jdbc.OracleDriver. Is the JDBC driver on the classpath? at dbfit.api.DbEnvironmentFactory$EnvironmentDescriptor.checkDriver(DbEnvironmentFactory.java:45) at dbfit.api.DbEnvironmentFactory$EnvironmentDescriptor.createEnvironmentInstance(DbEnvironmentFactory.java:60) at dbfit.api.DbEnvironmentFactory.createEnvironmentInstance(DbEnvironmentFactory.java:102) at dbfit.api.DbEnvironmentFactory.newEnvironmentInstance(DbEnvironmentFactory.java:106) at dbfit.OracleTest.
(OracleTest.java:5) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:422) at java.lang.Class.newInstance(Class.java:442) at fit.FixtureClass.newInstance(FixtureClass.java:24) at fit.FixtureLoader.instantiateFixture(FixtureLoader.java:62) at fit.FixtureLoader.instantiateFirstValidFixtureClass(FixtureLoader.java:84) at fit.FixtureLoader.disgraceThenLoad(FixtureLoader.java:44) at fit.Fixture.loadFixture(Fixture.java:142) at fit.Fixture.getLinkedFixtureWithArgs(Fixture.java:134) at fit.Fixture.doTables(Fixture.java:79) at fit.FitServer.process(FitServer.java:81) at fit.FitServer.run(FitServer.java:56) at fit.FitServer.main(FitServer.java:41) Caused by: java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at dbfit.api.DbEnvironmentFactory$EnvironmentDescriptor.checkDriver(DbEnvironmentFactory.java:43) ... 19 more

Mark Matten

unread,
Nov 16, 2015, 10:55:13 AM11/16/15
to dbfit
I take it you're using a recent version of DbFit (3.x perhaps) in which case try a driver built for JDK 7 or earlier and for an Oracle not earlier than the ones you're using.

Make sense?

Yavor Nikolov

unread,
Nov 16, 2015, 2:00:41 PM11/16/15
to db...@googlegroups.com
Hi BN,

You can pick the latest driver http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html (for 12.1.0.2) - ojdbc7.jar

Best Regards,
Yavor

--
You received this message because you are subscribed to the Google Groups "dbfit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dbfit+un...@googlegroups.com.
To post to this group, send email to db...@googlegroups.com.
Visit this group at http://groups.google.com/group/dbfit.
For more options, visit https://groups.google.com/d/optout.

Biswajit Nanda

unread,
Nov 19, 2015, 12:50:02 PM11/19/15
to dbfit
I still can't make it work. I have used it with SQL server but with oracle, it just does not work. I am not sure why this is so complicated to solve.


On Monday, 16 November 2015 15:12:39 UTC, Biswajit Nanda wrote:

Biswajit Nanda

unread,
Nov 19, 2015, 12:54:43 PM11/19/15
to dbfit
The documentation is just not clear enough for oracle issues. Would appreciate any help in resolving this problem.


On Monday, 16 November 2015 15:12:39 UTC, Biswajit Nanda wrote:

Mark Matten

unread,
Nov 19, 2015, 3:09:35 PM11/19/15
to dbfit
Are you getting the same error message? Are you sure that the hat file us in the lib directory?

Mark Matten

unread,
Nov 19, 2015, 3:11:27 PM11/19/15
to dbfit
I meant "jar file in the lib directory"!

Yavor Nikolov

unread,
Nov 25, 2015, 6:24:27 PM11/25/15
to dbfit
For the record - the problem has been solved by tweaking following points:
* JDBC Driver 11.2.0.4 - ojdbc6.jar (other 11.2 version should work fine too). DbFit is not compatible with JDBC 12c yet.
* A proper connection command string is:
!|Connect|myhost:1521/db-service-name|myuser|mypassword|

Biswajit Nanda

unread,
Nov 27, 2015, 1:02:53 PM11/27/15
to dbfit
This error got solved now. Massive thanks to Yavor and Mark for providing help. There were a couple of things which were needed for oracle. 

1. ojdbc7 jar did not work for oracle. Had to replace it with ojdbc6 jar
2. The connection string was incorrect. The right conenction shtring needs to follow the format 

!|Connect|localhost:1521/service-name|myuser|mypassword|

Regards, 
Biswajit



On Monday, 16 November 2015 15:12:39 UTC, Biswajit Nanda wrote:

Aparana Gupta

unread,
Apr 11, 2017, 7:48:01 AM4/11/17
to dbfit
Hi Biswajit, Yavor,

While trying to connect to Oracle through dbFit, I am getting the following error message:

java.lang.Error: Cannot load Oracle database driver oracle.jdbc.OracleDriver. Is the JDBC driver on the classpath? at dbfit.api.DbEnvironmentFactory$EnvironmentDescriptor.checkDriver(DbEnvironmentFactory.java:45)

Classpath:
---------------
C:\Users\mymachine>echo %CLASSPATH%
C:\Program Files (x86)\junit4.8.1;C:\Program Files (x86)\junit4.8.1\junit-4.8.1.
jar


javaversion:
-----------------
C:\Users\mymachine>echo %JAVA_HOME% C:\Program Files\Java\jdk1.8.0_112\

Please let me know on how to solve this error? which JDBC jar version I need to install & what will be the path where I can put in this Jar File?

Thanks in Advance!
Regards,
Aparana



Yavor Nikolov

unread,
Apr 11, 2017, 8:09:18 AM4/11/17
to dbfit
Please take ojdbc6.jar from the latest 11.2 JDBC driver (11.2.0.4 as of now): http://www.oracle.com/technetwork/database/features/jdbc/index-091264.html. You should put it in lib folder (next to the other DbFit .jar files).

--
You received this message because you are subscribed to the Google Groups "dbfit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dbfit+unsubscribe@googlegroups.com.

To post to this group, send email to db...@googlegroups.com.

harsh garg

unread,
Oct 14, 2018, 8:21:55 PM10/14/18
to dbfit
Hi Biswajit, Yavor

Getting the following error while trying to connect to oracle. 

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: System.Data.OracleClient requires Oracle client software version 8.1.7 or greater. at System.Data.OracleClient.OCI.DetermineClientVersion() at System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName) at System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions) at System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)


Got to know that this error comes as for Oracle jdbc driver which was not included in the lib folder. 

So I download and placed ojdbc6.jar in lib folder. But still getting above mentioned error.

Is it really related to Oracle client software version? or its related to Oracle Jdbc driver?

Yavor Nikolov

unread,
Oct 15, 2018, 12:10:50 AM10/15/18
to dbfit
Seems you're running the .NET version of dbFit, not the one based on Java.

--
You received this message because you are subscribed to the Google Groups "dbfit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dbfit+un...@googlegroups.com.

harsh garg

unread,
Oct 15, 2018, 12:37:51 AM10/15/18
to dbfit
Hi Yavor,

Thanks for your reply.

I am starting DbFit by using Java (Jre 6) on my machine.

Below is the content of my startFitnesse.bat file:

cd /d %~dp0
"C:\Program Files (x86)\Java\jre6\bin\java.exe" -cp "lib\dbfit-docs-3.2.0.jar;lib\fitnesse-20150424-standalone.jar;lib\dbfit-oracle-3.2.0.jar;lib\odbc6.jar" fitnesseMain.FitNesseMain %* -d "C:\Users\hgarg\Desktop\Harsh\DbFit Setup\dbfit-complete-3.2.0" -p "8085"


I don't have any idea regarding different versions of DbFit tool based on Java or .NET

I thought there are two ways to run DbFit — through Java or through .NET, the only significant difference between the two implementations is that the Java and .NET versions support different databases. Both .NET and Java versions support Oracle. Please correct me if I am thinking wrong.

And please suggest way to solve that exception.

Thanks in advance.
Message has been deleted

José Sosa

unread,
Dec 27, 2019, 12:22:05 PM12/27/19
to dbfit
hi guys, im new on DbFit, i need to knwon if now is available to connect to oracle 12c, 
I try with ojdbc6.jar and ojdbc7.jar and i cannot get anwser.


the stacktrace is this

java.lang.Error: java.lang.reflect.InvocationTargetException
at dbfit.api.DbEnvironmentFactory$EnvironmentDescriptor.createEnvironmentInstance(DbEnvironmentFactory.java:68)
at dbfit.api.DbEnvironmentFactory.createEnvironmentInstance(DbEnvironmentFactory.java:102)
at dbfit.api.DbEnvironmentFactory.newEnvironmentInstance(DbEnvironmentFactory.java:106)
at dbfit.OracleTest.(OracleTest.java:5)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at fit.FixtureClass.newInstance(FixtureClass.java:24)
at fit.FixtureLoader.instantiateFixture(FixtureLoader.java:62)
at fit.FixtureLoader.instantiateFirstValidFixtureClass(FixtureLoader.java:84)
at fit.FixtureLoader.disgraceThenLoad(FixtureLoader.java:44)
at fit.Fixture.loadFixture(Fixture.java:142)
at fit.Fixture.getLinkedFixtureWithArgs(Fixture.java:134)
at fit.Fixture.doTables(Fixture.java:79)
at fit.FitServer.process(FitServer.java:81)
at fit.FitServer.run(FitServer.java:56)
at fit.FitServer.main(FitServer.java:41)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at dbfit.api.DbEnvironmentFactory$EnvironmentDescriptor.createEnvironmentInstance(DbEnvironmentFactory.java:65)
... 18 more
Caused by: java.lang.Error: Cannot initialise oracle rowset
at dbfit.environment.OracleEnvironment.(OracleEnvironment.java:236)
... 23 more
Caused by: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleResultSetImpl
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at dbfit.environment.OracleEnvironment.(OracleEnvironment.java:232)
... 23 more

and my connection file is:

service=localhost:49171/ORCLCDB
username=xxxxx
password=xxxxx


Any idea?
Any help?

thanks guys!

Yavor Nikolov

unread,
Dec 29, 2019, 5:19:27 PM12/29/19
to dbfit
Hi Jose!

Sorry for the late reply! You may try connecting with 11g driver (until we implement support for 12c one). The 11g driver is compatible and should work fine with Oracle 12c.

Best Regards,
Yavor

José Sosa

unread,
Dec 30, 2019, 6:44:10 AM12/30/19
to dbfit
Thanks very much for your answer, i use this driver and work fine for me!


thanks again!
To unsubscribe from this group and stop receiving emails from it, send an email to db...@googlegroups.com.

José Sosa

unread,
Dec 30, 2019, 8:27:15 AM12/30/19
to dbfit
Yavor, do you known the possible limitations for using this driver for oracle 12c?

Thanks for you time
Reply all
Reply to author
Forward
0 new messages