Database Connection-java.lang.ClassNotFoundException:

76 views
Skip to first unread message

Branden Osburn

unread,
Mar 22, 2018, 2:13:27 AM3/22/18
to Cognizant Intelligent Test Scripter


Hi All,

I am attempting to integrate some SQL queries with my automation.  I have installed the driver jar files in the lib folder here:  C:\cognizant-intelligent-test-scripter-1.0\lib\sqljdbc_6.4\enu

I have also pointed the db driver variable within the Database Settings of CITS to the jar file using this url:  C:\cognizant-intelligent-test-scripter-1.0\lib\sqljdbc_6.4\enu\mssql-jdbc-6.4.0.jre8.jar

When I click on Test Connection within the Database Settings window I get a red icon response and the log entry is as shown below.  Any suggestions would be very welcome.

java.lang.ClassNotFoundException: C:\cognizant-intelligent-test-scripter-1.0\lib\sqljdbc_6.4\enu\mssql-jdbc-6.4.0.jre8
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.cognizant.cognizantits.ide.main.settings.CognizantITSSettings$2.lambda$actionPerformed$3(CognizantITSSettings.java:138)
at java.util.Optional.ifPresent(Unknown Source)
at com.cognizant.cognizantits.ide.main.settings.CognizantITSSettings$2.actionPerformed(CognizantITSSettings.java:132)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

shantha laxmi kumar

unread,
Mar 22, 2018, 2:23:06 AM3/22/18
to Cognizant Intelligent Test Scripter

Please place the driver jar file under "lib/clib" folder and provide the connection string "jdbc:<Database>://<Host>:<Port>/<Database name>" under database settings.Then try to test the connection and revert to us.

Branden Osburn

unread,
Mar 23, 2018, 1:58:19 AM3/23/18
to Cognizant Intelligent Test Scripter
Hi Shantha,

I have done this.  The driver is pointed here:  C:\cognizant-intelligent-test-scripter-1.0\lib\sqljdbc_6.4\enu\mssql-jdbc-6.4.0.jre8.jar  and I confirmed the needed information for the connection string with my database developers.  Still get the red icon when testing connection and the log entry reflects class not found error.

shantha laxmi kumar

unread,
Mar 23, 2018, 2:03:00 AM3/23/18
to Cognizant Intelligent Test Scripter
Please follow this folder structure <lib/clib/your driver jar file> for placing your driver jar file. and do not follow like this "sqljdbc_6.4\enu\mssql-jdbc-6.4.0.jre8.jar ".

shantha laxmi kumar

unread,
Mar 23, 2018, 2:03:59 AM3/23/18
to Cognizant Intelligent Test Scripter
Also share the "log.txt" in CITS installation location after trying test connection from the IDE.

Branden Osburn

unread,
Mar 29, 2018, 1:25:28 AM3/29/18
to Cognizant Intelligent Test Scripter
I have attached the log as requested.
log.txt

shantha laxmi kumar

unread,
Mar 29, 2018, 1:30:08 AM3/29/18
to Cognizant Intelligent Test Scripter
From your log could see that you are still placing the jar here, "C:\cognizant-intelligent-test-scripter-1.0\lib\sqljdbc_6.4\enu\mssql-jdbc-6.4.0.jre8.jar", which is not inside the "clib" folder. Please place only the "mssql-jdbc-6.4.0.jre8.jar" inside the clib folder and the final path should be like "C:\cognizant-intelligent-test-scripter-1.0\lib\clib\mssql-jdbc-6.4.0.jre8.jar". Please check the same and revert.

Branden Osburn

unread,
Mar 29, 2018, 2:20:41 PM3/29/18
to Cognizant Intelligent Test Scripter
Hi Shantha,

I made the suggested updates and placed the jar file in the clib folder.  I'm still getting the same error as you can see in the attached log.
log.txt

shantha laxmi kumar

unread,
Apr 5, 2018, 8:47:43 AM4/5/18
to Cognizant Intelligent Test Scripter
Please try a sample JDBC code to connect to your database independent of CITS tool, if you are successful with this then, please come to implementing the same in CITS. Since database specific pre-requisites needs to be handled separate and is out of scope of CITS tool.



On Thursday, 22 March 2018 11:43:27 UTC+5:30, Branden Osburn wrote:
Reply all
Reply to author
Forward
0 new messages