ArrayStoreException when running getShapes on slide of XSLFSheet

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ArrayStoreException when running getShapes on slide of XSLFSheet

Branden Visser
Hi all,

We process quite a few files out in the wild. Currently, this is by
far the most common error we see when we handle office documents (Word
+ PowerPoint):

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)
        ...

Unfortunately, I don't have any sample documents at this time that
exhibit the issue to send over as most of it is client data. Looks
like it's coming deep from within XMLBeans.

The System.arraycopy is occurring on an XMLObject[] that is mixed with
2 schema types of elements:

 * T=CT_NonVisualDrawingProps@http://schemas.openxmlformats.org/drawingml/2006/main
 * N=

Whereas it was expecting all NonVisualDrawingProps elements. So,
likely an unexpected collection of items, in the crazy world of XML
files that is office documents.

Has anyone seen this before? Should POI be defending against this case
any better?

Thanks,
Branden

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ArrayStoreException when running getShapes on slide of XSLFSheet

pj.fanning
Can I clarify? This issue occurs consistently for specific input files or is it an intermittent issue?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ArrayStoreException when running getShapes on slide of XSLFSheet

Robert Cochran
In reply to this post by Branden Visser
Hi!

What version of POI are you using? Can you share your source code which exhibits the error? Can you put together a PowerPoint document that when processed by your code will trigger the error? I think you need to share your source code and at least one test document to show a repeatable error. A stack trace as you give below is not enough.

Thanks a ton

Bob Cochran

> On Jul 27, 2017, at 12:21 PM, Branden Visser <[hidden email]> wrote:
>
> Hi all,
>
> We process quite a few files out in the wild. Currently, this is by
> far the most common error we see when we handle office documents (Word
> + PowerPoint):
>
> 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)
>        ...
>
> Unfortunately, I don't have any sample documents at this time that
> exhibit the issue to send over as most of it is client data. Looks
> like it's coming deep from within XMLBeans.
>
> The System.arraycopy is occurring on an XMLObject[] that is mixed with
> 2 schema types of elements:
>
> * T=CT_NonVisualDrawingProps@http://schemas.openxmlformats.org/drawingml/2006/main
> * N=
>
> Whereas it was expecting all NonVisualDrawingProps elements. So,
> likely an unexpected collection of items, in the crazy world of XML
> files that is office documents.
>
> Has anyone seen this before? Should POI be defending against this case
> any better?
>
> Thanks,
> Branden
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ArrayStoreException when running getShapes on slide of XSLFSheet

kiwiwings
In reply to this post by Branden Visser
Hi Branden,

can you send me a file? ... I won't put it in our repo.

Andi



signature.asc (495 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: ArrayStoreException when running getShapes on slide of XSLFSheet

Branden Visser
Thanks all for your replies. I've found the issue was that I was
running xmlbeans 2.3. Upgrading to 2.6 resolves the issue.

Best,
Branden

On Fri, Jul 28, 2017 at 6:26 AM, Andreas Beeker <[hidden email]> wrote:
> Hi Branden,
>
> can you send me a file? ... I won't put it in our repo.
>
> Andi
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...