<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Unable to use Apache POI - getting SchemaTypeLoaderException</title><link>https://answers.axonivy.com/questions/2179/unable-to-use-apache-poi-getting-schematypeloaderexception</link><description>&lt;p&gt;I'm trying to use Apache POI (3.10 or 3.15) with XpertIvy Designer v5.0.18 and I'm getting the following exception:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SchemaTypeLoaderException: XML-BEANS compiled schema: Incompatible minor version - expecting up to 23, got 24 (schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707.index) - code 3
java.lang.reflect.InvocationTargetException
RuntimeException: Could not instantiate SchemaTypeSystemImpl (java.lang.reflect.InvocationTargetException): is the version of xbean.jar correct?
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I saw a few older threads (&lt;a href="http://answers.axonivy.com/questions/511/poi-conflicted-xmlbeans-jars"&gt;POI conflicted xmlbeans.jar&lt;/a&gt; [2014] or &lt;a href="http://answers.axonivy.com/questions/1225/what-is-axis-lib-used-for"&gt;what is axis lib used for&lt;/a&gt; [2015]) regarding this issue.&lt;/p&gt;
&lt;p&gt;Is it really true that you &lt;strong&gt;still have to hack&lt;/strong&gt; the designer plugins folder and some server folder too??? &lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/2179/unable-to-use-apache-poi-getting-schematypeloaderexception" rel="self"></atom:link><language>en</language><lastBuildDate>Fri, 18 Nov 2016 15:11:36 -0500</lastBuildDate><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/2179/unable-to-use-apache-poi-getting-schematypeloaderexception/2200</link><description>&lt;p&gt;You could try to work around the problem by setting a ThreadContextClassloader in the area where you access POI code. &lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ClassLoader oldTcl = Thread.currentThread().getContextClassLoader();
try
{
  Thread.currentThread().setContextClassLoader(APoiClass.class.getClassLoader());
  // ANY POI INVOKER CODE
}
finally
{
  Thread.currentThread().setContextClassLoader(oldTcl);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Maybe this makes engine and designer hacks obsolete.&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Fri, 18 Nov 2016 15:11:36 -0500</pubDate><guid>https://answers.axonivy.com/questions/2179/unable-to-use-apache-poi-getting-schematypeloaderexception/2200</guid></item><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/2179/unable-to-use-apache-poi-getting-schematypeloaderexception/2180</link><description>&lt;p&gt;In short: The hack is no longer required. Since 6.6.1 POI can be used in a project without any library conflicts at runtime.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Axon.ivy 6.6.1 and younger&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;These kinds of JAR hell issues are gone from 6.6.1 upwards. &lt;/p&gt;
&lt;p&gt;In the &lt;strong&gt;Designer&lt;/strong&gt; many libraries were removed from the Axon.ivy Classpath container. Practically this means that &lt;code&gt;Webservice Process (CXF)&lt;/code&gt; and &lt;code&gt;Webservice Call (AXIS2)&lt;/code&gt; libraries are no longer on the classpath of the project. And as xmlbeans is a dependency of CXF, the conflict with POI is gone.
These old libraries can be added to classpath manually in the preferences, if anyone used them to patch AXIS stubs or by accident. &lt;a href="http://developer.axonivy.com/doc/latest/DesignerGuideHtml/ivy.processmodeling.html#ivy.project.preferences.java"&gt;http://developer.axonivy.com/doc/latest/DesignerGuideHtml/ivy.processmodeling.html#ivy.project.preferences.java&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The &lt;strong&gt;Engine&lt;/strong&gt; is now also delivered as OSGI version. This means that the proper ClassLoader isolation per Bundle behaves as it does in the Designer. So a huge runtime behavior difference is gone since 6.6.1. 
The OSGI Engine will become the default version of the Engine. We do not plan to support the OS specific packages any longer due its classloading shortcomings. But for a short time we still release the alternative packages that can be used if you face migration issues.&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;&lt;strong&gt;Axon.ivy 6.5.0 and older&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The ugly workaround is still required. &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Designer: manually patch the JAR in
   the plugins directory.  &lt;/li&gt;
&lt;li&gt;Engine:
   rename the
   /lib/shared/xmlbeans_2.4.0.jar to
   somethink like
   xmlbeans_2.4.0.jar.deactivated&lt;/li&gt;
&lt;/ul&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Mon, 14 Nov 2016 08:52:28 -0500</pubDate><guid>https://answers.axonivy.com/questions/2179/unable-to-use-apache-poi-getting-schematypeloaderexception/2180</guid></item></channel></rss>