#1085 Saxon fails to initialize in some class loading environments

v9.2
closed
Michael Kay
5
2012-10-08
2010-08-12
Michael Kay
No

In environments that use a non-standard class loader configuration, the initialization of the Configuration object may fail, typically reporting a failure to read the file edition.properties (which is contained in the issued JAR).

Some further information is at http://saxon.markmail.org/thread/wwljuixdww6fhd7w

Saxon is assuming that Configuration.class.getClassLoader() will return a class loader, which is normally the case. However, if the Configuration class was loaded by the bootstrap class loader, this call will return null. In this case Saxon triggers a NullPointerException, which it then catches, and reports a (somewhat spurious) failure to read edition.properties.

A patch is being raised which changes the strategy to attempt the following in turn:

(a) use Thread.currentThread().getContextClassLoader()

(b) use Configuration.class.getClassLoader()

(c) for the edition.properties file, use ClassLoader.getSystemResource(); for the classes named within edition.properties, use Class.forName().

Because the failure occurs only in rather specialized environments with non-standard class loading, it has not been possible to test all paths on the revised code. However, the "normal" cases appear to work without regression.

Discussion

  • Michael Kay
    Michael Kay
    2010-10-08

    Fixed in 9.2.1.5. (The patch has been user-tested with the eXist database, which was one environment where the problem occurred)