Forum Discussion

jagansampy's avatar
14 years ago

groovy.lang.MissingMethodException: No signature of method

Hi,

We are running test cases manually and as well by scripts on a Hudson build environment using Maven. We are trying to access a Oracle database table using Groovy Script to check the status of the order processed by the service being tested.

Here is the script we use to access the DB

------- Groovy Script Begin ----------
import groovy.sql.Sql;
com.eviware.soapui.support.GroovyUtils.registerJdbcDriver("oracle.jdbc.driver.OracleDriver")

def dBConnection = context.expand('${#TestCase#DBConnection}')
context.sql = Sql.newInstance(dBConnection, "oracle.jdbc.driver.OracleDriver")
------- Groovy Script End ----------

It works to a treat when we run the test case from the SOAPUI tool manually, but fails with the following error when the test case is run inside the Hudson environment with Maven. As such we have only the SOAPUI plug-in installed on the build machine. Can someone helps me to resolve this problem?

groovy.lang.MissingMethodException: No signature of method: static com.eviware.soapui.support.GroovyUtils.registerJdbcDriver() is applicable for argument types: (java.lang.String) values: [oracle.jdbc.driver.OracleDriver]
at groovy.lang.MetaClassImpl.invokeStaticMissingMethod(MetaClassImpl.java:1357)
at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:1343)
at org.codehaus.groovy.runtime.callsite.StaticMetaClassSite.call(StaticMetaClassSite.java:50)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:40)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
at Script1.run(Script1.groovy:2)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:93)
at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SourceFile:87)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCase.runSetupScript(WsdlTestCase.java:863)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.internalRun(WsdlTestCaseRunner.java:96)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.internalRun(WsdlTestCaseRunner.java:39)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:139)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
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:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)

Regards,
Sampath
  • Username1's avatar
    Username1
    New Contributor
    ------- Groovy Script Begin ----------
    import groovy.sql.Sql;
    import com.eviware.soapui.support.GroovyUtils;
    def groovyUtils = new GroovyUtils();
    groovyUtils.registerJdbcDriver("oracle.jdbc.driver.OracleDriver");

    def dBConnection = context.expand('${#TestCase#DBConnection}')
    context.sql = Sql.newInstance(dBConnection, "oracle.jdbc.driver.OracleDriver")
    ------- Groovy Script End ----------
  • Username1's avatar
    Username1
    New Contributor
    Register JDBC driver ONLY in Project -> Setup Script. This should resolve issue.