简体   繁体   English

如何解决依赖于 WEB-INF/lib 中已有类的插件所需的 Tomcat Web 应用程序中的 JAR 冲突?

[英]How to solve a JAR conflict in Tomcat web app required for a plugin that has a dependency on a class already in WEB-INF/lib?

I built a plugin for a web app that uses tomcat.我为使用 tomcat 的 Web 应用程序构建了一个插件。 The plugin is registered as a servlet bean.该插件已注册为 servlet bean。 Now I want to use rabbitmq with the latest amqp client lib.现在我想将rabbitmq 与最新的amqp 客户端库一起使用。 Which has a dependency on classes in slf4j-api-1.7.25.jar.它依赖于 slf4j-api-1.7.25.jar 中的类。 Unfortunately the web app has also a dependency on slf4j but an older version.不幸的是,Web 应用程序也依赖于 slf4j,但版本较旧。 So adding the the new jar file crashes the web app.因此,添加新的 jar 文件会使 Web 应用程序崩溃。 Is there anything to rescue?有什么可以拯救的吗? I have two dependencies out of my control.我有两个无法控制的依赖项。

No.不。

Use an older version of the amqp client which has the dependencies you like.使用具有您喜欢的依赖项的旧版 amqp 客户端。

Then at your leisure upgrade the web app to the version of slf4j pulled in by the client.然后在闲暇时将 Web 应用程序升级到客户端拉入的 slf4j 版本。 Might even be due diligence.甚至可能是尽职调查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM