Forum Discussion

lcordy's avatar
lcordy
Occasional Contributor
7 years ago

java.lang.NoClassDefFoundError with Apache POI

I was not getting this error in SoapUI 5.3 free version, exactly the same code reading Excel in ReadyAPI throws the error below. I copied the same jar files from bin/ext folder from SoapUI 5.3 to ReadyAPI. I have tried the suggestion at https://poi.apache.org/faq.html#faq-N10025 and placed ooxml-schemas-1.3.jar in my bin/ext folder as well, to no avail.

 

Wed Jan 24 15:24:33 NZDT 2018:ERROR:java.lang.NoClassDefFoundError: org/openxmlformats/schemas/spreadsheetml/x2006/main/CTExtensionList
java.lang.NoClassDefFoundError: org/openxmlformats/schemas/spreadsheetml/x2006/main/CTExtensionList
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.privateGetPublicMethods(Unknown Source)
at java.lang.Class.getMethods(Unknown Source)
at org.codehaus.groovy.reflection.stdclasses.CachedSAMClass.getSAMMethod(CachedSAMClass.java:164)
at org.codehaus.groovy.reflection.ClassInfo.isSAM(ClassInfo.java:359)
at org.codehaus.groovy.reflection.ClassInfo.createCachedClass(ClassInfo.java:349)
at org.codehaus.groovy.reflection.ClassInfo.access$700(ClassInfo.java:41)
at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:497)
at org.codehaus.groovy.reflection.ClassInfo$LazyCachedClassRef.initValue(ClassInfo.java:488)
at org.codehaus.groovy.util.LazyReference.getLocked(LazyReference.java:49)
at org.codehaus.groovy.util.LazyReference.get(LazyReference.java:36)
at org.codehaus.groovy.reflection.ClassInfo.getCachedClass(ClassInfo.java:111)
at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:110)
at org.codehaus.groovy.reflection.ParameterTypes.getParametersTypes0(ParameterTypes.java:81)
at org.codehaus.groovy.reflection.ParameterTypes.getParameterTypes(ParameterTypes.java:67)
at org.codehaus.groovy.reflection.CachedMethod.compareToMethod(CachedMethod.java:186)
at org.codehaus.groovy.reflection.CachedMethod.compareTo(CachedMethod.java:142)
at org.codehaus.groovy.reflection.CachedMethod$MyComparator.compare(CachedMethod.java:315)
at java.util.Arrays.binarySearch0(Unknown Source)
at java.util.Arrays.binarySearch(Unknown Source)
at org.codehaus.groovy.reflection.CachedMethod.find(CachedMethod.java:68)
at groovy.lang.MetaClassImpl.applyPropertyDescriptors(MetaClassImpl.java:2522)
at groovy.lang.MetaClassImpl.setupProperties(MetaClassImpl.java:2261)
at groovy.lang.MetaClassImpl.addProperties(MetaClassImpl.java:3302)
at groovy.lang.MetaClassImpl.initialize(MetaClassImpl.java:3266)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(ClassInfo.java:254)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:285)
at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(ClassInfo.java:295)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.getMetaClass(MetaClassRegistryImpl.java:261)
at org.codehaus.groovy.runtime.InvokerHelper.getMetaClass(InvokerHelper.java:871)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createPojoSite(CallSiteArray.java:125)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:166)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
at Script3.run(Script3.groovy:38)
at com.eviware.soapui.support.scripting.groovy.SoapUIGroovyScriptEngine.run(SoapUIGroovyScriptEngine.java:98)
at com.eviware.soapui.support.scripting.groovy.SoapUIProGroovyScriptEngineFactory$SoapUIProGroovyScriptEngine.run(SoapUIProGroovyScriptEngineFactory.java:82)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlGroovyScriptTestStep.run(WsdlGroovyScriptTestStep.java:156)
at com.eviware.soapui.impl.wsdl.panels.teststeps.GroovyScriptStepDesktopPanel$RunAction$1.run(GroovyScriptStepDesktopPanel.java:316)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: org.openxmlformats.schemas.spreadsheetml.x2006.main.CTExtensionList
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)
... 44 more

  • nmrao's avatar
    nmrao
    Champion Level 3
    Have you restarted the tool after copying the jar files?
    • lcordy's avatar
      lcordy
      Occasional Contributor
      Yep, restarted. Using Poi 3.17 by the way.
      • nmrao's avatar
        nmrao
        Champion Level 3
        Thanks for clarifying. Would you please list all the files under /bin/ext directory?