# java.lang.NoClassDefFoundError with Apache POI

**URL:** <https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110>\
**Category:** ReadyAPI\
**Tags:** readyapi, api, migrated\
**Created:** [January 24, 2018, 2:30am UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110 "2018-01-24T02:30:04Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 24, 2018, 2:30am UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110/1 "2018-01-24T02:30:04Z")

</div>

> Originally posted by **lcordy** on January 23, 2018

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](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

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 24, 2018, 4:40am UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110/2 "2018-01-24T04:40:27Z")

</div>

> Originally posted by **nmrao** on January 23, 2018

Have you restarted the tool after copying the jar files?

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 24, 2018, 5:26am UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110/3 "2018-01-24T05:26:55Z")

</div>

> Originally posted by **lcordy** on January 23, 2018

Yep, restarted. Using Poi 3.17 by the way.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 24, 2018, 6:16am UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110/4 "2018-01-24T06:16:53Z")

</div>

> Originally posted by **nmrao** on January 23, 2018

Thanks for clarifying. Would you please list all the files under /bin/ext directory?

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [January 24, 2018, 8:17pm UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110/5 "2018-01-24T20:17:31Z")

</div>

> Originally posted by **lcordy** on January 24, 2018

Files in bin/ext attached.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [July 23, 2018, 4:20pm UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110/6 "2018-07-23T16:20:55Z")

</div>

> Originally posted by **ayonchoudhury** on July 23, 2018

This worked for me, incase you still have the issue.

I downloaded the ooxml-schemas-1.3.jar file and placed it into bin/ext along with all the other poi jars.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [September 25, 2018, 12:16pm UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110/7 "2018-09-25T12:16:33Z")

</div>

> Originally posted by **ps4545** on September 25, 2018

def fs = new FileInputStream(“D:/sample.xlsx”)  
def wb = new XSSFWorkbook(fs)  
def ws = wb.getSheet(“Sheet1”)

Executing …Groovy script

**Which dependency is missing? - got this error SOAP UI 5.4 An error occurred [org/apache/commons/compress/archivers/zip/ZipFile], see error log for details**

**Can any one help please!**

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [November 19, 2018, 8:11pm UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110/8 "2018-11-19T20:11:10Z")

</div>

> Originally posted by **Jason1** on November 19, 2018

I downloaded the ooxml-schemas-1.3.jar file and placed it into bin/ext along with all the other poi jars.

But I still have the same problem : CTExtensionList error

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [November 30, 2018, 4:49pm UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110/9 "2018-11-30T16:49:26Z")

</div>

> Originally posted by **JoanLi** on November 30, 2018

I meet the same problem. When I use " def wb= new XSSFWorkbook(file)“, the error prompt which is the same as above pops up. When I use " def wb= WorkbookFactory.reate(file);”, there is no response. I mean there is no error popping up or log printing. In fact, the same script runs properly in my groovy IDE. I am not sure if the soapui 5.4 can not use the poi 4.0.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [December 10, 2018, 8:48pm UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110/10 "2018-12-10T20:48:17Z")

</div>

> Originally posted by **Camerlock** on December 10, 2018

My aim is to read and write and xlsx file from Groovy Test Step.

For xls files everything worked fine.

Trying upgrading to poi vers. \> 3.12 is not that helpful because on ReadyAPI or SOAPUI Pro version this will break Test Step Datasource with Excel for loading data. The Test Step is then failed.

I then rolback and have to face the multiple issues described here. I was unsuccessful everytime.

After trying all available API in POI and also trying using the additional OOXML Schemas lib I must admitted too: Handling / updating xlsx files in Groovy step is not currently possible.

ERROR: An error occurred [org/openxmlformats/schemas/spreadsheetml/x2006/main/CTExtensionList], see error log for details

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [July 12, 2019, 9:50am UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110/11 "2019-07-12T09:50:36Z")

</div>

> Originally posted by **mityfai** on July 12, 2019

I’ve been struggling with this issue for a while and trying it again with every new Release and hoping it’s been solved. By the current release, unfortunately not!

Anonymous: Ist there any hope that this well known issue will be solved:

can ReadyAPI be inproved to handle xlsx file in groovy script or should will exclude that combination from test cases implementation at all.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [July 16, 2019, 12:39pm UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110/12 "2019-07-16T12:39:00Z")

</div>

> Originally posted by **Nastya\_Khovrina** on July 16, 2019

Please try the solution from this article:

