License key issue with relative path (revisited)


#1

I’m encountering an issue that was supposedly fixed in SLIDESJAVA-34512 where Aspose slides won’t load license files using a relative path. Specifically, this was the issue raised on Thread 62589. Words/Cells/etc all see the license file fine when it is placed in the same folder as the jar, but Slides only works when an absolute path to the license is used.

My testing was to put jars and license files into “C:/testjars”, add the jar I’m testing to the build path, then run some test java code. Today I generated a new temporary license and tested using Aspose versions 15.1, 15.11, 16.1, 17.1, 17.12 and 19.6. None of these releases fixed the problem. The test code was this:

public static void main(String[] args) throws Exception {
	//new com.aspose.cells.License().setLicense("Aspose.Slides.lic"); // The license is not valid for this product.
	//new com.aspose.words.License().setLicense("Aspose.Slides.lic"); // The license is not valid for this product.
	new com.aspose.slides.License().setLicense("Aspose.Slides.lic"); // License stream is not available for reading
	new com.aspose.slides.License().setLicense("C:/testjars/Aspose.Slides.lic"); // Works
}

Do relative license paths work for anyone else?


#2

@JoeMcNolan,

I have observed the requirements shared and request you to please share the details of issue incurring on your end on using relative license. Please also provide the Java and Operating System details as well on your end.


#3

@mudassir.fayyaz
I’m running Windows 10 with Corretto OpenJDK version “1.8.0_212”

The problem is that I want to use the relative license path instead of absolute path. The Aspose Slides licensing documentation says I can put the license in the same folder as the aspose slides jar, and provides sample code. When I try the sample code, it keeps throwing this exception “License stream is not available for reading” in com.aspose.slides.License.setLicense().


#4

@JoeMcNolan,

I have observed your comments. Can you please share on which relative path you are placing license file. I mean whether with Java file or generated class file of program.


#5

I put the license file into the JAR folder, not into my application. For example, right now I have:
C:/testjars/Aspose.Slides.lic
C:/testjars/aspose.slides-15.1.0-jdk18.jar
C:/testjars/aspose.slides-15.11.0.jar
C:/testjars/aspose-slides-19.6-jdk16.jar
C:/testjars/aspose-cells-19.6.jar
C:/testjars/aspose-words-19.6-jdk17.jar

My test application is in C:\Users\username\eclipse-workspace\Asposetest


#6

@JoeMcNolan,

Thank you for sharing the information. An issue with ID SLIDESJAVA-37692 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.


#7

Great, thank you.