美文网首页
[Maven依赖]maven库依赖中类冲突

[Maven依赖]maven库依赖中类冲突

作者: 芒果奶油卷 | 来源:发表于2021-03-31 17:42 被阅读0次

tomcat启动报错时,遇到异常

due to a StackOverflowError.

Possible root causes include a too low setting for -Xss and illegal cyclic inheritance dependencies.

The class hierarchy being processed was [org.bouncycastle.asn1.ASN1EncodableVector->org.bouncycastle.asn1.DEREncodableVector->org.bouncycastle.asn1.ASN1EncodableVector] 

此时点开target 中的项目中的WEB-INF\lib包,发现有类名重复并版本不一致

其中版本高者为maven 中导入的依赖包,版本低者为其他包中导入。此时,要去吃版本低的jar包。

首先,寻找是哪个依赖引入的,cmd 进入项目中,执行mvn install 后,再执行

mvn dependency:tree >  D:\maven.txt

类名格式:groupId:artifactId:jar:version:scope

点开文件夹,寻找到该类名,在依赖中去除该类

<dependency>

<groupId>com.alipay.sdk</groupId>

<artifactId>alipay-sdk-java</artifactId>

<version>4.13.0.ALL</version>

<exclusions>

      <exclusion>

      <groupId>org.bouncycastle</groupId>

      <artifactId>bcprov-jdk15on</artifactId>

      </exclusion>

</exclusions>

</dependency>

相关文章

网友评论

      本文标题:[Maven依赖]maven库依赖中类冲突

      本文链接:https://www.haomeiwen.com/subject/gnlahltx.html