We are in the process of upgrading our Aspose verison from 8.8.0 to 24.12. As apart of this, we have a new license: Aspose.Total.Product.Family.lic. This license seems to only have a <SubscriptionApiKeys> with a <PublicKey> and <PrivateKey>. I am trying to set the license by doing the following:
FileInputStream inputStream = new FileInputStream("Aspose.Total.Product.Family.lic");
License license = new License();
license.setLicense(inputStream);
I have also tried setting the license by referencing the file directly:
License license = new License();
license.setLicense("src/main/resources/Aspose.Total.Product.Family.lic");
And have tried both forms of setting license with the full path. The license lives within our “Resources” directory. However, the license does not get set and I don’t see any errors from Aspose. How can I set the license?
To set the license for Aspose.Cells in your Java application using the Aspose.Total.Product.Family.lic, you need to ensure that you are using the correct class for licensing. Since you are upgrading from an older version, it’s important to note that the licensing process may have slight changes.
Here’s how you can set the license correctly:
Ensure you are using the correct License class: You should be using com.aspose.cells.License instead of com.aspose.words.License. This is crucial because each Aspose product has its own licensing class.
Setting the License: You can set the license either from a file or from a stream. Here are examples for both methods:
From a File:
com.aspose.cells.License license = new com.aspose.cells.License();
license.setLicense("Aspose.Total.Product.Family.lic");
From a Stream:
FileInputStream inputStream = new FileInputStream("Aspose.Total.Product.Family.lic");
com.aspose.cells.License license = new com.aspose.cells.License();
license.setLicense(inputStream);
File Location: Make sure that the license file is located in a directory that is accessible to your application. If you are using a relative path, it should be in the same directory as your application’s JAR file or in a specified path that your application can access.
Check for Errors: If the license is not being set and you are not seeing any errors, ensure that the license file is not modified. Even a small change in the file can invalidate it.
Verify License Loading: After setting the license, you can verify if it has been loaded successfully by checking the licensing status of the Aspose.Cells components.
For more detailed information, you can refer to the official Aspose documentation on licensing here and here.
If you continue to face issues, please provide additional details about your setup, and we can assist you further.
Yeah I’ve tried the above steps and have confirmed that we are already using com.aspose.cells.License. No errors are being thrown, the license file has not been modified, the license lives in the same spot as our last license so location shouldn’t be causing an issue. License.isLicenseSet() is returning false. Here is what I have in my pom.xml:
parent pom:
It seems you are using Cloud APIs license? Please note, you cannot use cloud APIs license with on-premise (high code) Aspose APIs/libraries. You need to have high code (on premise) Aspose SKDs license to work with the relevant APIs.
Please correct us and give us more details if this is the not the case with you. Also, send us a private message with attachment (your license file - please zip the file first). Please click on my name and find “Message” button. Now, please attach the zipped archive containing the license and send us. We will investigate the issue with your provided license.
Also, see the topic on how to send the license to Aspose staff for your reference. https://forum.aspose.com/t/how-to-send-license-file-to-support-team/225542
Thanks for sending license keys via private message.
I have checked it. As I told you, you cannot use cloud APIs license (public + private keys) with on-premise (high code) Aspose APIs/SDKs. You need to purchase separate license to work with on-premise Aspose libraries, you might check licensing policies and other FAQs for your reference.
Am reading up on the licensing policies and other FAQs, but I can’t seem to find any information on the cloud API license. Am trying to understand what this license allows us to do/use. Can you help point me in the right direction to get more information on our license?
You might not find specific information regarding cloud licenses, pricing, or other policies in the recommended pages. For details on cloud APIs licenses and subscription, please refer to the cloud policies. I want to reiterate that you cannot utilize cloud APIs’ public and private keys with on-premise Aspose SDKs/libraries, and vice versa.
Your existing cloud license (public and private keys) is applicable solely for cloud APIs. If you have any additional questions or feedback, don’t hesitate to reach out to us.