最近开发项目时需要嵌入一个公司的应用JAR包,结果一加到项目中就会报错

Caused by: java.lang.AbstractMethodError: javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V
	at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:234)
	at org.apache.ibatis.parsing.XPathParser.<init>(XPathParser.java:127)
	at org.apache.ibatis.builder.xml.XMLMapperBuilder.<init>(XMLMapperBuilder.java:81)
	at com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean.buildSqlSessionFactory(MybatisSqlSessionFactoryBean.java:592)
	at com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean.afterPropertiesSet(MybatisSqlSessionFactoryBean.java:430)
	at com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean.getObject(MybatisSqlSessionFactoryBean.java:628)
	at com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration.sqlSessionFactory(MybatisPlusAutoConfiguration.java:214)
	at com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration$$EnhancerBySpringCGLIB$$e9ef99b4.CGLIB$sqlSessionFactory$0(<generated>)
	at com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration$$EnhancerBySpringCGLIB$$e9ef99b4$$FastClassBySpringCGLIB$$ce85900b.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
	at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:363)
	at com.baomidou.mybatisplus.autoconfigure.MybatisPlusAutoConfiguration$$EnhancerBySpringCGLIB$$e9ef99b4.sqlSessionFactory(<generated>)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
	... 108 common frames omitted

刚开始以为看到AbstractMethodError就知道是引入的JAR中依赖的类和项目依赖有冲突,
DocumentBuilderFactory这个类是依赖于JDK的javax的基础包,查找资料发现JDK下rt包中的com.sun.org.apache.xerces.internal.jaxp也包含DocumentBuilderFactory,我们替换这个DocumentBuilderFactory的引用路径,在springboot的启动类中加入

@SpringBootApplication
public class AssetApplication {
	public static void main(String[] args) {
		System.setProperty("javax.xml.parsers.DocumentBuilderFactory","com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
		SpringApplication.run(AssetApplication.class, args);
System.setProperty("javax.xml.parsers.DocumentBuilderFactory","com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl");
                    解决AbstractMethodError问题最近开发项目时需要嵌入一个公司的应用JAR包,结果一加到项目中就会报错Caused by: java.lang.AbstractMethodError: javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V	at org.apache.ibatis.parsing.XPathParser.createDocument(XPathParser.java:234)	
					
javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V异常及解决办法-idea中jar包冲突解决方法
Spring+Jersey+Mybatis小实例,为了搭建这个折腾了两天,其中一天是因为jar包版本引起的,一直报异常:java.lang.AbstractMethodError: javax.ws.rs.core.UriBuilder.uri(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder; at javax.ws.rs.core.UriBuilder.fromUri(UriBuilder.java:119) 后来将Jersey改为1.3,spring改为3.0晕晕乎乎就好了。悲催
含建索引,内容检索(多种方式的检索),中文分词(IKAnalyzer、PaodingAnalyzer);Lucene采用3.03版,太新版和 ik paoding不兼容。 ----------------------------------------- 极易分词只支持1.9-2.4版,未测试 IKAnalyzer分词 2012版不支持,采用3.2.8版 在使用2012版时异常:ClassNotFoundException: org.apache.lucene.analysis.tokenattributes.CharTermAttribute 庖丁分词 使用 paoding-analysis-2.0.4-beta.zip 版时异常 Exception in thread "main" java.lang.AbstractMethodError: org.apache.lucene.analysis.TokenStream.incrementToken()Z 换用svn里源码版正常 http://paoding.googlecode.com/svn/trunk/paoding-analysis/
java.lang.AbstractMethodError: org.apache.xerces.dom.ElementNSImpl.setUserData(Ljava/lang/String;Ljava/lang/Object;Lorg/w3c/dom/UserDataHandler;)Ljava/lang/Object; at org.apache.cxf.staxutils.StaxUtil s.addLocation(StaxUtils.java:1038) at org.apache.cxf.staxutils.StaxUtils.startElement(StaxUtils.java:893) at org.apache.cxf.staxutils.StaxUtils.readDocElements(StaxUtils.java:965) at org.apache.cxf.staxutils.StaxUtils.read(StaxUtils.java:848) at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:219) at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:161) at org.apache.cxf.wsdl11.WSDLServiceFactory.(WSDLServiceFactory.java:67) at org.apache.cxf.endpoint.ClientImpl.(ClientImpl.java:152) at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:255) at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:198) at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:191) at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient 缺少jar包 xercesImpl-2_9_1.jar,或者把xerces.jar换成xercesImpl-2_9_1.jar
java.lang.NoSuchMethodError异常解决 报这种错误是由于jar包冲突,首先先检查pom.xml的依赖版本是否一致,比如spark报这个错误时,由于开始spark-hive_2.11使用的和spark那边使用的版本不一致导致的。 <dependency> <groupId>org.mongodb.spark</groupId> <artifactId>mongo-spark-connector_2.11</artifactId&
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE configuration PUBLIC "-//mybatis.org//DTD Config 3.0//EN" "http://mybatis.org/dtd/mybatis-3-config.dtd"> <!-- mybatis总配置文件 --> <configuratio
异常详情:Exception in thread "main" java.lang.AbstractMethodError: javax.xml.parsers.DocumentBuilderFactory.setFeature(Ljava/lang/String;Z)V分析:在系统中存在着多个解析器的时候,这时候程序是如何选择解析器的呢?   比如你引用了别人的jar包,很有可能不同的jar包
2.检查您的代码是否使用了不正确的 API 版本。请确保您的代码与您所使用的 XML 解析器版本兼容。 3.检查您的代码是否使用了不正确的类加载器。请确保您的代码使用了正确的类加载器来加载您的 XML 解析器。 4.如果您使用了 JDK9 及以上版本,则需要在模块描述文件中添加以下依赖项: <module>java.xml</module> </uses> 希望这些解决方法能够帮助您解决问题。 docker启动elasticsearch报错OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in