title: XML-BEANS compiled schema: Could not locate compiled schema resource schemaorg_apache_xmlbeans/system/sE130CAA0A01A7CDE5A2B4FEB8B311707/index.xsb
body: <p>I am writing an aplication to export data to an Excel sheet.</p>
  
  <p>I wont to use the XSSFWorkbook class because my Excel exceeds the limit of 255 column of HSSFWorkbook class.</p>
  
  <p>I downloaded the Apache POI libraries and I included the folowing libraries to my proyect:
  - poi-3.9.jar
  - poi-excelant-3.9.jar
  - poi-ooxml-3.9.jar
  - poi-ooxml-schemas-3.9.jar
  - poi-scratchpad-3.9.jar
  - dom4j-1.6.1.jar
  - stax-api-1.0.1.jar
  - xmlbeans-2.3.0.jar</p>
  
  <p>When I export the data to get the Excel sheet I get this runtime error:</p>
  
  <pre><code>java.lang.ExceptionInInitializerError
      at sun.misc.Unsafe.ensureClassInitialized(Native Method)
      at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25)
      at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
      at java.lang.reflect.Field.acquireFieldAccessor(Field.java:918)
      at java.lang.reflect.Field.getFieldAccessor(Field.java:899)
      Truncated. see log file for complete stacktrace
  Caused By: java.lang.RuntimeException: Could not instantiate SchemaTypeSystemImpl (java.lang.reflect.InvocationTargetException): is the version of xbean.jar correct?
      at schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707.TypeSystemHolder.loadTypeSystem(Unknown Source)
      at schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707.TypeSystemHolder.&lt;clinit&gt;(Unknown Source)
      at sun.misc.Unsafe.ensureClassInitialized(Native Method)
      at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25)
      at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
      Truncated. see log file for complete stacktrace
  Caused By: java.lang.reflect.InvocationTargetException
      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 schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707.TypeSystemHolder.loadTypeSystem(Unknown Source)
      Truncated. see log file for complete stacktrace
  Caused By: org.apache.xmlbeans.SchemaTypeLoaderException: XML-BEANS compiled schema: Could not locate compiled schema resource schemaorg_apache_xmlbeans/system/sE130CAA0A01A7CDE5A2B4FEB8B311707/index.xsb (schemaorg_apache_xmlbeans.system.sE130CAA0A01A7CDE5A2B4FEB8B311707.index) - code 0
      at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl$XsbReader.&lt;init&gt;(SchemaTypeSystemImpl.java:1519)
      at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.initFromHeader(SchemaTypeSystemImpl.java:273)
      at org.apache.xmlbeans.impl.schema.SchemaTypeSystemImpl.&lt;init&gt;(SchemaTypeSystemImpl.java:185)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
      Truncated. see log file for complete stacktrace
  </code></pre>
  
  <p>I read in a post that cant be because of the version of xbean-xx.jar and I notice that I don't have this library, I included in my project the version xbean-2.3.jar and has not change anything.</p>
  
  <p>I read in another post of stackoverflow other solution: <a href="https://stackoverflow.com/questions/4305231/xmlbeans-could-not-locate-schema-resource-when-repacking-xml-beans-jar-into-my-o">xmlbeans could not locate schema resource when repacking xml beans jar into my own jar</a> . I don't know if I understood the solution correctly but the file /schemaorg_apache_xmlbeans/system/sE130CAA0A01A7CDE5A2B4FEB8B311707/index.xsb is in the jar poi-ooxml-schemas-3.9.jar so I figured that this is not my problem.</p>
  
  <p>Can anyone help me please? thanks. </p>