Skip to content

Unable to create XsltPayloadTransformer when Saxon HE is in the classpath. #2723

Closed
@stoussaint

Description

@stoussaint

Affects Version(s): 4.3.19.RELEASE


After upgrading to spring-integration-xml:4.3.19.RELEASE (from 4.3.18.RELEASE), my application failed to start with the following exception :

Error creating bean with name 'XsltPayloadTransformer': Invocation of init method failed;

...

Caused by: java.lang.IllegalArgumentException: Unknown configuration property http://javax.xml.XMLConstants/property/accessExternalDTD

The cause of the exception seems to be related to the following changes

- transformerFactory = TransformerFactory.newInstance();
+ transformerFactory = TransformerFactoryUtils.newInstance();

The TransformerFactoryUtils.newInstance() force the XMLConstants.ACCESS_EXTERNAL_DTD property which doesn't seems to be supported by Saxon. If I quote answers from Michael Kay about similar subject, I understand that Saxon does not handle Xml Parser related properties.

Saxon doesn't have control of the XML parsing: we invoke the parser that the application supplies and configures.

As the problem is related to a third party dependency, I provide a side sample project as a regression test case

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions