How Saxon loads licence file ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How Saxon loads licence file ?

cmarchand
Hello,

we execute saxon in a Spring-XD container, and licence file is not
loaded from classpath.

Spring-XD put all dependencies in the module jar file, in a lib/ folder.
So, a module jar contains others jars.

Our licence is deployed in a jar, so, the license is in a jar that is in
a jar.

The following code produces this :
URL saxonLic = this.getClass().getResource("/" +
SAXON_LICENSE_FILE_NAME);
LOGGER.debug("Resolving Saxon License file to: {}", saxonLic);
com.saxonica.config.ProfessionalConfiguration cfg =
(com.saxonica.config.ProfessionalConfiguration)getConfiguration();
LOGGER.debug("isLicenseFound() -> {}, isLicenseNotFound() -> {}",
cfg.isLicenseFound(), cfg.isLicenseNotFound());

Resolving Saxon License file to:
jar:file:/home/ext-cmarchand/applications/sie-spring-xd-1.3.1.RELEASE-dist/xd/custom-modules/job/pouet.jar!/lib/saxonee-license-9.7.jar!/saxon-license.lic
isLicenseFound() -> false, isLicenseNotFound() -> true

Is Saxon able to load such a licence file ?

Best regards,
Christophe

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How Saxon loads licence file ?

Michael Kay
I've never tried loading the license from within a JAR file, but I don't see any reason it shouldn't work.

The search sequence is basically:

(a) load from a specific location if one has been specified, e.g. in the configuration file

(b) try to load saxon-license from the directory from which the saxon9ee.jar file was loaded (but not all classloaders make this information available)

(c) try to load saxon-license.lic from the classpath

Whatever mechanism you use, of course, needs to respect the contractual T&Cs for the particular kind of license you are deploying.

Michael Kay
Saxonica

> On 20 Jun 2017, at 11:38, [hidden email] wrote:
>
> Hello,
>
> we execute saxon in a Spring-XD container, and licence file is not loaded from classpath.
>
> Spring-XD put all dependencies in the module jar file, in a lib/ folder. So, a module jar contains others jars.
>
> Our licence is deployed in a jar, so, the license is in a jar that is in a jar.
>
> The following code produces this :
> URL saxonLic = this.getClass().getResource("/" + SAXON_LICENSE_FILE_NAME);
> LOGGER.debug("Resolving Saxon License file to: {}", saxonLic);
> com.saxonica.config.ProfessionalConfiguration cfg = (com.saxonica.config.ProfessionalConfiguration)getConfiguration();
> LOGGER.debug("isLicenseFound() -> {}, isLicenseNotFound() -> {}", cfg.isLicenseFound(), cfg.isLicenseNotFound());
>
> Resolving Saxon License file to: jar:file:/home/ext-cmarchand/applications/sie-spring-xd-1.3.1.RELEASE-dist/xd/custom-modules/job/pouet.jar!/lib/saxonee-license-9.7.jar!/saxon-license.lic
> isLicenseFound() -> false, isLicenseNotFound() -> true
>
> Is Saxon able to load such a licence file ?
>
> Best regards,
> Christophe
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Loading...