NullPointerException at

I have a very weird problem. I am running into a NullPointerException in the production environment. Unit Testing works fine. My code:

Document doc = new Document("sample.pdf");
ParagraphAbsorber absorber = new ParagraphAbsorber();
absorber.visit(doc);  //NullPointerException occurs here

Here is the stacktrace:
at Source)
at com.aspose.pdf.MarkupSection.ll(Unknown Source)
at com.aspose.pdf.MarkupSection.lIF(Unknown Source)
at com.aspose.pdf.ParagraphAbsorber.visit(Unknown Source)
at com.aspose.pdf.ParagraphAbsorber.visit(Unknown Source)

Few observations:

  1. Always works the first time - meaning I don’t get a NullPointerException
  2. It breaks after running for a couple of times. Sometimes it dies on the second attempt, on other occasions, it dies on the third or fourth iteration.
  3. Does not matter which PDF input file I use. Happens with ANY PDF file. Once NullPointerException starts to occur it does not get fixed unless I restart the process
  4. Never happens during Unit Testing. I have tried running the code in a for loop that iterates 100 times.

My Question: Can someone in support please tell me what is the program looking for in . The stacktrace is obfuscated and therefore, I do not know the exact class name.


Thanks for contacting support.

In order to address the issue, we need to replicate it in our environment. Would you please share your production environment details and application type with us. We will try to test the scenario in specific environment and address it accordingly.

I have created a small project and a video demonstrating the problem. The project is a web application requiring Tomcat 7. Both files (project and video) can be [downloaded from here].


We have logged a ticket with ID PDFJAVA-38102 in our issue management system for further investigations. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

We are sorry for the inconvenience.

Any progress on this???


Thank you for getting back to us.

We would like to update you that PDFJAVA-38102 has been resolved. Please try using Aspose.PDF for Java 18.12 in your environment and then share your kind feedback with us.