javajarweb-inf

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. The plugin is registered as a servlet bean. Now I want to use rabbitmq with the latest amqp client lib. Which has a dependency on classes in slf4j-api-1.7.25.jar. Unfortunately the web app has also a dependency on slf4j but an older version. So adding the the new jar file crashes the web app. Is there anything to rescue? I have two dependencies out of my control.


Solution

  • No.

    Use an older version of the amqp client which has the dependencies you like.

    Then at your leisure upgrade the web app to the version of slf4j pulled in by the client. Might even be due diligence.