Hello,
During the deployment on a server I had the following error appears:
Invalid constant pool tag, 19 at index 3.
The aspose-words-24.10-jdk17.zip library is not jdk 7 or 8 compatible because the following class is compiled in jdk version 9:
\META-INF\versions\9\module-info.class: 53 . 0
If I remove this class in the JAR file it works. Would it be possible to remove this file in future versions of java libraries.
The error message “Invalid constant pool tag, 19 at index 3” typically arises due to compatibility issues between the Java version used to compile the library and the Java version used to run it. In your case, it seems that the Aspose.Words library you are using is compiled with JDK 9, which is not compatible with JDK 7 or 8.
To resolve this issue, you have a couple of options:
Update Your Java Runtime: The simplest solution would be to update your Java runtime to JDK 9 or later. This will ensure compatibility with the compiled classes in the Aspose.Words library.
Modify the JAR File: As you mentioned, removing the module-info.class file from the JAR allows it to work. However, this is not a recommended long-term solution as it may lead to other issues or instability.
Upgrade Tomcat: If you are using Tomcat, ensure that you are using a version that supports the newer class file formats. Versions 8.0.42 and later, 8.5.12 and later, and 9.0.0 and later of Tomcat have updated the Apache Commons BCEL library, which can handle the module-info.class file correctly.
If you are looking for a future version of the Aspose libraries that does not include the module-info.class, it would be best to reach out to Aspose support directly to express your concerns and request this change.
For more detailed information, you can refer to the Tomcat change history and the specific fix related to this issue.
If you have any further questions or need additional assistance, feel free to ask!