Warning concerning the license into the log file

Hello,

Into the log file of our program, we have the following exceptions:

NFO 2025-05-16 12:25:34,686 [pool-6-thread-1] [sae_system][CFL_SAE_PRD] com.aspose.pdf.License [] - Exception occur
java.lang.IllegalStateException: The license is not valid for this product. For free technical support, please post this error and the file in the Aspose.PDF Forums Aspose.PDF Product Family - Free Support Forum - aspose.com
at com.aspose.pdf.internal.l23v.l25l.lI(Unknown Source) ~[aspose-pdf-25.2.jar:25.2]
at com.aspose.pdf.internal.l23v.l24f.lI(Unknown Source) ~[aspose-pdf-25.2.jar:25.2]
at com.aspose.pdf.License.setLicense(Unknown Source) [aspose-pdf-25.2.jar:25.2]
at lu.cfl.irisnext.sae.pdf.service.AsposeLicenseActivator.setAsposeLicense(AsposeLicenseActivator.java:45) [CFL_Custom_SAE.jar:?]
at lu.cfl.irisnext.sae.pdf.service.AsposeLicenseActivator.(AsposeLicenseActivator.java:29) [CFL_Custom_SAE.jar:?]
at lu.cfl.irisnext.sae.pdf.service.AsposePDFAConverter.(AsposePDFAConverter.java:10) [CFL_Custom_SAE.jar:?]
at lu.cfl.irisnext.sae.runnable.PDFAHandlerRunnable.run(PDFAHandlerRunnable.java:96) [CFL_Custom_SAE.jar:?]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
at java.base/java.lang.Thread.run(Unknown Source) [?:?]
INFO 2025-05-16 12:25:37,301 [pool-6-thread-1] [sae_system][CFL_SAE_PRD] com.aspose.pdf.internal.l7y.lI [] - Exception occur
java.io.EOFException: Unexpected end of ZLIB input stream
at java.base/java.util.zip.InflaterInputStream.fill(Unknown Source) ~[?:?]
at java.base/java.util.zip.InflaterInputStream.read(Unknown Source) ~[?:?]
at com.aspose.pdf.internal.l7y.lI.lI(Unknown Source) [aspose-pdf-25.2.jar:25.2]
at com.aspose.pdf.internal.l6h.lt.lI(Unknown Source) [aspose-pdf-25.2.jar:25.2]
at com.aspose.pdf.internal.l3p.lu.lI(Unknown Source) [aspose-pdf-25.2.jar:25.2]
at com.aspose.pdf.internal.l3p.lu.lI(Unknown Source) [aspose-pdf-25.2.jar:25.2]
at com.aspose.pdf.internal.l3p.lu.lI(Unknown Source) [aspose-pdf-25.2.jar:25.2]
at com.aspose.pdf.internal.l3p.lu.lI(Unknown Source) [aspose-pdf-25.2.jar:25.2]
at com.aspose.pdf.OperatorCollection.lb(Unknown Source) [aspose-pdf-25.2.jar:25.2]
at com.aspose.pdf.OperatorCollection.ld(Unknown Source) [aspose-pdf-25.2.jar:25.2]
at com.aspose.pdf.OperatorCollection.size(Unknown Source) [aspose-pdf-25.2.jar:25.2]
at com.aspose.pdf.BaseOperatorCollection.isEmpty(Unknown Source) [aspose-pdf-25.2.jar:25.2]
at com.aspose.pdf.ADocument.l1y(Unknown Source) [aspose-pdf-25.2.jar:25.2]
at com.aspose.pdf.ADocument.isLicensed(Unknown Source) [aspose-pdf-25.2.jar:25.2]
at lu.cfl.irisnext.sae.pdf.service.AsposeLicenseActivator.(AsposeLicenseActivator.java:30) [CFL_Custom_SAE.jar:?]
at lu.cfl.irisnext.sae.pdf.service.AsposePDFAConverter.(AsposePDFAConverter.java:10) [CFL_Custom_SAE.jar:?]
at lu.cfl.irisnext.sae.runnable.PDFAHandlerRunnable.run(PDFAHandlerRunnable.java:96) [CFL_Custom_SAE.jar:?]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:?]
at java.base/java.lang.Thread.run(Unknown Source) [?:?]

Could you help us to avoid this?

Best Regards,
François

@fdonnay

Hello François,

The warning you are encountering in your log file indicates that the license you are trying to use is not valid for the Aspose.PDF product. This can happen for several reasons, such as using an incorrect license file, the license file being corrupted, or the license not being applicable to the version of the library you are using.

To resolve this issue, you can follow these steps:

  1. Verify the License File: Ensure that the license file you are using is the correct one for the version of Aspose.PDF you have. The license file should match the product and version you are working with.

  2. Check for Corruption: Make sure that the license file is not corrupted. You can try opening the license file in a text editor to see if it appears as expected.

  3. Set the License Properly: Ensure that you are setting the license correctly in your code. Here is a sample code snippet that demonstrates how to set the license:

    import com.aspose.pdf.License;
    
    public class LicenseExample {
        public static void main(String[] args) {
            License license = new License();
            try {
                license.setLicense("path/to/your/Aspose.Pdf.Java.lic");
                if (com.aspose.pdf.Document.isLicensed()) {
                    System.out.println("License is Set!");
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }
    

    Make sure to replace "path/to/your/Aspose.Pdf.Java.lic" with the actual path to your license file.

  4. Check for Version Compatibility: Ensure that the version of the Aspose.PDF library you are using is compatible with the license file. If you have recently updated the library, you may need to obtain a new license.

  5. Contact Support: If you have verified all the above and the issue persists, consider reaching out to Aspose support for further assistance.

By following these steps, you should be able to resolve the license-related warnings in your log file.

Best Regards!

Hello,

We have checked what you suggest.

Could you check the reason of the exception:

INFO 2025-05-16 12:25:37,301 [pool-6-thread-1] [sae_system][CFL_SAE_PRD] com.aspose.pdf.internal.l7y.lI [] - Exception occur
java.io.EOFException: Unexpected end of ZLIB input stream
at java.base/java.util.zip.InflaterInputStream.fill(Unknown Source) ~[?:?]
at java.base/java.util.zip.InflaterInputStream.read(Unknown Source) ~[?:?]

Best Regards,
François

@fdonnay

The reason of this error cannot be determined sadly without replicating it in our environment. If possible, can you please share some steps that we can perform in our environment to replicate and reproduce the issue? We will test the scenario in our environment and address it accordingly.