Exception when loading a license file with Aspose Email for Java 25.6 and higher

Hi,

I have a big problem using Aspose E-Mail for Java 25.6 and higher. The version 25.5 works without problems. Every time i try to set our license with License.setLicense() i’m getting a strange exception i cannot debug:

Exception in thread "main" java.lang.ExceptionInInitializerError
	at com.aspose.email.internal.ah.zav.<init>(Unknown Source)
	at com.aspose.email.internal.ah.zdq.<init>(Unknown Source)
	at com.aspose.email.internal.ah.zco.<init>(Unknown Source)
	at com.aspose.email.zais.b(SourceFile:251)
	at com.aspose.email.zais.a(SourceFile:143)
	at com.aspose.email.License.a(SourceFile:349)
	at com.aspose.email.License.setLicense(SourceFile:305)
	at com.sag.libnext.singletons.LicenseLoader.<init>(LicenseLoader.java:15)
	at com.sag.libnext.singletons.LicenseLoader.setLicense(LicenseLoader.java:25)
	at com.sag.next.NEXT.main(NEXT.java:33)

Here is my gradle-file with the dependencies:

dependencies {
    implementation 'com.aspose:aspose-email:25.6:jdk16'

    implementation 'com.hcl.domino:domino-jnx-jna-r12:1.49.0'
    implementation 'com.hcl.domino:domino-jnx-lsxbeshim-r12:1.49.0'
    implementation 'com.hcl.domino:domino-jnx-vertx-json-r12:1.49.0'
    implementation 'org.glassfish.corba:glassfish-corba-omgapi:5.0.0'

    implementation 'com.sag:sagodm:2.2.0' -> Includes bouncycastle

    implementation 'jakarta.mail:jakarta.mail-api:2.1.3'
    implementation 'org.eclipse.angus:angus-mail:2.0.4'

    implementation 'me.tongfei:progressbar:0.10.1'
    implementation 'net.sourceforge.argparse4j:argparse4j:0.9.0'

    implementation 'org.apache.commons:commons-lang3:3.19.0'
    implementation 'org.apache.logging.log4j:log4j-to-slf4j:2.22.0'

    implementation 'org.apache.tika:tika-core:3.2.3'
    implementation 'org.apache.tika:tika-xmp:3.2.3'

    implementation 'org.json:json:20250517'
    implementation 'org.jsoup:jsoup:1.21.2'
    implementation 'org.slf4j:slf4j-nop:2.0.17'

    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.11.4'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.11.4'
}

The code for the singleton:

public class LicenseLoader {
    private static LicenseLoader instance;

    private LicenseLoader() {
        ClassLoader classLoader = getClass().getClassLoader();
        License license = new License();

        try (InputStream stream = classLoader.getResourceAsStream("Aspose.Email.Java.lic")) {
            license.setLicense(stream);
        } catch (Exception e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
    }

    @SuppressWarnings("InstantiationOfUtilityClass")
    public static synchronized void setLicense() {
        if (instance == null) {
            instance = new LicenseLoader();
        }
    }
}

And the code in the main-Method:

LicenseLoader.setLicense();

ExceptionManager.getIgnoreList().add("MailMessage\\Load\\DecodeTnefAttachment\\64149867-679e-4645-9af0-d46566cae598");
ExceptionManager.getIgnoreList().add("RecurrenceRule\\InvalidStartDate\\355e983b-0513-444d-b1c3-79da4867b54e");
ExceptionManager.getIgnoreList().add("MapiMessage\\Load\\ReadStorage\\0dbd0500-60c2-43a6-aad6-7816a9447bec");

The strange thing is, that when i use the all dependencies and the code in a newly created project, the license is getting loaded normally. What can be the cause for my problem?

@s.glasenhardt

Based on limited evidence (treat as hypothesis), here is a cautious take:
Summary of what is happening:

  • I could not confirm a documented solution for this scenario yet.

Why it matters:

  • Nothing in the current knowledge base matches this scenario, so proposing specific settings would be guesswork.
  • To avoid misleading guidance, I prefer to pause instead of speculating.

Next steps: please share a minimal repro (HTML/PDF snippet, SDK and version). I’ll check against the latest docs and release notes.

Assumptions / confirmations needed: SDK + version, file types, minimal sample, and exact error/output.

@s.glasenhardt
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): EMAILJAVA-35423

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Hello @s.glasenhardt ,

We are currently investigating the issue.
We created a test project using the dependencies you provided, but just as you mentioned, we were not able to reproduce the problem.

You may also try using the Jakarta version of Aspose Email, as it sometimes avoids dependency conflicts:

implementation 'com.aspose:aspose-email:25.6:jdk16.jakarta'

It may help resolve the licensing issue.

Hello @s.glasenhardt ,

We have created a test build 25.11.0.2 to help verify the issue on your side.
Please try this version and let us know if the licensing problem still occurs.

aspose-email-25.11.0.2.zip