#1085 Saxon fails to initialize in some class loading environments

Michael Kay
Michael Kay

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.


  • Michael Kay
    Michael Kay

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