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