Class ReportsEnvironmentPostProcessor

java.lang.Object
io.jmix.reports.libintegration.ReportsEnvironmentPostProcessor
All Implemented Interfaces:
org.springframework.boot.EnvironmentPostProcessor

public class ReportsEnvironmentPostProcessor extends Object implements org.springframework.boot.EnvironmentPostProcessor
Keeps the JDK TransformerFactory and SchemaFactory as the default ones of the application.

The Reports dependencies register old XML processors as JAXP service providers: Xalan, including the copy repackaged by docx4j, as the TransformerFactory and Xerces as the SchemaFactory. The registrations make them the default factories of the whole application, although docx4j creates its Xalan factory by class name. These processors do not support the JAXP 1.5 external access properties, so libraries that set them fail, for example Hazelcast when it reads its XML configuration.

When such a processor is the default factory and the corresponding system property is not set, the property is set to the JDK factory. This also replaces a processor set in a JAXP configuration file, such as jaxp.properties, because the system property takes precedence over the file. The post-processor runs before the application context is created, so the property is in place before any bean uses JAXP. The JDK factory is used rather than another registered provider because the property applies to the whole JVM, and only the JDK factory is available to every application in it. To keep another factory, set the system property explicitly.

  • Constructor Details

    • ReportsEnvironmentPostProcessor

      public ReportsEnvironmentPostProcessor(org.springframework.boot.logging.DeferredLogFactory logFactory)
  • Method Details

    • postProcessEnvironment

      public void postProcessEnvironment(org.springframework.core.env.ConfigurableEnvironment environment, org.springframework.boot.SpringApplication application)
      Specified by:
      postProcessEnvironment in interface org.springframework.boot.EnvironmentPostProcessor