在maven工程中使用的了digester,但报了如下一个错误:
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@65b60280:java.lang.UnsupportedOperationException: This parser does not support specification “null” version “null”
Degister2.1和1.8都试过了,都不好使,网上说是很多情况下是因为sun和ibm的jaxp不同实现造成的,需要加jaxp.properties(javahome/jre/lib),还需要添加xerces-xxx.jar包。
我试过了加了jar包也是不行的,甚至于造成eclipse也无法启动的现象。后来发现在classpath下有两个xerces的不同版本的包,一个是我手动加的xercesImpl.jar,一个是xercesImpl-2.6.2.jar,删除xercesImpl-2.6.2.jar后OK了!
但这个xercesImpl-2.6.2.jar不是我主动引入的,一定是maven引用的其他的包依赖自动导入进来的。所以开始排查到底是那个包依赖了这个造成的。最后发现:
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle-jaxrs</artifactId>
<version>2.2.5</version>
</dependency>
对xerces有依赖,所以增加exclusion即可:
<exclusions>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusions>
至此,问题解决,困扰了一天的问题终于解决了!
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl@65b60280:java.lang.UnsupportedOperationException: This parser does not support specification “null” version “null”
Degister2.1和1.8都试过了,都不好使,网上说是很多情况下是因为sun和ibm的jaxp不同实现造成的,需要加jaxp.properties(javahome/jre/lib),还需要添加xerces-xxx.jar包。
我试过了加了jar包也是不行的,甚至于造成eclipse也无法启动的现象。后来发现在classpath下有两个xerces的不同版本的包,一个是我手动加的xercesImpl.jar,一个是xercesImpl-2.6.2.jar,删除xercesImpl-2.6.2.jar后OK了!
但这个xercesImpl-2.6.2.jar不是我主动引入的,一定是maven引用的其他的包依赖自动导入进来的。所以开始排查到底是那个包依赖了这个造成的。最后发现:
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-bundle-jaxrs</artifactId>
<version>2.2.5</version>
</dependency>
对xerces有依赖,所以增加exclusion即可:
<exclusions>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusions>
至此,问题解决,困扰了一天的问题终于解决了!