Forum Discussion

Joe_DuBois's avatar
Joe_DuBois
Occasional Contributor
16 years ago

OracleDriver - Unable to resolve

Well met all,

Trying to learn SoapUI/Groovy which the User Guide has been very helpful so far. But I am now trying to use a Groovy script to connect to an Oracle Database and get some data.

Script is below... (stripped user info out)
As you can see (hopefully) in the screenshot I do have the ojdbc14.jar file in the ./bin/ext directory of the SoapUI install, but it doesn't seem to find it, I also have the import statement (which I assume I need - though maybe I don't - when I remove it I get a "Class not found" exception (also pointing to the oracle.jdbc.driver.OracleDriver class).

Help advise please.
Thanks - Joe

Note: when I do run the script it does have the proper Connection string/username/password in it. Just removed them for posting issues.

import groovy.sql.Sql;
import oracle.jdbc.driver.OracleDriver;


def db = Sql.newInstance('jdbc:oracle:thin:@(<dataconnect-info>))',
'<username>', '<password>','oracle.jdbc.driver.OracleDriver');
db.eachRow("select DEPT_GROUP, VMS_QUEUE from OPS$PL.PL_PRINT_SCHEDULE") {
println it.DEPT_GROUP + " " + it.VMS_QUEUE;
}



Gives me following error:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Script16.groovy: 2: unable to resolve class oracle.jdbc.driver.OracleDriver @ line 2, column 1.org.codehaus.groovy.syntax.SyntaxException: unable to resolve class oracle.jdbc.driver.OracleDriver @ line 2, column 1. at org.codehaus.groovy.ast.ClassCodeVisitorSupport.addError(ClassCodeVisitorSupport.java:113) at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:970) at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:141) at org.codehaus.groovy.control.CompilationUnit$5.call(CompilationUnit.java:527) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:772) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:438) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:281) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:572) at groovy.lang.GroovyShell.parse(GroovyShell.java:584) at groovy.lang.GroovyShell.parse(GroovyShell.java:564) at groovy.lang.GroovyShell.parse(GroovyShell.java:603) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:85) at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:56) at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.runSetupScript(WsdlTestCase.java:791) at com.eviware.soapui.impl.wsdl.panels.testcase.WsdlTestCaseDesktopPanel$SetupScriptGroovyEditorModel$1.actionPerformed(WsdlTestCaseDesktopPanel.java:519) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236) at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:231) at java.awt.Component.processMouseEvent(Component.java:5517) at javax.swing.JComponent.processMouseEvent(JComponent.java:3135) at java.awt.Component.processEvent(Component.java:5282) at java.awt.Container.processEvent(Container.java:1966) at java.awt.Component.dispatchEventImpl(Component.java:3984) at java.awt.Container.dispatchEventImpl(Container.java:2024) at java.awt.Component.dispatchEvent(Component.java:3819) at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822) at java.awt.Container.dispatchEventImpl(Container.java:2010) at java.awt.Window.dispatchEventImpl(Window.java:1791) at java.awt.Component.dispatchEvent(Component.java:3819) at java.awt.EventQueue.dispatchEvent(EventQueue.java:463) at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242) at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149) at java.awt.EventDispatchThread.run(EventDispatchThread.java:110) 1 error

1 Reply

  • Joe_DuBois's avatar
    Joe_DuBois
    Occasional Contributor
    Ok, it looks like what I had to do was restart SoapUI after I moved the JAR into the directory /bin/ext/

    So now I am not getting the error, but not getting any out. I will work on it a bit more, but looks promising.