Free Support Forum - aspose.com

Getting an java.lang.ArrayIndexOutOfBoundsException when calling Document.getPageCount()

Hi,

When we call Document.getPageCount() just after loading the document we’re getting an java.lang.ArrayIndexOutOfBoundsException wrapped in a java.lang.RuntimeException. It seems to originate from a chart in the document that was originally embedded from Excel. I will attach an example document here.

Lorem ipsum dolor sit amet.docx (18.3 KB)

Environment
We’re using v21.4 and I can reproduce this on Mac and on Linux.

JVM
openjdk 11.0.11 2021-04-20
OpenJDK Runtime Environment AdoptOpenJDK-11.0.11+9 (build 11.0.11+9)
OpenJDK 64-Bit Server VM AdoptOpenJDK-11.0.11+9 (build 11.0.11+9, mixed mode)

Stack trace:

Caused by: java.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException: Index 4 out of bounds for length 4
    at com.aspose.words.zz4T.zzz (Unknown Source)
    at com.aspose.words.zz4T.zzZ (Unknown Source)
    at com.aspose.words.zz6V.zzZ (Unknown Source)
    at com.aspose.words.zz6V.zzZ (Unknown Source)
    at com.aspose.words.zzZEA.zzU (Unknown Source)
    at com.aspose.words.zzZEA.zzW (Unknown Source)
    at com.aspose.words.zzZEA.zzU (Unknown Source)
    at com.aspose.words.zzZEN.zzl (Unknown Source)
    at com.aspose.words.zzZEN.zzZ4v (Unknown Source)
    at com.aspose.words.zzZEM.getWidth (Unknown Source)
    at com.aspose.words.zzYN4.zz65 (Unknown Source)
    at com.aspose.words.zzYO1.zzYx (Unknown Source)
    at com.aspose.words.zzZDK.zzzi (Unknown Source)
    at com.aspose.words.zzZDK.zzW (Unknown Source)
    at com.aspose.words.zzZDK.zzUb (Unknown Source)
    at com.aspose.words.zzZDD.zzZ (Unknown Source)
    at com.aspose.words.zzZDD.zzN (Unknown Source)
    at com.aspose.words.zzZDO.zzF (Unknown Source)
    at com.aspose.words.zzZDM.zzz (Unknown Source)
    at com.aspose.words.zzZDM.zzW (Unknown Source)
    at com.aspose.words.zzZDM.zzX (Unknown Source)
    at com.aspose.words.zzVG.zzZ (Unknown Source)
    at com.aspose.words.zzVG.zzZ (Unknown Source)
    at com.aspose.words.zzYOL.zzYpI (Unknown Source)
    at com.aspose.words.zzYOL.zzY (Unknown Source)
    at com.aspose.words.zzYOL.zzZ (Unknown Source)
    at com.aspose.words.zzWY.zz8c (Unknown Source)
    at com.aspose.words.zzWY.zzW (Unknown Source)
    at com.aspose.words.zzWY.zzX (Unknown Source)
    at com.aspose.words.zzYYB.zzB (Unknown Source)
    at com.aspose.words.zzYYB.zzC (Unknown Source)
    at com.aspose.words.zzYYB.zzYFC (Unknown Source)
    at com.aspose.words.zzYYB.zzL (Unknown Source)
    at com.aspose.words.zzYXH.zzJ (Unknown Source)
    at com.aspose.words.zzYMM.zza (Unknown Source)
    at com.aspose.words.zz3P.zzJ (Unknown Source)
    at com.aspose.words.zz3Q.zzZxv (Unknown Source)
    at com.aspose.words.zzYYF.zzYFY (Unknown Source)
    at com.aspose.words.Document.updatePageLayout (Unknown Source)
    at com.aspose.words.Document.zzWa (Unknown Source)
    at com.aspose.words.Document.getPageCount (Unknown Source)
    at com.elsevier.dp.works.transformation.aspose.extractor.PageExtractor.extract (PageExtractor.java:30)
    at com.elsevier.dp.works.transformation.aspose.AsposeWorksTransformer.transform (AsposeWorksTransformer.java:97)
    at com.elsevier.dp.works.transformation.aspose.AsposeWorksTransformer.transform (AsposeWorksTransformer.java:56)
    at com.elsevier.dp.works.transformation.Main.main (Main.java:32)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
    at java.lang.Thread.run (Thread.java:829)
Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 4 out of bounds for length 4
    at com.aspose.words.zzHW.zzZU2 (Unknown Source)
    at com.aspose.words.zzHW.zzZTT (Unknown Source)
    at com.aspose.words.zzJ1.zzZ (Unknown Source)
    at com.aspose.words.zzGO.zzZ (Unknown Source)
    at com.aspose.words.zzGO.zzZ (Unknown Source)
    at com.aspose.words.zzGK.zzZQH (Unknown Source)
    at com.aspose.words.zzGK.zzZi (Unknown Source)
    at com.aspose.words.zzG7.zzZVj (Unknown Source)
    at com.aspose.words.zzG7.zzZ (Unknown Source)
    at com.aspose.words.zzGF.zzZ (Unknown Source)
    at com.aspose.words.zz4T.zzz (Unknown Source)
    at com.aspose.words.zz4T.zzZ (Unknown Source)
    at com.aspose.words.zz6V.zzZ (Unknown Source)
    at com.aspose.words.zz6V.zzZ (Unknown Source)
    at com.aspose.words.zzZEA.zzU (Unknown Source)
    at com.aspose.words.zzZEA.zzW (Unknown Source)
    at com.aspose.words.zzZEA.zzU (Unknown Source)
    at com.aspose.words.zzZEN.zzl (Unknown Source)
    at com.aspose.words.zzZEN.zzZ4v (Unknown Source)
    at com.aspose.words.zzZEM.getWidth (Unknown Source)
    at com.aspose.words.zzYN4.zz65 (Unknown Source)
    at com.aspose.words.zzYO1.zzYx (Unknown Source)
    at com.aspose.words.zzZDK.zzzi (Unknown Source)
    at com.aspose.words.zzZDK.zzW (Unknown Source)
    at com.aspose.words.zzZDK.zzUb (Unknown Source)
    at com.aspose.words.zzZDD.zzZ (Unknown Source)
    at com.aspose.words.zzZDD.zzN (Unknown Source)
    at com.aspose.words.zzZDO.zzF (Unknown Source)
    at com.aspose.words.zzZDM.zzz (Unknown Source)
    at com.aspose.words.zzZDM.zzW (Unknown Source)
    at com.aspose.words.zzZDM.zzX (Unknown Source)
    at com.aspose.words.zzVG.zzZ (Unknown Source)
    at com.aspose.words.zzVG.zzZ (Unknown Source)
    at com.aspose.words.zzYOL.zzYpI (Unknown Source)
    at com.aspose.words.zzYOL.zzY (Unknown Source)
    at com.aspose.words.zzYOL.zzZ (Unknown Source)
    at com.aspose.words.zzWY.zz8c (Unknown Source)
    at com.aspose.words.zzWY.zzW (Unknown Source)
    at com.aspose.words.zzWY.zzX (Unknown Source)
    at com.aspose.words.zzYYB.zzB (Unknown Source)
    at com.aspose.words.zzYYB.zzC (Unknown Source)
    at com.aspose.words.zzYYB.zzYFC (Unknown Source)
    at com.aspose.words.zzYYB.zzL (Unknown Source)
    at com.aspose.words.zzYXH.zzJ (Unknown Source)
    at com.aspose.words.zzYMM.zza (Unknown Source)
    at com.aspose.words.zz3P.zzJ (Unknown Source)
    at com.aspose.words.zz3Q.zzZxv (Unknown Source)
    at com.aspose.words.zzYYF.zzYFY (Unknown Source)
    at com.aspose.words.Document.updatePageLayout (Unknown Source)
    at com.aspose.words.Document.zzWa (Unknown Source)
    at com.aspose.words.Document.getPageCount (Unknown Source)
    at com.elsevier.dp.works.transformation.aspose.extractor.PageExtractor.extract (PageExtractor.java:30)
    at com.elsevier.dp.works.transformation.aspose.AsposeWorksTransformer.transform (AsposeWorksTransformer.java:97)
    at com.elsevier.dp.works.transformation.aspose.AsposeWorksTransformer.transform (AsposeWorksTransformer.java:56)
    at com.elsevier.dp.works.transformation.Main.main (Main.java:32)
    at org.codehaus.mojo.exec.ExecJavaMojo$1.run (ExecJavaMojo.java:254)
    at java.lang.Thread.run (Thread.java:829)

@arronhardenels

We have tested the scenario and have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-22213. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

1 Like