Unable to convert PDF Aspose for Java Cloud - Urgent Need

a { text-decoration: none; color: #464feb; } tr th, tr td { border: 1px solid #e6e6e6; } tr th { background-color: #f5f5f5; }

Hello Team,

Regarding the issue, you had directed us to the following forum thread: Unable to convert PDF Aspose for Java Cloud - Free Support Forum - aspose.cloud

However, since the topic has been closed, we are unable to post any replies or comments to continue the discussion. Could you please clarify how we should proceed with this query?

Actually we are waiting more than 2months to get the route cause for this issue. kindly understand our situation and respond as soon as possible.

Also we just want to know Why we need to go for Aspose Cloud API for the pdf conversion and already whatever we used implementation ( Aspose.word, Apose.cells, Aspose.PDF ) is working and sometime only getting an error. is there any possiblity to fix the issue in our implemention or else really we need to go for the cloud API. kindly clarify.

Thank you.

@Manish7320 The topic has been moved to Apsose Cloud forum because from the problem description we made a conclusion you are using a cloud version of Aspose API.

I looked into the log file attached in the initial post and see the following exception message:

Caused by: java.lang.IllegalStateException: The subscription included in this license allows free upgrades until 14 Dec 2024, but this version of the product was released on 01 Apr 2026. Please renew the subscription or use a previous version of the product.

This exception is thrown by on-premises Aspose products when you try to use a product version released after your license subscription has expired.

To resolve this issue, you can either downgrade to a product version released before your subscription expired or renew your license to use newer versions of Aspose products.

However, the log does not make it clear which Aspose product is throwing the exception.

Hello Alex,

Thank you for analyzing the logs and sharing your findings.

Based on your analysis, we understand that the exception is related to the license subscription expiry (14 Dec 2024), as we are currently using an Aspose product version released on 01 Apr 2026.

We would like to clarify the following points:

  1. If we renew the Aspose subscription and upgrade to the latest product version, will this resolve the PDF conversion issue in our application?
  2. Can you confirm that the issue is solely related to the expired license and not due to any other compatibility or technical issues with the Aspose API?
  3. Could you help us identify which specific Aspose product is throwing this exception? Please let us know if you require any additional logs or configuration details from our side.

Your confirmation will help us decide whether to proceed with the subscription renewal or investigate alternative solutions.

Looking forward to your clarification.

Thanks for your support.

@santhanarasu

Yes, with renewed license the mentioned exception will not be thrown.

From what I see from the provided log the problem occurs upon setting the license. The product you are using is released after the license expiration date and thrown an exception.

Unfortunately, by the provided log and code I cannot identify the exact product that throws the exception on your side. But by class name WordsConverter.java in your log, I can suppose this is Aspose.Words.

Hi Alex, Thanks for your response.
We are facing 2 different issue

  1. Getting an 502 internal server error while converting Excel/Word to PDF using Aspose
  2. Getting license issue when we are trying to install the latest Aspose version

Hope you are checking the error for the second issue. but we wants to know the root cause for the first issue.

we are waiting for more than 2 months to get the root cause for this issue. kindly help us to fix the issue ASAP. Sometimes only we are facing the conversion issue from our application.

@santhanarasu

Could you please try isolating the conversion code into a simple console application and provide us stack trace of the exception thrown by the involved Aspose component

Could you specify what license issue you are getting? Does new version thrown an exception upon setting the license? Could you please try setting the license in a simple console application?

Hello Team,

let me share the piece of code where we used to convert the documents into pdf. kindly refer and update

package com.nissan.ask2.aspose.core.operations;

import com.nissan.ask2.aspose.core.services.AsposeService;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.nuxeo.ecm.automation.core.Constants;
import org.nuxeo.ecm.automation.core.annotations.Context;
import org.nuxeo.ecm.automation.core.annotations.Operation;
import org.nuxeo.ecm.automation.core.annotations.OperationMethod;
import org.nuxeo.ecm.automation.core.annotations.Param;
import org.nuxeo.ecm.automation.core.util.Properties;
import org.nuxeo.ecm.core.api.*;
import org.nuxeo.ecm.core.api.blobholder.BlobHolder;
import org.nuxeo.ecm.core.api.blobholder.SimpleBlobHolder;
import org.nuxeo.ecm.platform.audit.api.AuditLogger;
import org.nuxeo.ecm.platform.audit.api.LogEntry;
import org.nuxeo.runtime.api.Framework;

import java.io.Serializable;
import java.util.*;

import static com.nissan.ask2.aspose.core.Ask2Constants.*;
import static com.nissan.ask2.aspose.core.Ask2Constants.PDF_SCHEMA_CONTENT_PROPERTY;

@Operation(id = AsposeToPDFOp.ID, category = Constants.CAT_CONVERSION, label = “Convert to PDF with ASPOSE”, description = “Convert to PDF with ASPOSE (on NUXEO server).”)
public class AsposeToPDFOp {

private static final Logger LOGGER = LogManager.getLogger(AsposeToPDFOp.class);
public static final String ID = "Aspose.ToPDF";

@Context
protected AsposeService service;

@Context
protected CoreSession session;

@Param(name = "namedParameters", required = false, description = "Named parameters to pass to aspose convert options")
protected Properties namedParameters = new Properties();

@Param(name = "uidForAudit", required = false, description = "UID of document for audit (used if blob)")
protected String uidForAudit;


@OperationMethod
public Blob run(Blob blob) {

    LOGGER.info("========== Aspose.ToPDF Operation Started (Blob) ==========");
    LOGGER.info("Input Blob Name      : {}", blob != null ? blob.getFilename() : "NULL");
    LOGGER.info("Input Blob MimeType  : {}", blob != null ? blob.getMimeType() : "NULL");
    LOGGER.info("Input Blob Length    : {}", blob != null ? blob.getLength() : "NULL");
    LOGGER.info("Audit UID            : {}", uidForAudit);

    return convertToPDF(blob, uidForAudit);
}


@OperationMethod
public Blob run(DocumentModel document) {

    LOGGER.info("========== Aspose.ToPDF Operation Started (Document) ==========");
    LOGGER.info("Document Id      : {}", document.getId());
    LOGGER.info("Document Name    : {}", document.getName());
    LOGGER.info("Document Title   : {}", document.getTitle());
    LOGGER.info("Document Type    : {}", document.getType());
    LOGGER.info("Document Path    : {}", document.getPathAsString());


    Blob sourceBlob = (Blob) document.getPropertyValue(FILE_SCHEMA_CONTENT_PROPERTY);

    if (sourceBlob == null) {
        LOGGER.error("Source blob is NULL.");
        return null;
    }

    LOGGER.info("Source Blob Filename : {}", sourceBlob.getFilename());
    LOGGER.info("Source Blob MimeType : {}", sourceBlob.getMimeType());
    LOGGER.info("Source Blob Length   : {}", sourceBlob.getLength());
    LOGGER.info("Source Blob Digest   : {}", sourceBlob.getDigest());

    Serializable conversionEnabled = document.getPropertyValue(PDF_SCHEMA_CONVERSION_ENABLED_PROPERTY);
    LOGGER.info("PDF Conversion Enabled Property : {}", conversionEnabled);

    if (conversionEnabled != null && !Boolean.parseBoolean(conversionEnabled.toString())) {
        LOGGER.warn("No converter {} document, the conversion PDF is disabled.", document.getId());
        return null;
    }

    String nativeDigest = sourceBlob.getDigest();
    Serializable pdfNativeDigest = document.getPropertyValue(PDF_SCHEMA_NATIVE_DIGEST_PROPERTY);
    LOGGER.info("Current Native Digest : {}", nativeDigest);
    LOGGER.info("Stored PDF Digest     : {}", pdfNativeDigest);
    if (pdfNativeDigest != null && nativeDigest.equalsIgnoreCase(pdfNativeDigest.toString())) {
        LOGGER.info("Skipping conversion because digests are identical.");
        LOGGER.warn("No converter {} document with same digest {}.", document.getId(), nativeDigest);
        return (Blob) document.getPropertyValue(PDF_SCHEMA_CONTENT_PROPERTY);
    }

    return convertToPDF(sourceBlob, document.getId());
}

private Blob convertToPDF(Blob sourceBlob, String documentId) {

    LOGGER.info("----------------------------------------------------");
    LOGGER.info("Entering convertToPDF()");
    LOGGER.info("Document Id : {}", documentId);

    if (sourceBlob != null) {
        LOGGER.info("Blob Name      : {}", sourceBlob.getFilename());
        LOGGER.info("Blob MimeType  : {}", sourceBlob.getMimeType());
        LOGGER.info("Blob Length    : {}", sourceBlob.getLength());
        LOGGER.info("Blob Digest    : {}", sourceBlob.getDigest());
    }

    if (documentId == null || documentId.isEmpty()) {
        LOGGER.error("No documentId provided!");
    }


    SimpleBlobHolder blobHolder = new SimpleBlobHolder(sourceBlob);
    AuditLogger auditLogger = Framework.getService(AuditLogger.class);
    List<LogEntry> entries = new ArrayList<>();
    LOGGER.warn("Conversion in progress for document: {}", documentId);

    if (documentId != null ) {
        addAuditEntry(auditLogger, entries, documentId, "Conversion in progress");
    }

        try {
            Map<String, Serializable> parameters = new HashMap<>(namedParameters);
            LOGGER.info("Calling AsposeService.convert()");
            LOGGER.info("Named Parameters : {}", parameters);
            BlobHolder serviceResult = service.convert(blobHolder, parameters);
            Blob resultBlob = serviceResult.getBlob();
            if (resultBlob != null) {
                LOGGER.info("Aspose conversion successful.");
                LOGGER.info("Result Filename : {}", resultBlob.getFilename());
                LOGGER.info("Result MimeType : {}", resultBlob.getMimeType());
                LOGGER.info("Result Length   : {}", resultBlob.getLength());
            }
            else {
                LOGGER.warn("Aspose returned NULL Blob.");
            }
            if (documentId != null) {
                LOGGER.warn("Conversion done for document: {}", documentId);
                addAuditEntry(auditLogger, entries, documentId, "Conversion done");
            }

            return resultBlob;

        } catch (Exception e) {
            if (documentId != null) {
                String errorMessage = "Conversion failed for document: " + documentId + ". Error: " + e.getMessage();
                LOGGER.error(errorMessage, e);
                LOGGER.error("Exception Class : {}", e.getClass().getName());
                LOGGER.error("Exception Message : {}", e.getMessage());

                for (StackTraceElement element : e.getStackTrace()) {
                    LOGGER.error(element.toString());
                }
                addAuditEntry(auditLogger, entries, documentId, "Conversion failed: " + e.getMessage());
                LOGGER.info("Adding audit entry...");
                LOGGER.info("Repository  : default");
                LOGGER.info("Document Id : {}", documentId);
                LOGGER.info("User        : {}", session.getPrincipal().getName());
            }

            String errorMessage = "Conversion failed : " + e.getMessage();
            LOGGER.error(errorMessage, e);
            return null;
        }
    }

private void addAuditEntry(AuditLogger auditLogger, List<LogEntry> entries,
                           String documentId, String message) {
    LogEntry entry = auditLogger.newLogEntry();
    entry.setRepositoryId("default");
    entry.setEventId("documentConversion");
    entry.setCategory("eventDocumentCategory");
    entry.setPrincipalName(session.getPrincipal().getName());
    entry.setEventDate(new Date());
    entry.setDocUUID(documentId);
    entry.setComment(message);
    entries.add(entry);
    auditLogger.addLogEntries(entries);

    LOGGER.info("Audit entry successfully stored.");
    LOGGER.warn("Audit log added: Document ID: {}, Event: {}", documentId, message);

}

@Manish7320 Thank you for additional information. Unfortunately in the provide code snippet there is no code related to Aspose.Words or other Aspose products. I see only the following:

@Context
protected AsposeService service;

and then the service is used to convert the document in the convertToPDF method:

BlobHolder serviceResult = service.convert(blobHolder, parameters);
Blob resultBlob = serviceResult.getBlob();

Therefore I think the actual usage of Aspose.Words or other Aspose products is in the AsposeService implementation.