In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to solve the jar package version conflict". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to solve the jar package version conflict".
Troubleshooting:
1) check the version of the jar package:-XX:+TraceClassLoading or-verbose:class2) find the conflicting jar package: 1 > under the Maven Projects view in idea, click the 9th icon (show dependencies) on the toolbar, and a graph showing the dependency of the jar package will appear in a moment. 2 > the red solid line indicates that there is a conflict (the conflict can be resolved by right-clicking Exclude), and the red dotted line indicates the place where the same jar is referenced multiple times.
Resolve:
1) remove the unwanted version provided from pom and avoid version conflicts as much as possible in the packaging phase. 2) if a conflict occurs, the jar package of the Exclude conflict is fine.
For example:
Question: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: com.google.common.base.Splitter.splitToList (Ljava/lang/CharSequence;) Ljava/util/List Troubleshooting:-XX:+TraceClassLoading or-verbose:class results: [Loaded com.google.common.base.Splitter from file:/E:/Tomcat/apache-tomcat-8.0.33/webapps/advertise-management-control/WEB-INF/lib/guava-11.0.2.jar] found two jar packages of guava under / apache-tomcat-8.0.33/webapps/ROOT/WEB-INF/lib/: guava-11 .0.2.jar and guava-19.0.jar solution: through the show dependencies function of idea It is found that there are two dependencies that reference guava-11 and guava-19,splitToList, respectively, which is the method provided by guava-19, so we solved the problem by guava Exclude in the dependency of referencing guava-11.
Add:
Under the Maven Projects view in idea: 1) Click the ninth icon (show dependencies) on the toolbar, and a graph showing jar package dependencies will appear in a moment. 2) the red solid line indicates a conflict (the conflict can be resolved by right-clicking Exclude), and the red dotted line indicates the place where the same jar is referenced multiple times. Note: 1 > after the conflicting jar package of Exclude, you need to manually delete the project under the webapps directory of tomcat, and then redeploy. Otherwise, there are likely to be conflicting jar packages under\ webapps\ project-name\ WEB-INF\ lib. 2 > it is not reliable to use mvn dependency:tree to view the dependencies between jar packages, so it is recommended to use the features provided by idea. Thank you for your reading, the above is the content of "how to solve the jar package version conflict". After the study of this article, I believe you have a deeper understanding of how to solve the problem of jar package version conflict, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.