Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Sep 12, 2024 3:03 pm

We had a license for evaluation and used spire to create protocols. Everything worked fine.

Because we want to use Java 21 in December we tried out spire version 10.9.0 and requested a time limited license key.

We can now produce PDF without water marks but there is an exception and I dont know how to find the reason:

Exception in thread "java.lang.ThreadGroup[name=main,maxpri=10]_179" java.lang.NullPointerException: Cannot invoke "java.util.concurrent.ThreadPoolExecutor.shutdown()" because the return value of "com.spire.pdf.packages.sprwxt.spr■?()" is null
at com.spire.pdf.packages.spruiu.spr??(ThreadPool.java:117)
at com.spire.pdf.packages.sprblu.spr??(Thread.java:66)
at com.spire.pdf.packages.sprteu.run(Thread.java:118)
at java.base/java.lang.Thread.run(Unknown Source)

HundKasimir
 
Posts: 2
Joined: Thu Mar 16, 2023 1:07 pm

Fri Sep 13, 2024 9:33 am

Hello,

Thanks for your inquiry. Based on the preliminary inference from the exception information, your scenario is in a thread pool. In order for us to solve your problem faster, please provide us with your complete test code and testing file, or a project that can reproduce the exception. You can send it to us here or via email( support@e-iceblue.com ). Thank you in advance.

Sincerely,
Amin
E-iceblue support team
User avatar

Amin.Gan
 
Posts: 283
Joined: Mon Jul 15, 2024 5:40 am

Mon Sep 16, 2024 4:11 pm

We are using Java Version 21 and spire pdf 10.9.0.
I have extracted some routines from our project.
You find a running project in the attachment.
Adjust the output folder in BackgroundTask.java in line 16.

I run the project several times, sometimes I get the error I described (see screenshot). It seems to me, that the worker task is finished before spire shut down but signals the threadpool that the task is finished. I got the exception during the creation of PDF files and one time at the end of the BackgroundTask.

There is a second issue:
PDF/A conversion get slower and slower during the run: I commented it out in Txt2PdfSpirePDF.java in line 133ff (I renamed the pdf, triggered the conversion).

Best regards
Michael Raab

I was not able to upload the 7z file, so you will receive it via mail

HundKasimir
 
Posts: 2
Joined: Thu Mar 16, 2023 1:07 pm

Tue Sep 17, 2024 6:44 am

Dear Michael,

Thanks for your sharing.
I only received the volume compression parts 001, 002 you sent, not 003. Please send the compressed part 003 again. Alternatively, you can directly upload your entire project to Dropbox or OneDrive and provide us with the complete download link.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1195
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.PDF