Unable to set license for Aspose.cells with an Aspose.Total.Product.Family.lic license in my Java application

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?

@mnm0429

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:

  1. 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.

  2. 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);
    
  3. 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.

  4. 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.

  5. 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.

Sources:
[1]: Licensing - Aspose Documentation
[2]: Applying a License - Aspose Documentation

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:

<aspose-cells.version>24.12</aspose-cells.version>

service pom:

<dependency>
      <groupId>com.aspose</groupId>
      <artifactId>aspose-cells</artifactId>
      <version>${aspose-cells.version}</version>
    </dependency>

    <dependency>
      <groupId>com.aspose</groupId>
      <artifactId>aspose-cells</artifactId>
      <version>${aspose-cells.version}</version>
      <classifier>javadoc</classifier>
    </dependency>

Here is a couple ways i have tried to set the license:

FileInputStream inputStream = new FileInputStream("src/main/resources/Aspose.Total.Product.Family.lic");
License license = new License();
license.setLicense(inputStream);
FileInputStream inputStream = new FileInputStream("Aspose.Total.Product.Family.lic");
License license = new License();
license.setLicense(inputStream);
License license = new License();
license.setLicense("Aspose.Total.Product.Family.lic");
License license = new License();
license.setLicense("src/main/resources/Aspose.Total.Product.Family.lic");

My Aspose.Total.Product.Family.lic file looks like this (omitting actual values):

<?xml version="1.0"?>
<SubscriptionApiKeys>
  <PublicKey>PUBLIC_KEY</PublicKey>
  <PrivateKey>PRIVATE_KEY</PrivateKey>
</SubscriptionApiKeys>

@mnm0429,

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

I have sent you a private message with the included .zip file. I believe you are right that this is a Cloud API license. How can I setup this license?

@mnm0429,

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?

@mnm0429,

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.

Right right, I’m now trying to understand what our current license does give us access to

@mnm0429,

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.

I see, so all we can do with our license is make calls to the endpoints listed here: Aspose.Cells Cloud - API References correct?

@mnm0429,

Your understanding is correct.