Free Support Forum - aspose.com

License not working on AIX

Hello,

We received our license recently (Aspose.Cells for Java) and it works fine on Windows but not at all in our AIX production environment. The error is something like "Invalid license file". The license file has not been modified at all. I believe there was a similar post recently describing the same problem.

Our environment is IBM JRE 1.4 running on AIX. Would it be possible to get a license file that works for this environment /without/ using a new distribution of code. We've done all our testing already and it would be costly to repeat it just because of this one issue.

The code to load the license file looks something like this;

static {

// Load the Aspose.Cells license file.
try {
License license = new License();
String licenseFile = System.getProperty("ASPOSE_LIC");
FileInputStream inputStream = new FileInputStream(licenseFile);
license.setLicense(inputStream);
inputStream.close();
} catch (Throwable e) {
logger.warn("Error loading Aspose.Cells license file.", e);
}

}

cheers,

Pierre

Hi,

Which version do you use.Please try the newest version 1.7.3. If the error still occures,please post the exception stack to here.

Nope. The latest version doesn't work on AIX. Here's the stack trace.

com.aspose.cells.AsposeLicenseException: The license is not valid for this product.

at com.aspose.cells.License.a(Unknown Source)

at com.aspose.cells.License.setLicense(Unknown Source)

at mercury.export.concrete.MercuryExportService.(MercuryExportService.java:53)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:219)

at org.springframework.util.ClassUtils.forName(ClassUtils.java:88)

I've traced it down to differences between how the SHA1withRSA algorithm is implemented in the Sun security providers versus the IBM security providers (I had to decompile the Aspose.Cells code to understand what's going on). The IBM crypto algorithms DO NOT WORK with the license file you provided me. I suspect there are subtle differences in the way the algorithm is implemented. This is a very big problem for me since this issue is preventing us going to our production environment. Any ideas?

More details;

In License.java there is the following line;

Signature signature = Signature.getInstance("SHA1withRSA");

This will use the first provider it finds to verify the signature. For Sun JRE 1.4 it's SunJSSE. For IBM JRE 1.4 it's IBMJSSE.

I have a small test program that confirms this is indeed the problem. It works on Windows but not AIX.

cheers,

Pierre

Hi Pierre,

Could you please post your small test program here? Thank you very much.

Hi,

If the error occures at Signature, the exception message should be: The license is invalid.

Please try this fix and post all output .Please download your lic file from the AIX and send to nanjing@aspose.com.

Is it possible that your license file is changed during uploading to AIX? Could you please use binary transfer when you upload the license file with ftp?

Hi Pierre,

We made a test on an AIX server and it worked all fine.

Is it possible that JRE 1.4 caused this problem? Our test environment is v1.4.2.

root:/opt/test>java -version
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2)
Classic VM (build 1.4.2, J2RE 1.4.2 IBM AIX build ca142-20050929a (SR3) (JIT enabled: jitc))

This is the simple test case:

License license = new License();
FileInputStream in = null;
boolean bVal;

try {
in = new FileInputStream("Aspose.Cells.lic");
license.setLicense(in);
in.close();
Workbook workbook = new Workbook();
Worksheets worksheets = workbook.getWorksheets();
Cells cells = worksheets.getSheet(0).getCells();
Cell cell = cells.getCell("A1");
cell.setValue("Hello World");
workbook.save("test.xls");
}catch(Exception e){
e.printStackTrace();
}