Forum Discussion

alibaba82's avatar
alibaba82
Super Contributor
13 years ago

soapUI errors on groovy step

I have tried all kinds of versions of soapUI pro now and it seems like soapui has a very nasty bug. I'm surprised no one has seen this

I am seeing this on
soapUI Pro 4.5.1, copyright (C) 2007-2012 smartbear.com http://www.soapui.org | http://smartbear.com Build [internal], Build Date 2012/06/27 14:05

I have a simple testcase which runs fine. As soon as a add a groovy teststep with a simple log.info("hello"), the testcase execution will fail. However running the groovy step by itself works fine.

TestCase failed [java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.log4j.Logger:java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.log4j.Logger], time taken = 3081


Thu Oct 25 10:15:52 PDT 2012:ERROR:Exception during Test Execution
java.lang.ClassCastException: java.lang.String cannot be cast to org.apache.log4j.Logger
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:134)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:238)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:147)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:42)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
  • RJanecek's avatar
    RJanecek
    Regular Contributor
    I think it is because you are doing something wrong. I can reproduce this error when in testCase I have this lane:

    context.setProperty("log","a")


    and then in groovy script you want to log hello.

    But you cant do this !!!

    because when you look source:

    Logger log = ( Logger )context.getProperty( "log" );

    you are rewriting logger