Aspose.Words Java on IBM i (AS/400)

Hi,

I’m trialling your software for a customer and have successfully compiled and run my program on a Windows PC running Java 8, however when I run this program on our server, IBM i (AS/400) also running Java 8 I get the following exception:

Exception in thread "main" com.aspose.words.internal.zzXDK: Exception on self test: Array index out of range: 32: EC
at com.aspose.words.internal.zzZDB.zzX54(Unknown Source)
at com.aspose.words.internal.zzWCu.zzX54(Unknown Source)
at com.aspose.words.internal.zzWCu.<clinit>(Unknown Source)
at java.lang.Class.forNameImpl(Native Method)
at java.lang.Class.forName(Class.java:337)
at com.aspose.words.internal.zzWvt.zzYuZ(Unknown Source)
at com.aspose.words.internal.zzWvt.zzZjd(Unknown Source)
at com.aspose.words.internal.zzWvt$zzX54.run(Unknown Source)
at com.aspose.words.internal.zzWvt.zzWkO(Unknown Source)
at com.aspose.words.internal.zzZ5y$zzY5k.<init>(Unknown Source)
at com.aspose.words.internal.zzZ5y$zzX54.zzX54(Unknown Source)
at com.aspose.words.internal.zzY4x.<clinit>(Unknown Source)
at com.aspose.words.internal.zzZAD.<init>(Unknown Source)
at com.aspose.words.internal.zzZAD.<init>(Unknown Source)
at com.aspose.words.internal.zzZAD.<clinit>(Unknown Source)
at com.aspose.words.zzXgo.<init>(Unknown Source)
at com.aspose.words.zzWjW.zzX54(Unknown Source)
at com.aspose.words.zzWjW.zzX54(Unknown Source)
at com.aspose.words.zzVOD.zzZFw(Unknown Source)
at com.aspose.words.zzZJ1.zzX54(Unknown Source)
at com.aspose.words.zzWjW.zzX54(Unknown Source)
at com.aspose.words.zzVSM.zzX54(Unknown Source)
at com.aspose.words.zzWqO.zzX54(Unknown Source)
at com.aspose.words.zzYqe.zzYel(Unknown Source)
at com.aspose.words.zzXhz.zzX54(Unknown Source)
at com.aspose.words.zzXhz.zzYFZ(Unknown Source)
at com.aspose.words.zzXhz.zzX54(Unknown Source)
at com.aspose.words.zzXhz.zzX54(Unknown Source)
at com.aspose.words.zzXhz.zzYZT(Unknown Source)
at com.aspose.words.zzXhz.zzX54(Unknown Source)
at com.aspose.words.zzXhz.zzX54(Unknown Source)
at com.aspose.words.zzXhz.zzX54(Unknown Source)
at com.aspose.words.zzXhz.zzZaX(Unknown Source)
at com.aspose.words.zzXhz.zzYjj(Unknown Source)
at com.aspose.words.zzXhz.zzre(Unknown Source)
at com.aspose.words.zzYqe.zzXTl(Unknown Source)
at com.aspose.words.zzW6r.zzXTl(Unknown Source)
at com.aspose.words.Document.zzY5k(Unknown Source)
at com.aspose.words.Document.zzX54(Unknown Source)
at com.aspose.words.Document.<init>(Unknown Source)
at com.aspose.words.Document.<init>(Unknown Source)
at ConvertDOCToPDF.main(ConvertDOCToPDF.java:10)

Is there anything I need to do to get this to run on the server ?

Many thanks,
David.

@daviddow Which version of Aspose.Words do you use? Does the problem occur with all documents or with some particular document only? If the problem occurs with a particular document, please attach it here for testing. Also, please provide a simple code that will allow us to reproduce the problem.

Alexey,

I’m using the latest 23.6 version of Aspose.Words.
This is with all documents, I’ve just been testing with a very basic doucment with one line of text.
Here is my code which works on Windows but not on IBM i:

 import com.aspose.words.Document;
 import com.aspose.words.SaveFormat;
 import java.io.*;
 
 public class ConvertDOCToPDF {
 
 	public static void main(String[] args) {
 
 		try {
 			Document doc = new Document(args[0]);
 			doc.save(args[0]+".pdf",SaveFormat.PDF);  //Save the document in PDF format.
 			doc.save(args[0]+".txt",SaveFormat.TEXT); //Save the document in TXT format.
 		} catch (Exception e) {
 			System.out.println("toString(): " + e.toString());
 			System.out.println("getMessage(): " + e.getMessage());
 			System.out.println("StackTrace: ");
 			e.printStackTrace();
 		}
 
 	}
 
 }

The IBM i is running the following version of Java:

java version “1.8.0_251”
Java™ SE Runtime Environment (build 8.0.6.10 - pap6480sr6fp10-20200408_01(SR6 FP10))
IBM J9 VM (build 2.9, JRE 1.8.0 OS/400 ppc64-64-Bit Compressed References 20200402_443261 (JIT enabled, AOT enabled)
OpenJ9 - 35ef566
OMR - 4bca4f4
IBM - 55acf4a)
JCL - 20200407_01 based on Oracle jdk8u251-b08

Any ideas on how to get this working would be good.

Regards,
David.

@daviddow Thank you for additional information. I will consult with our Java developers and provide you more information.

@daviddow
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): WORDSJAVA-2877

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.

@daviddow, the exception with the “Exception on self test: Array index out of range: 32: EC” message is thrown on IBM J9 VM while applying the license, for example:

License lic = new License();
lic.setLicense("Aspose.Words.Java.lic");

This license issue is reproducible with Aspose.Words 23.6 and 23.7 but not with 23.5. The only change in the 23.6 version that could affect the license code is upgrading the BouncyCastle library to a newer version (1.0.2.4). There were multiple requests from our customers to upgrade BouncyCastle due to CVE-2022-45146 vulnerability issue found in previous versions.

BouncyCastle cryptographic methods are used by Aspose.Words for Java in Aspose license code. So it seems that the BouncyCastle upgrade is the root cause for the license issue as no other changes in the license code were made in Aspose.Words for Java 23.6.

The license issue is not reproducible with other JDKs (OpenJDK, Eclipse OpenJ9). It seems that combination of BouncyCastle 1.0.2.4 and IBM J9 VM leads to the issue.

Could you consider switching to another JDK? Eclipse OpenJ9 might be a candidate as it is a continuation of IBM J9.

Denis,

Thanks for the response, as moving to another JDK on the installed OS version might not be possible I’ve tried using Aspose Words 23.5 and this works fine. As the function locked down and not accessible the weakness in BouncyCastle shouldn’t be a problem.

Regards,
David.

The issues you have found earlier (filed as WORDSJAVA-2877) have been fixed in this Aspose.Words for Java 23.12 update.