Hello,
I have a licence file for ASPOSE TOTAL, which is working fine with aspose-pdf: 23.8 or aspose-words:23.8:jdk16, but does not work with aspose-imaging:23.8:jdk16.
The error message “Invalid license signature” typically indicates that there is an issue with the license file being used for Aspose.Imaging. Here are some steps you can take to troubleshoot and resolve this issue:
Verify License File: Ensure that the license file you are using is not corrupted or modified. You can do this by comparing the size of the license file on disk with the length of the byte array you read in your code. They should match.
Correct License Usage: Make sure you are using the correct method to set the license. In your case, you are using License.setLicense(InputStream), which is correct. However, ensure that the ByteArrayInputStream is positioned at the start before calling setLicense.
Check for Compatibility: Since the license works with other Aspose products like Aspose.PDF and Aspose.Words, confirm that the license is indeed valid for Aspose.Imaging as well. Sometimes, licenses are specific to certain products or versions.
Test with a Simple Example: You can test the license setting with a minimal example to isolate the issue. Here’s a simple code snippet to verify if the license can be set correctly:
import com.aspose.imaging.License;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.io.ByteArrayInputStream;
public class LicenseTest {
public static void main(String[] args) {
try {
byte[] license = Files.readAllBytes(Paths.get("C:\\GBO\\devs\\tmp\\gbo\\Aspose.Total.Java.lic"));
License imagingLicense = new License();
try (ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(license)) {
imagingLicense.setLicense(byteArrayInputStream);
}
System.out.println("License set successfully.");
} catch (Exception e) {
e.printStackTrace();
}
}
}
Contact Support: If the issue persists after checking the above points, consider reaching out to Aspose support for further assistance. They can provide more specific guidance based on your license and product version.
By following these steps, you should be able to identify the cause of the “Invalid license signature” error and resolve it.
That’s exactly what I have done, and this does not work. Is there something different in signature part of licence file, from ASPOSE TOTAL vs ASPOSE IMAGING ?
Hello, @gbe
We are sorry that you faced such a difficulty.
Please, let me know the following information about your license.
OrderID
SerialNumber
SubscriptionExpiry
And just for a test, please try to use the license the following way
com.aspose.imaging.License imagingLicense = new com.aspose.imaging.License();
imagingLicense.setLicense("Aspose.Total.Java.lic");
com.aspose.imaging.License imagingLicense = new com.aspose.imaging.License();
imagingLicense.setLicense("Aspose.Total.Java.lic");
the is the same :
class com.aspose.imaging.coreexceptions.FrameworkException: Invalid license signature. Please make sure the license file was not modified.
com.aspose.imaging.License$a.a(Unknown Source)
com.aspose.imaging.License.setLicense(Unknown Source)
com.aspose.imaging.License$setLicense$0.call(Unknown Source)
Here are required informations about my license :
OrderID: 220912125804
SerialNumber: f909097e-1512-4c7a-82f2-b7fcba10a980
SubscriptionExpiry: 20230912
Hi, @gbe
Thank you for providing the information.
Unfortunately, we can’t find any reason for such a behavior.
Could you provide the Product value from your license?
Hello @gbe,
I still can’t reproduce the issue
Could you provide your license as compressed and protected by a password file placed on your cloud drive? I fear this is the only way to understand what’s going on.
The output of the execution of this TestLicense class is the following :
> Task :TestLicense.main() FAILED
Product: Aspose.Imaging for Java
Version: 23.8.0
Release date: 2023.08.25
OS: Windows 11
Exception in thread "main" class com.aspose.imaging.coreexceptions.FrameworkException: Invalid license signature. Please make sure the license file was not modified.
com.aspose.imaging.License$a.a(Unknown Source)
com.aspose.imaging.License.setLicense(Unknown Source)
TestLicense.main(TestLicense.java:17)
at com.aspose.imaging.License$a.a(Unknown Source)
at com.aspose.imaging.License.setLicense(Unknown Source)
at TestLicense.main(TestLicense.java:17)
Execution failed for task ':TestLicense.main()'.
> Process 'command 'C:/GBO/outils/Java/Coretto/jdk17.0.7_7/bin/java.exe'' finished with non-zero exit value 1
@evgeniy.sidenko : for your information, it seems the license file is working until aspose-imaging-23.5-jdk16, and i get the license file error from version 23.6…
@gbe
Thank you for the details.
I have tried to reproduce the issue on my side but still can’t. I even tried to use Amazon Corretto 1.7 JDK and there is no expectable result.
Could you send me your aspose-imaging-23.8-jdk16.jar ?
As a work around, the previous version (23.5) is working with my license file, and it’s doing what i need to do, so it’s OK. I just don’t understand why there is a bug from 23.6…
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.