Forum Discussion

skillsoft's avatar
skillsoft
Frequent Contributor
15 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

12 Replies

  • skillsoft's avatar
    skillsoft
    Frequent Contributor
    This was resolved via email. ant.jar and ant-launcher.jar had to go into the lib directory and removed from the bin\ext directory.

    Mary
  • skillsoft's avatar
    skillsoft
    Frequent Contributor
    Hi,

    This issue seems to be happening in 4.5.1 with the same project regardless of where I put the ant.jar and antlauncher.jar (bin or bin/ext or both). The error is happening at the exact same place as before. Where do these 2 jar files need to live in for this to work? This particular project was working fine in 3.6 if the files are in the bin/ext dir and 3.6.1 if the files are in the bin dir. I was forced to upgrade due to renewing licenses (jumped from 3.6 to 4.5.1). Any ideas?

    Thanks,

    Mary