Community
Participate
Working Groups
When the JAXB deserializer encounters a node mapped with XmlAnyElement with DomHandler on a non-DOM property in the input XML, it creates a org.eclipse.persistence.platform.xml.jaxp.JAXPTransformer to process the node. org.eclipse.persistence.platform.xml.jaxp.JAXPTransformer.getTransformer() method will lazily create it's underlying transformer delegate by calling org.eclipse.persistence.platform.xml.jaxp.JAXPTransformer.TransformerFactoryHelper.getTransformerFactory(). This method in turn calls javax.xml.transform.TransformerFactory.newInstance() which runs an expensive discovery mechanism to create the TransformerFactory instance, especially with large projects with many jar files on the classpath. One possible solution would be to cache the TransformerFactory instance once created with javax.xml.transform.TransformerFactory.newInstance() I don't know yet how to provide a testcase for this, because, for the performance bottleneck to be noticeable, it requires a classpath with many jar files.
Just to be clear. The execution of the discovery mechanism happens at every node mapped with XmlAnyElement in the input, that's why it's cumulative cost can get very high depending on the input xml file.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink