码迷,mamicode.com
首页 > 编程语言 > 详细

hadoop-common-2.5.0和springfox-spring-web-2.9.2.jar,springfox-schema-2.9.2.jar冲突解决

时间:2020-03-20 10:54:27      阅读:222      评论:0      收藏:0      [点我收藏+]

标签:idea   file   依赖   jar   dep   dea   ros   mave   ltm   

spring boot 项目想要连接hive库的时候 需要导入两个jar包hadoop-common-2.5.1.jar和hive-jdbc-1.2.1

在导入的之后原来的项目启动报错具体如下 

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘apiDocumentationScanner‘ defined in URL [jar:file:/E:/ideaSpace/imps-qdhk/imps-run/target/imps/WEB-INF/lib/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/scanners/ApiDocumentationScanner.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘apiListingScanner‘ defined in URL [jar:file:/E:/ideaSpace/imps-qdhk/imps-run/target/imps/WEB-INF/lib/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/scanners/ApiListingScanner.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘apiModelReader‘ defined in URL [jar:file:/E:/ideaSpace/imps-qdhk/imps-run/target/imps/WEB-INF/lib/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/scanners/ApiModelReader.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘cachingModelProvider‘ defined in URL [jar:file:/E:/ideaSpace/imps-qdhk/imps-run/target/imps/WEB-INF/lib/springfox-schema-2.9.2.jar!/springfox/documentation/schema/CachingModelProvider.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘defaultModelProvider‘ defined in URL [jar:file:/E:/ideaSpace/imps-qdhk/imps-run/target/imps/WEB-INF/lib/springfox-schema-2.9.2.jar!/springfox/documentation/schema/DefaultModelProvider.class]: Unsatisfied dependency expressed through constructor parameter 2; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘cachingModelDependencyProvider‘ defined in URL [jar:file:/E:/ideaSpace/imps-qdhk/imps-run/target/imps/WEB-INF/lib/springfox-schema-2.9.2.jar!/springfox/documentation/schema/CachingModelDependencyProvider.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘defaultModelDependencyProvider‘: Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class 

 

1.百度搜索两个jar包冲突怎么办?没有解决方法。

2.百度搜索如何在idea上看pom依赖图?项目依赖过多,最后虽然看到了依赖相关但是没有红线。

3.尝试exclusion一些jar包可是并不知道哪些,只能随便去试,试了几个也没有用。

4.第二天问下一微信研发群里面的怎么解决,没人回,应该是没人遇到过。

5.尝试百度怎样解决jar包冲突,俗话说授人以鱼不如授人以渔,提供了思路找类

6.Unsatisfied dependency expressed through constructor parameter 0;网上说是由于在类里面定义了“有参构造方法”,这样的话就会覆盖原先的“无参构造方法”,所以会出现此异常。

发现异常类里面引用的类可能在其他jar包里面也有引用,找异常类的导入的相似类如下

技术图片

 

 发现好多都有Google相关 的于是在maven库https://mvnrepository.com/里发现其子依赖也有Google相关的jar如下

技术图片

 

 于是直接手动去除如下3个,项目可以重新跑起来了。

<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</exclusion>
<exclusion>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</exclusion>
</exclusions>

为了避免后来遇到此问题的人浪费时间,遂写下此博客供后来的人参考!

 解决后参考 :https://blog.csdn.net/noaman_wgs/article/details/81137893?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task

 

hadoop-common-2.5.0和springfox-spring-web-2.9.2.jar,springfox-schema-2.9.2.jar冲突解决

标签:idea   file   依赖   jar   dep   dea   ros   mave   ltm   

原文地址:https://www.cnblogs.com/beautyscenery/p/12529871.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!