Free Support Forum - aspose.com

Aspose License is not loading from jar


#1

We have enterprise license for Aspose Word and this license file is placed in resources folder
Below code part of static block is used to load license file
License lic = new License();
lic.setLicense(Program.class.getResourceAsStream(“Aspose.Words.Java.lic”));

Our process is triggered from main file and it is working fine when this main class executed from eclipse but when fat jar is built using maven shade plugin, Aspose.Words.Java.lic file in resources folder is replaced with “Aspose.License.BlackList.Real.xml” file and license is not loaded with above code.

When I changed code to below file is loaded into stream but it fail to validate the license as file does not have license information and give NPE
lic.setLicense(Program.class.getResourceAsStream("/resources/Aspose.License.BlackList.Real.xml"));
so i updated the content of Aspose.License.BlackList.Real.xml file with Aspose.Words.Java.lic content within jar and run the process and it is working.

Can someone explain why lic file is changed to “Aspose.License.BlackList.Real.xml” while creating fat jar


#2

@guptasha,

Please list complete steps that we can follow to reproduce the exact same issue on our end. Please also provide sample Java application (source code without compilation errors) here for testing. We will then investigate the scenario on our end and provide you more information. Thanks for your cooperation.