Free Support Forum -

License setLicense() problems

I have tried several different ways to get this working. I finally found something that works, but it keeps treating as though it is an Evaluation license. I have this working in an old build of my Application. The new build I have been working on has had no issues during development. I use NetBeans6.0 and I have set the VM to 1.5.0_06. In the IDE I don’t receive errors, but when I execute the jar file I get either signature invalid or an extra Excel Worksheet that complains about an evaluation version.

My code for the license with commented attempts at different ways to get it to work. What should I use to get the file from the jar? Should I just put the file in the working directory and use the FileInputStream? I would rather use the reflection classes is that possible?

public void installLicenseFromJar() throws AsposeException {

//ClassLoader loader = getClass().getClassLoader();
//URL source = null;
//source = loader.getResource(“Aspose.Cells.lic”);

//URL source = getClass().getResource("/com/dande/cabs/vznclient/Aspose.Cells.lic");

License license = new License();
//FileInputStream stream = null;
InputStream stream = null;

try {
stream = getClass().getResourceAsStream(“Aspose.Cells.lic”);

//URLConnection connection = source.openConnection();
//stream = connection.getInputStream();
//stream = new FileInputStream(“Aspose.Cells.lic”);

} catch (Exception e) {
System.out.println(“EXCEPTION ->” + e);
System.out.println(“EXCEPTION ->” + e.getMessage());
throw new AsposeException(“Unable To Initialize License For Excel Plug-In”);
} finally {
try {
if (stream != null) {
} catch (Exception e) {
throw new AsposeException(“Could not close Aspose license file.”);


Which version of Aspose.Cells for java you are using. Is it possible that your license is expired. Normally when you purchase a license, you may use this license file with any newer version / hot fixes released for the next whole year. Does the license file works fine with some older version(s)?

We will also check and get back to you soon.

Thank you.

Hello Amjad,

Here is the information in the Manifest file from Aspose.Cells.jar.

Name: Aspose.Cells for Java
Specification-Title: Aspose.Cells for Java
Release-Date: 2006.04.18
Implementation-Title: Aspose.Cells for Java
Specification-Vendor: Aspose Pty Ltd
Implementation-Vendor: Aspose Pty Ltd

I have contacted purchasing at my company for an account # etc.

Thanks for your help,

Hello Amjad,

Just to circumvent any issues with the license I went ahead and renewed my order. I should be receiving a new license shortly. Hopefully, this will work with the latest and greatest software.

I will post another message with the results of this.


Hello Amjad,

Renewing and applying the latest and greatest code solved the problem. I was able to use the getClass().getResources(…) with URLConnection code and I was able to embed the license file in my Jar, so I don’t have to have a copy of the license just out there which is cool.

Robert Armenta

Hi Robert,

That's great :-)