Caused by: java.lang.AbstractMethodError: org.apache.xerces.jaxp.DocumentBuilder

阅读更多

 

异常信息:Caused by: java.lang.AbstractMethodError: org.apache.xerces.jaxp.DocumentBuilderFactoryImpl.setFeature(Ljava/lang/String;Z)V 

异常原因:在系统中存在着多个解析器的时候,这时候程序无法选择解析器。需要人工指定解析器。 

解决方案:System.setProperty("javax.xml.parsers.DocumentBuilderFactory","com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl"); 

 

异常信息举例:

信息: Loading 'hazelcast-default.xml' from the classpath.
Exception in thread "main" java.lang.AbstractMethodError: javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V
	at com.hazelcast.config.XmlConfigBuilder.parse(XmlConfigBuilder.java:188)
	at com.hazelcast.config.XmlConfigBuilder.parseAndBuildConfig(XmlConfigBuilder.java:154)
	at com.hazelcast.config.XmlConfigBuilder.build(XmlConfigBuilder.java:146)
	at com.hazelcast.config.XmlConfigBuilder.build(XmlConfigBuilder.java:139)
	at com.hazelcast.instance.HazelcastInstanceFactory.newHazelcastInstance(HazelcastInstanceFactory.java:153)
	at com.hazelcast.core.Hazelcast.newHazelcastInstance(Hazelcast.java:91)
	at Test.test013(Test.java:36)
	at Test.main(Test.java:28)

 

你可能感兴趣的:(Caused by: java.lang.AbstractMethodError: org.apache.xerces.jaxp.DocumentBuilder)