Forum Discussion

skillsoft's avatar
skillsoft
Frequent Contributor
14 years ago

[Resolved] java.lang.NoClassDefFoundError in 3.6.1 and above

Hi,

I'm getting the following error in 3.6.1 and above of soapui. 3.6 and below work fine with identical code and ant.jar file in bin\ext on both installations:

Thu Jun 23 13:20:52 EDT 2011:ERROR:java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException
java.lang.NoClassDefFoundError: org/apache/tools/ant/BuildException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at Script2.class$(Script2.groovy)
at Script2.$get$$class$groovy$util$AntBuilder(Script2.groovy)
at Script2.run(Script2.groovy:25)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:96)
at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SourceFile:88)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:148)
at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:274)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.apache.tools.ant.BuildException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
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)
... 12 more

Code is below. Offending line bolded:

def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
import org.apache.tools.ant.*


//define variables

//this section needs to be changed depending on what the email distribution list is suppose to be from/to:
def mailserver="xxx.xxx.com"
def distributionerrorlist=xxx@xxx.com'
def distributiontolist='xxx@xxx.com'
def distributioncclist='xxx@xxx.com'

def fromemail='xxx@xxx.com'
def fromname='xxx@xxx.com'

def PassFail="pass"
def results = testRunner.results
def antmail = new AntBuilder()

How can I make this work again? We are currently stuck on 3.6 because of this issue.

Thanks,

Mary