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?