Unfortunately for Saxon 9 http://www.saxonica.com/documentation9.0/javadoc/net/sf/saxon/FeatureKeys.html FeatureKeys.LICENSE_FILE_LOCATION is not there yet. (Even for newer version Javadoc is not clear what
is allower string parameter - can it be only local filesystem path or can it be also URI? Like eg in Spring config with prefix classpath:
or file: ?)

When I try Trial enterprise 9.4 version it fails with

254  [main] ERROR com.idc.publishing.commons.transformations.SaxonParserUtility  - SaxonParserUtilityErrorListener FATAL:
; SystemID: ; Line#: 932; Column#: 139
net.sf.saxon.trans.XPathException: Cannot find a matching 5-argument function named {com.idc.publishing.commons.transformations.mediahandler.MediaHandler}processMediaFile()

I did not change anything in our code so this static public method is still on classpath as before.
I tried to find out some quick solution but so far failed. According to info I found extension functions should still be supported
in Saxon EE.

Marek


---------- Původní zpráva ----------
Od: Michael Kay <mike@saxonica.com>
Datum: 15. 4. 2013
Předmět: Re: [saxon] Saxon does not find license on JBoss7


I'm not familiar with JBoss or how it configures the classpath. If WEB-INF/classes is on the classpath then I would expect it to be found, assuming there isn't some very non-standard ClassLoader coming into play.

Judging by the error message, this is not Saxon 9.4? A later release might give you better diagnostics.

There's a configuration option to set the license file location directly

Configuration.setConfigurationProperty(FeatureKeys.LICENSE_FILE_LOCATION)

But I'm not sure exactly when this was introduced.

Michael Kay
Saxonica






On 15 Apr 2013, at 14:01, <mslama@email.cz> <mslama@email.cz> wrote:

Hello,

not sure where to ask this question. We have problem with Saxon not able to find out license file in our web application
deployed on JBoss7.

We have license file at WEB-INF/classes/saxon-license.lic

When I run:
SchemaFactory factory = new com.saxonica.jaxp.SchemaFactoryImpl();

it fails with error:
2013-04-05 18:06:44,571 ERROR [stderr] (Thread-78) 
License file saxon-license.lic not found. Running in non-schema-aware 
mode

When I use following code snippet to load content of license file it works fine:
InputStream is = CreateFragment.class.getResourceAsStream("/saxon-license.lic");
logger.info("validateFragment is: " + is);
BufferedReader reader = new BufferedReader(new InputStreamReader(is, "UTF-8"));
String line;
while ((line = reader.readLine()) != null) {
logger.info("validateFragment line: " + line);
}

The same code (ie. SchemaFactory factory = new com.saxonica.jaxp.SchemaFactoryImpl();) works fine when run in unit test.

Is there any way how to investigate/workaround this? (I found some constructor SchemaFactoryImpl with configuration
parameter but it works only with OEM license.) Currently as workaround I use SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
which uses default JDK schema factory loaded by JBoss wrapper. Yes it works as we do not need specific Saxon functionality
for XML validation but still I would like to be able to use full Saxon version. We use Saxon 9.

Thanks

Marek




--
Marek Slamasaxon-license.lic
mslama@email.cz

------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help