Calling Order for Resolvers

The JDK XML processors call a custom resolver before the catalog resolver.

Custom Resolver Preferred to Catalog Resolver

The catalog resolver (defined by the CatalogResolver interface) can be used to resolve external references by the JDK XML processors to which a catalog file has been set. However, if a custom resolver is also provided, then it’s always be placed ahead of the catalog resolver. This means that a JDK XML processor first calls a custom resolver to attempt to resolve external resources. If the resolution is successful, then the processor skips the catalog resolver and continues. Only when there’s no custom resolver or if the resolution by a custom resolver returns null, does the processor then call the catalog resolver.

For applications that use custom resolvers, it’s therefore safe to set an additional catalog to resolve any resources that the custom resolvers don’t handle. For existing applications, if changing the code isn’t feasible, then you may set a catalog through the system property or jaxp.properties file to redirect external references to local resources knowing that such a setting won’t interfere with existing processes that are handled by custom resolvers.