将 activemq 添加到我的 build.gradle 后,我收到以下运行时错误。
compile("org.apache.activemq:activemq-all:5.14.0")
我试图排除模块,但这似乎并没有像我预期的那样排除 logback。请告知我可以做些什么来排除 logback。另请注意,这是一个 kotlin 应用程序,但我认为这无关紧要。
compile("org.springframework.boot:spring-boot-starter-web:${springBootVersion}")
{
exclude module: "spring-boot-starter-logging"
exclude module: "logback-classic"
}
这是一个例外:
Exception in thread "main" java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.Log4jLoggerFactory loaded from file:/C:/Users/z037640/.gradle/caches/modules-2/files-2.1/org.apache.activemq/activemq-all/5.14.0/858a3bd95d20e7a8949006cdb50a7c362f8825ec/activemq-all-5.14.0.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml Object of class [org.slf4j.impl.Log4jLoggerFactory] must be an instance of class ch.qos.logback.classic.LoggerContext