Monday, October 1, 2018

Extract Text From PPTX using POI - java.lang.ArrayStoreException

I had been trying to extract textual content from PPTX file using Apache POI. Then I struggled with following exception.
 java.lang.ArrayStoreException 
  at java.lang.System.arraycopy(Native Method) 
  at org.apache.xmlbeans.impl.values.XmlObjectBase._typedArray(XmlObjectBase.java:409) 
  at org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.java:457) 
  at org.apache.xmlbeans.impl.values.XmlObjectBase.selectPath(XmlObjectBase.java:415) 
  at org.apache.poi.xslf.usermodel.XSLFDrawing.<init>(XSLFDrawing.java:44) 
  at org.apache.poi.xslf.usermodel.XSLFSheet.initDrawingAndShapes(XSLFSheet.java:170) 
  at org.apache.poi.xslf.usermodel.XSLFSheet.getShapes(XSLFSheet.java:157) 
      

Solution

Well the problem turns out to be version of library I had been using.
I was running xmlbeans 2.3. Upgrading to 2.6 resolves the issue.







No comments:

Post a Comment