Error installing license: com.aspose.words.PleaseReportException: The license is not valid for this product

We are trying to install the license you sent us a few days ago, and getting this error:

com.aspose.words.PleaseReportException: The license is not valid for this product. For free technical support, please post this error and the file in the Aspose.Words Forums <https://forum.aspose.com/c/words/8>.
at com.aspose.words.ew.a(Unknown Source)
at com.aspose.words.ew.a(Unknown Source)
at com.aspose.words.License.setLicense(Unknown Source)
etc…

The code snippet is simply

com.aspose.words.License license = new com.aspose.words.License();
InputStream licIs = MsWordTextFilter.class.getResourceAsStream("Aspose.Words.lic");
license.setLicense(licIs);

This is urgent for us as our first beta release is next week. Thanks.

Hi,
Could you please make sure if your input stream contains the proper license data (I mean exactly the same as stored in the original file)? If it does, attach your license file here to let us reproduce the issue (it will be only visible to you and Aspose).

Thanks for the quick response.
The license text was being loaded corretly (to be certain I added this quick hack to the code:

com.aspose.words.License license = new com.aspose.words.License();
InputStream licIs = MsWordTextFilter.class.getResourceAsStream("Aspose.Words.lic");
int ch;
while ((ch = licIs.read()) != -1) {
    System.out.print((char)ch);
}
licIs = MsWordTextFilter.class.getResourceAsStream("Aspose.Words.lic");
license.setLicense(licIs);

License file is attached (it’s called .zip but it is the original .lic - the website doesn’t allow .lic file extensions).

Also when running this inside a J2EE container I got a different error “IllegalArgumentException: stream”. Any idea what that’s about?

The license you’ve attached seems to be for Aspose.Words for .NET, not Java. I will ask the Sales team to have a look at this thread.

Hi,
Can you describe the “IllegalArgumentException: stream” error in more detail?
And can you launch the code snippet that throws the error outside the servlet container? Generally if code works in a plain application it will work inside a servlet container too.
Best Regards,

Hey Brett,
I hope all is well. I noticed that your order was for the .NET product rather than the Java product. Therefore, I have had the order changed and emailed the new Java license just a moment ago. Please be sure to let me know if it does not arrive shortly and I will be glad to post alternate download directions. Please be sure to let me know if there is any other way that I can be of assistance and I will be more than glad to.

With the new license file you’ve provided (thanks for that) the code now works correctly in the unit test. The same class in the J2EE container (JBoss 4.0.1sp1) gives this:

java.lang.IllegalArgumentException: stream
at com.aspose.words.License.setLicense(Unknown Source)

Hey Brett,
License.setLicense(InputStream stream) throws this error when stream is null.
Best Regards,

Huh, that should have been obvious :-/ - our build system stripped out the file because of the .lic. Works a charm now I’ve renamed it to.lic.xml
Thanks for your help, especially late in an Auckland summer evening!

Regards
Brett