[https://smartbear-cc.force.com/portal/KbArticleViewer?name=Example-of-using-third-party-Java-libraries-in-Groovy-script-reading-from-Excel-file-using-Apache-POI&sp=all](https://smartbear-cc.force.com/portal/KbArticleViewer?name=Example-of-using-third-party-Java-libraries-in-Groovy-script-reading-from-Excel-file-using-Apache-POI&sp=all)

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [August 19, 2019, 2:48am UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110/13 "2019-08-19T02:48:50Z")

</div>

> Originally posted by **bompeacock** on August 18, 2019

I am also stuck with this issue, any pro or Nastya\_Khovrina have any ideas, please tell me,  
But my solution is changing .xlsx to xls, it does work. But I want to use .xlsx instead of .xls file.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [August 22, 2019, 2:56pm UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110/14 "2019-08-22T14:56:54Z")

</div>

> Originally posted by **Nastya\_Khovrina** on August 22, 2019

Hi bompeacock.,

Do you use a script from this KB article: [https://smartbear-cc.force.com/portal/KbArticleViewer?name=Example-of-using-third-party-Java-libraries-in-Groovy-script-reading-from-Excel-file-using-Apache-POI&sp=all](https://smartbear-cc.force.com/portal/KbArticleViewer?name=Example-of-using-third-party-Java-libraries-in-Groovy-script-reading-from-Excel-file-using-Apache-POI&sp=all)?

It’s working fine for me with .xslx file with ReadyAPI 2.8.0 and Apache POI 4.1.0.

What versions do you use?

Do you have the exact same error in the log as the error from the first post?

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [August 22, 2019, 9:02pm UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110/15 "2019-08-22T21:02:11Z")

</div>

> Originally posted by **ayonchoudhury** on August 22, 2019

Apart from the poi jars, download the jar

ooxml-schemas-1.3.jar

Place this jar in your SmartBear\SoapUI-5.4.0\bin\ext

and restart SOAP UI. Should work now!!

You can find more on my blog - [https://testbuster309148348.wordpress.com/blog/](https://testbuster309148348.wordpress.com/blog/)

Let me know if this helps

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [August 23, 2019, 3:22am UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110/16 "2019-08-23T03:22:40Z")

</div>

> Originally posted by **bompeacock** on August 22, 2019

Hi Nastya\_Khovrina ,  
I tried, and 4.0.1 throw an another Exception and **all DataSource steps (using excel file) were broken**with the same error message as below:

 ![Screen Shot 2019-08-23 at 10.18.14 AM.png](https://canada1.discourse-cdn.com/flex049/uploads/smartbear_prod/original/1X/6d0d9d7a9130cd4885e7e5dc20e4ce3128080064.png)

It still only works for **.xls**.

Why don’t Ready API 2.8.0 Pro install lib POI 4.0.1 or working exactly version already instead of 3.12 that somtime not working with .xlsx? Because when I release script Ready API for my customer I can not decide to choose which version for POI lib.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [August 23, 2019, 12:28pm UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110/17 "2019-08-23T12:28:16Z")

</div>

> Originally posted by **JustinM89** on August 23, 2019

Just a heads up, in %READYAPI\_HOME%/lib, there is poi-ooxml-schemas-3.12.jar – if you are adding a different version to bin/ext, both of these JARs are probably getting added to the classpath and could cause issues.

I ran into this same issue with bouncy-castle (specifically bcprov-jdk) – we needed this dependency to encrypt passwords, so we added it into bin/ext, but we kept getting this strange Arrays.concatenate([B][B][B]) error. After some poking around we realized that there was another version of this same JAR in lib/ and it seemed that when we were calling our encrypt method, it was using the method from this JAR, and not the one we had placed in bin/ext.

We simply replaced the version of bouncy-castle in the lib directory with the same version we had in bin/ext and this resolved the issue – however, I’m pretty sure doing this has the potential to break something in SoapUI if it is relying on a class from a specific version of a JAR and you go and swap it out with a different version, so do this at your own risk.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [August 26, 2019, 7:49am UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110/18 "2019-08-26T07:49:45Z")

</div>

> Originally posted by **Nastya\_Khovrina** on August 26, 2019

bompeacock,

Please try the solutions from here:

[https://stackoverflow.com/questions/52381075/apache-poi-java-lang-noclassdeffounderror-org-apache-commons-compress-archivers](https://stackoverflow.com/questions/52381075/apache-poi-java-lang-noclassdeffounderror-org-apache-commons-compress-archivers)

But, Justin is right, using libraries versions which differ from versions in ReadyAPI installation may cause issues.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [August 26, 2019, 8:00am UTC](https://community.smartbear.com/t/java-lang-noclassdeffounderror-with-apache-poi/110/19 "2019-08-26T08:00:41Z")

</div>

> Originally posted by **bompeacock** on August 26, 2019

Nastya\_Khovrina ,

Your answer is not resolving my issue. Thank, maybe I should still use POI ver 3.12 and **.xls** files.
