Forum Discussion

Cybele's avatar
Cybele
Occasional Contributor
13 years ago

Mock service: NoClassDefFoundError for Apache Ivy

Hello,

I've created a mock webservice which includes a Groovy script that is fired as an AfterRequest event.

When I try and access the mock service from a browser, I get the following error:

ERROR:com.eviware.soapui.impl.wsdl.mock.DispatchException: java.lang.NoClassDefFoundError: org/apache/ivy/core/settings/IvySettings

Whilst we are using Apache Ivy as part of our development, I have checked the mock service project file and cannot find any reference to it in there. As such, I am stumped as to what the issue is.

Thanks in advance for any advice.

5 Replies

  • Cybele's avatar
    Cybele
    Occasional Contributor
    The issue is to do with the installation of the groovy-wslite library, which I'm trying to use in order to instantiate a SoapClient object.

    If I include the following at the top of the script:

    @Grab(group='com.github.groovy-wslite', module='groovy-wslite', version='0.7.1')


    ... I get the following error:

    java.lang.NoClassDefFoundError: org/apache/ivy/core/settings/IvySettings


    If I remove it from the script, I get the following error:

    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script6.groovy: 23: unable to resolve class SOAPClient @ line 23, column 18.
    def client = new SOAPClient(clientURL)
    ^
    org.codehaus.groovy.syntax.SyntaxException: unable to resolve class SOAPClient @ line 23, column 18.


    Can anyone indicate how I install the groovy-wslite library, please?
  • Cybele's avatar
    Cybele
    Occasional Contributor
    I have downloaded the groovy-wslite jar and added it to SoapUI's bin/ext directory.
  • Just curious if there was a remedy to this issue? i'm facing a simular one while trying to intregrate gMongo

    Groovy Code

    @Grab(group='com.mongo', module='gmongo', version='1.0')
    import com.gmongo.GMongo

    def mongo = new GMongo("db", 27017)
    def db = mongo.getDB('rtb')

    assert db['mongo'] instanceof com.mongodb.DBCollection


    Exception

    Fri May 10 14:03:41 PDT 2013:ERROR:java.lang.NoClassDefFoundError: org/apache/ivy/core/settings/IvySettings
    java.lang.NoClassDefFoundError: org/apache/ivy/core/settings/IvySettings
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2436)
    at java.lang.Class.getDeclaredMethods(Class.java:1793)
    at org.codehaus.groovy.reflection.CachedClass$3$1.run(CachedClass.java:84)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:81)
    at org.codehaus.groovy.reflection.CachedClass$3.initValue(CachedClass.java:79)
    at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:46)
    at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:33)
    at org.codehaus.groovy.reflection.CachedClass.getMethods(CachedClass.java:250)
    at groovy.lang.MetaClassImpl.populateMethods(MetaClassImpl.java:340)
    at groovy.lang.MetaClassImpl.fillMethodIndex(MetaClassImpl.java:290)
    at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:2917)
    at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:166)
    at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:182)
    at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:242)
    at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:751)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.initMetaClass(ScriptBytecodeAdapter.java:777)
    at groovy.grape.GrapeIvy.$getStaticMetaClass(GrapeIvy.groovy)
    at groovy.grape.GrapeIvy.<init>(GrapeIvy.groovy:67)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at java.lang.Class.newInstance0(Class.java:357)
    at java.lang.Class.newInstance(Class.java:310)
    at groovy.grape.Grape.getInstance(Grape.java:101)
    at groovy.grape.Grape.grab(Grape.java:136)
    at groovy.grape.GrabAnnotationTransformation.visit(GrabAnnotationTransformation.java:282)
    at org.codehaus.groovy.transform.ASTTransformationVisitor$3.call(ASTTransformationVisitor.java:302)
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:839)
    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:544)
    at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:520)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:497)
    at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:306)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:287)
    at groovy.lang.GroovyShell.parseClass(GroovyShell.java:731)
    at groovy.lang.GroovyShell.parse(GroovyShell.java:743)
    at groovy.lang.GroovyShell.parse(GroovyShell.java:770)
    at groovy.lang.GroovyShell.parse(GroovyShell.java:761)
    at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.compile(SoapUIGroovyScriptEngine.java:148)
    at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:93)
    at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SourceFile:89)
    at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:149)
    at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:274)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
    at java.lang.Thread.run(Thread.java:680)
    Caused by: java.lang.ClassNotFoundException: org.apache.ivy.core.settings.IvySettings
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    ... 48 more
  • I don't think there's much we can do about this one. It may have to be
    a wont-fix.