We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Experiencing NoClassDefFoundError: Could not initialize class asposewobfuscated.zzDR

Good Day,

We’ve recently added JAI tools to assist in converting
Multiple TIFF pages into PDF. While this works, we’re now experiencing
the below error message when converting email body content to a word
document.

java.lang.RuntimeException: javax.ejb.EJBTransactionRolledbackException: Unexpected Error
java.lang.NoClassDefFoundError: Could not initialize class asposewobfuscated.zzDR
at asposewobfuscated.zzDS.zzq(Unknown Source)
at asposewobfuscated.zzDS.zzW(Unknown Source)
at com.aspose.words.zz4Y.zzG(Unknown Source)
at com.aspose.words.zz4Y.setImageBytes(Unknown Source)
at com.aspose.words.ImageData.setImageBytes(Unknown Source)
at com.aspose.words.DocumentBuilder.insertImage(Unknown Source)
at com.aspose.words.DocumentBuilder.insertImage(Unknown Source)
at com.aspose.words.DocumentBuilder.insertImage(Unknown Source)


We’re using :
JAI imageio 1.1.3
aspose.words 14.4.1
aspose.pdf 9.0.0
aspose

We
suspect it might be due to different email content as some emails get
converted successfully while some don’t. Here below is the code we use ,
the stacktrace shows that it’s failing on the line highlighted below.

ByteArrayOutputStream mHtmlOutputStream = new ByteArrayOutputStream();
msg.save(mHtmlOutputStream, MailMessageSaveType.getMHtmlFormat());

InputStream mHtmlInputStream = new ByteArrayInputStream(mHtmlOutputStream.toByteArray());

LoadOptions loadOptions = new LoadOptions();
loadOptions.setLoadFormat(LoadFormat.MHTML);
com.aspose.words.Document mhtmlDocument = new com.aspose.words.Document(mHtmlInputStream, loadOptions);

ByteArrayOutputStream pdfOs = new ByteArrayOutputStream();
mhtmlDocument.save(pdfOs, new PdfSaveOptions());

Hi Kabelo,

Can you please share your source email message to reproduce this issue?

Best Regards,

Hi Ijaz


I am working with Kabelo on the below. Please look at the below for the sample code.
private static FileContent convertEmailToContent(MailMessage msg, FileContent content) {
try {
TimeZone tz = TimeZone.getDefault();
msg.setTimeZoneOffset(tz.getOffset(new Date().getTime()));
ByteArrayOutputStream mHtmlOutputStream = new ByteArrayOutputStream();
msg.save(mHtmlOutputStream, MailMessageSaveType.getMHtmlFormat());
InputStream mHtmlInputStream = new ByteArrayInputStream(mHtmlOutputStream.toByteArray());
LoadOptions loadOptions = new LoadOptions();
loadOptions.setLoadFormat(LoadFormat.MHTML);
com.aspose.words.Document mhtmlDocument = new com.aspose.words.Document(mHtmlInputStream, loadOptions);
ByteArrayOutputStream pdfOs = new ByteArrayOutputStream();
mhtmlDocument.save(pdfOs, new PdfSaveOptions());
byte[] emailBodyAsPdf = pdfOs.toByteArray();
if (content == null)
content = new FileContent(msg.getMessageId()+".pdf", emailBodyAsPdf, getPdfPages(emailBodyAsPdf));

Hi Eugene,

Thanks for the sample. We are testing it at our end and update you soon.

Best Regards,

Hi Ijaz


Thanks for your response, would really appreciate it if you could respond to this issue before end of today as this is a production issue on our side and some of these emails will not convert, even after processing them more than 5 times.

Thanks in advance.

Hi Eugene,

I do not see any issue at my end using the latest versions. Output is also fine. Can you please test with latest versions of Aspose.Email and Aspose.Words APIs?

Best Regards,