Intermittent ArgumentOutOfRangeException During the Presentation.save

Hi Aspose Team,

I am currently using Java 21 along with Aspose.Slides for Java version 25.6.

We are encountering an intermittent exception during the Presentation.save() method. Unfortunately, the issue is not consistently reproducible—it resolves itself after some time without any code changes. Below is the stack trace we captured during one such occurrence:

Blockquote
[“com.aspose.slides.Collections.Generic.List.removeAt(Unknown Source)”,“com.aspose.slides.Collections.Generic.List.removeItem(Unknown Source)”,“com.aspose.slides.internal.u3m.t2.r2(Unknown Source)”,“com.aspose.slides.internal.u3m.t2.x6(Unknown Source)”,“com.aspose.slides.internal.u3m.t2$x6.dispose(Unknown Source)”,“com.aspose.slides.internal.r3k.v4.close(Unknown Source)”,“com.aspose.slides.internal.r3k.v4.dispose(Unknown Source)”,“com.aspose.slides.internal.u3m.l9.g1(Unknown Source)”,“com.aspose.slides.internal.u3m.l9.dispose(Unknown Source)”,“com.aspose.slides.internal.u3m.l9.dispose(Unknown Source)”,“com.aspose.slides.internal.e8v.r2.dispose(Unknown Source)”,“com.aspose.slides.internal.r3k.v4.close(Unknown Source)”,“com.aspose.slides.internal.r3k.v4.dispose(Unknown Source)”,“com.aspose.slides.internal.u3m.c1.k2(Unknown Source)”,“com.aspose.slides.internal.u3m.c1.w1(Unknown Source)”,“com.aspose.slides.internal.u3m.o4.x6(Unknown Source)”,“com.aspose.slides.internal.u3m.o4.dispose(Unknown Source)”,“com.aspose.slides.internal.t4a.m8.w1(Unknown Source)”,“com.aspose.slides.internal.u3m.o4.x6(Unknown Source)”,“com.aspose.slides.internal.u3m.o4.dispose(Unknown Source)”,“com.aspose.slides.internal.l4b.f5.x6(Unknown Source)”,“com.aspose.slides.internal.u3m.b6.x6(Unknown Source)”,“com.aspose.slides.internal.o3t.r2.x6(Unknown Source)”,“com.aspose.slides.internal.o3t.x6.x6(Unknown Source)”,“com.aspose.slides.internal.u3m.j3.x6(Unknown Source)”,“com.aspose.slides.internal.u3m.x1.x6(Unknown Source)”,“com.aspose.slides.internal.u3m.x1.x6(Unknown Source)”,“com.aspose.slides.internal.u3m.x1.x6(Unknown Source)”,“com.aspose.slides.internal.u3m.t3.x6(Unknown Source)”,“com.aspose.slides.internal.u3m.f5.x6(Unknown Source)”,“com.aspose.slides.internal.x7o.w1.x6(Unknown Source)”,“com.aspose.slides.internal.x7o.w1.x6(Unknown Source)”,“com.aspose.slides.internal.h6f.m8.write(Unknown Source)”,“java.desktop/javax.imageio.ImageWriter.write(ImageWriter.java:595)”,“com.aspose.slides.internal.n2x.x6.x6(Unknown Source)”,“com.aspose.slides.internal.n2x.x6.r2(Unknown Source)”,“com.aspose.slides.internal.n2x.x6.x6(Unknown Source)”,“com.aspose.slides.internal.v3g.r2.x6(Unknown Source)”,“com.aspose.slides.internal.v3g.v4.x6(Unknown Source)”,“com.aspose.slides.internal.v3g.v4.x6(Unknown Source)”,“com.aspose.slides.internal.v3g.v4.x6(Unknown Source)”,“com.aspose.slides.g5r.x6(Unknown Source)”,“com.aspose.slides.g5r.x6(Unknown Source)”,“com.aspose.slides.g5r.x6(Unknown Source)”,“com.aspose.slides.Presentation.x6(Unknown Source)”,“com.aspose.slides.Presentation.x6(Unknown Source)”,“com.aspose.slides.Presentation.x6(Unknown Source)”,“com.aspose.slides.Presentation$1.x6(Unknown Source)”,“com.aspose.slides.internal.m2d.x6.x6(Unknown Source)”,“com.aspose.slides.internal.m2d.r2.x6(Unknown Source)”,“com.aspose.slides.Presentation.save(Unknown Source)”,“com.nielsen.discover.aspose.io.PresentationWrapper.save(PresentationWrapper.java:98)”,“com.nielsen.discover.story.export.SlideGenerator.saveDocument(SlideGenerator.java:305)”,“com.nielsen.discover.story.service.impl.StoryServiceImpl.getStoryDto(StoryServiceImpl.java:245)”,“com.nielsen.discover.story.service.DocumentWorker.createJob(DocumentWorker.java:242)”,“com.nielsen.discover.story.service.DocumentWorker.run(DocumentWorker.java:144)”,“java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)”,“java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)”,“java.base/java.lang.Thread.run(Thread.java:1583)”]
Blockquote

We would appreciate your guidance on the following:

  1. Is this a known issue with version 25.6?
  2. Are there any fixes or workarounds available?
  3. Is there a newer version that addresses this problem?

Additionally, please confirm if Aspose.Slides for Java 25.6 is fully compatible with Java 21. Based on your support forum, it appears that Java 21 is supported across Aspose Java APIs, but we would like to ensure there are no specific limitations for the Slides module. [forum.aspose.com]

Looking forward to your support and recommendations.

Best regards,
Manikandan Chinnasamy

@Mani.niq

Hello Manikandan,

Regarding the intermittent ArgumentOutOfRangeException you are encountering with the Presentation.save() method in Aspose.Slides for Java version 25.6, here are some insights:

  1. Known Issue: This exception can arise from various factors, including potential issues with the presentation file or the state of the objects being manipulated. While I cannot confirm if this is a known issue specific to version 25.6, I recommend checking the release notes or community forums for any similar reported issues.

  2. Fixes or Workarounds:

    • Verify that the presentation file is not corrupted and that all slides and elements are properly initialized before invoking the save() method.
    • If the issue persists, consider implementing error handling around the save() method to catch exceptions and log additional context, which may assist in diagnosing the problem.
  3. Newer Version: It is advisable to use the latest version of the library, as updates often include bug fixes and enhancements. Please check the Aspose website for the most recent version of Aspose.Slides for Java and consider upgrading if a newer version is available.

  4. Compatibility with Java 21: Aspose.Slides for Java version 25.6 is compatible with Java 21. However, it is prudent to verify the specific compatibility notes for the Slides module to ensure there are no limitations.

For further assistance, you may want to explore the Aspose forums or documentation for more detailed troubleshooting steps.

Best regards!

@Mani.niq,
Could you please share a sample presentation file and specify the name and version of the operating system on which the error occurs?