I am currently evaluating your product (Version 21.6 jdk17) and get this error when trying to convert a word document to pdf. As of now I do not have a license file (should be fine for a quick test?)…
Caused by: java.lang.IllegalStateException: Invalid license signature. Please make sure the license file was not modified.
at com.aspose.words.zzWS3.<init>(Unknown Source)
at com.aspose.words.zzWS3.<clinit>(Unknown Source)
If you do not have a license (.lic) file then you do not need to call License.setLicense method. But, in this case, Aspose.Words for Java (without the specified license) will provide full product functionality, but it will insert an evaluative watermark at the top of the document upon loading and saving and will limit the maximum document size to a few hundred paragraphs. However, to test Aspose.Words for Java without the limitations of the Trial version, you can also request a 30-day Temporary License. For more details, see the “Get a Temporary License” page.
I do not set the license key anywhere, that’s the strange thing I currently do not understand. You can find the actual code below. However I am going to request a temporary license
import com.aspose.words.Document;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class WordToPdf implements IPdfConverter {
private static final Logger logger = LogManager.getLogger(WordToPdf.class.getName());
@Override
public void convertToPdf(String docxFilePath, String pdfFilePath) {
try {
Document wordDoc = new Document(docxFilePath);
wordDoc.save(pdfFilePath, com.aspose.words.SaveFormat.PDF);
} catch (Exception e) {
logger.error(e.getMessage(), e);
}
}
}
After an initial test with the (21.6) version of Aspose.Words for Java, we were unable to reproduce this exception on our end. Please compress the following resources into ZIP format and attach the .zip file here for testing:
A simplified source Word document you are getting this problem with
Please also create a standalone simplified Java Application (source code without compilation errors) that helps us to reproduce this problem on our end and attach it here for testing. Please do not include Aspose.Words JAR files in it to reduce the file size.
As soon as you get these pieces of information ready, we will then start investigation into your particular scenario and provide you more information.
Thanks for your message! “Unfortunately” I am not able to reproduce this issue in a standalone application. There everything runs fine… The problem exists when running from within a HCL Notes application, so I am not able to deliver an example in an easy way. Just out of curiosity, what could be a reason for this strange behaviour?
I guess I’ll request a trial license and try again. Thank you very much so far!
Exception in thread "AgentThread: JavaAgent" java.lang.ExceptionInInitializerError
at java.lang.J9VMInternals.ensureError(Unknown Source)
at java.lang.J9VMInternals.recordInitializationFailure(Unknown Source)
at com.aspose.words.zzXjl.zzWXs(Unknown Source)
at com.aspose.words.zzXjl.zzXHL(Unknown Source)
at com.aspose.words.zzWh8.zzpw(Unknown Source)
at com.aspose.words.Document.zzYl6(Unknown Source)
at com.aspose.words.Document.zzWXs(Unknown Source)
at com.aspose.words.Document.<init>(Unknown Source)
at com.aspose.words.Document.<init>(Unknown Source)
at com.gi.dzpb.dokumentendruck.office.WordToPdf.convertToPdf(WordToPdf.java:13)
at com.gi.dzpb.dokumentendruck.protokolle.ProtokollBestandteil.createPdf(ProtokollBestandteil.java:104)
at com.gi.dzpb.dokumentendruck.api.Dokumentendruck.start(Dokumentendruck.java:148)
at JavaAgent.NotesMain(JavaAgent.java:24)
at lotus.domino.AgentBase.runNotes(Unknown Source)
at lotus.domino.NotesThread.run(Unknown Source)
Caused by: java.lang.IllegalStateException: Invalid license signature. Please make sure the license file was not modified.
at com.aspose.words.zzWS3.<init>(Unknown Source)
at com.aspose.words.zzWS3.<clinit>(Unknown Source)
... 13 more
Just to let you know, the same program is converting Excel files to PDF perfectly fine using Aspose.Cells for Java in evaluation mode without license file and no errors
I am afraid, we are unable to reproduce this issue on our end so far. But, to investigate this scenario further, we have logged a ticket in our issue tracking system with ID WORDSJAVA-2612. We will further look into the details of this problem and will keep you updated on the status.
Good day!
I’ve noticed this is an issue with the java.policy file, we are quite restrictive with that. From the stack trace I cannot see which permissions are required. Setting
permission java.security.AllPermission;
will resolve the error but I need to find the exactly required settings for production use.
Thank you very much & kind regards
Sven Olding