We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Applying licence to aspose words

Hi,

I am trying to apply the licence to my Aspose.words library through the following code

[Java]

License license = new License();
license.setLicense("Aspose.Words.Java.lic");

Though I am placing my lic file(named Aspose.Words.Java.lic) in the same lib folder where Aspose.Words is present, I am getting the following exception.

java.lang.IllegalStateException: Cannot find license ‘Aspose.Words’.
at com.aspose.words.ws.fS(License.java:826)
at [om.aspose.words.ws.fR(License.java:344)
at com.aspose.words.License.setLicense(License.java:228)

Note : setLicense(stream) works as desired when I load the file explicitly with File IO and provide stream.

Many thanks

Ragu

Hi

Thanks for your inquiry. Please make sure that you applied license as described here:
https://docs.aspose.com/words/java/licensing/

Please make sure that the license exists on the following path. Maybe you should use full path.

License lic = new License();
lic.setLicense("C:\\Projects\\Aspose\\License\\Aspose.Words.Java.lic");

Best regards,

Hi,

https://docs.aspose.com/words/java/licensing/

In the above link, there are two ways(examples) to provide the license to the aspose lib. I have used the 1st Example, as it is stated I am placing the lic file in the same location where the aspose.words jar is located in my web application.

Location :
Jar : /WEB-INF/lib/aspose.words.jar
License : /WEB-INF/lib/Aspose.Wrods.Java.lic
Please let me know if you need any further location.
Note : I dont need to use the absolute path for license as you mentioned in your previous reply.

Many thanks

Ragu

Hello

Thank you for additional information. But I cannot reproduce the problem on my side using the latest version of Aspose.Words for Java 10.6.0.

You can download the latest version from here:

https://downloads.aspose.com/words/java

Best regards,

thanks it works fine. It was my bad, there was some server classpath issue was there.

Hello

It is perfect, that you already fond the reason of the problem. Please let me know in case of any issues, I will be glad to help you.

Best regards,