异常:org.xml.sax.SAXNotSupportedException: not supported setting property http://xml.org/sax/properties/lexical-handler
最近手头的项目需要切换成spring boot ,启动过程中出现 org.xml.sax.SAXNotSupportedException: not supported setting property http://xml.org/sax/properties/lexical-handler 异常,经搜索找到:http://apache-fop.1065347.n5.nabble.com/org-xml-sax-SAXNotSupportedException-thrown-by-FOP-td11447.html
The cause is an incompatibility of the GNU XML parser with Apache Xalan.
If you can change the environment such that Apache Xerces is used as
an XML parser instead, the problem should disappear.
The Xerces JARs are shipped with FOP, but your Java VM bootstraps the
GNU parser implementation, which lacks support for SAX features that
Xalan requires (a LexicalHandler implementation).
就是将 XML parser 切换成 Apache Xerces 即可,找到项目中可能存在XML parser 依赖,过滤即可。
所以直接将项目中的Dom4 依赖修改为
<dependency> <groupId>org.dom4j</groupId> <artifactId>dom4j</artifactId> <version>2.0.0-RC1</version> <exclusions> <exclusion> <artifactId>pull-parser</artifactId> <groupId>pull-parser</groupId> </exclusion> </exclusions> </dependency>
问题解决