gpt4 book ai didi

java.lang.NoSuchMethodError : ch. qos.logback.core.rolling.helper.FileNamePattern.getDateTokenConverter() 问题

转载 作者:行者123 更新时间:2023-11-30 08:34:03 27 4
gpt4 key购买 nike

我正在为我的应用程序使用以下内容:-

[INFO] +- ch.qos.logback:logback-core:jar:1.1.7:compile
[INFO] +- ch.qos.logback:logback-classic:jar:1.1.7:compile
[INFO] +- log4j:log4j:jar:1.2.13:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO] +- org.slf4j:jcl-over-slf4j:jar:1.6.1:compile

当我用我的应用程序启动 tomcat 时。我收到以下错误:-

Failed to instantiate [ch.qos.logback.classic.LoggerContext]
Reported exception:
java.lang.NoSuchMethodError: ch.qos.logback.core.rolling.helper.FileNamePattern.getDateTokenConverter()Lch/qos/logback/core/rolling/helper/DateTokenConverter;
at ch.qos.logback.core.rolling.IntervalledTimeBasedFileNamingAndTriggeringPolicyBase.start(IntervalledTimeBasedFileNamingAndTriggeringPolicyBase.java:24)
at ch.qos.logback.core.rolling.SizeAndIntervalledTimeBasedFNATP.start(SizeAndIntervalledTimeBasedFNATP.java:21)
at ch.qos.logback.core.rolling.TimeBasedRollingPolicy.start(TimeBasedRollingPolicy.java:95)
at ch.qos.logback.core.joran.action.NestedComplexPropertyIA.end(NestedComplexPropertyIA.java:161)
at ch.qos.logback.core.joran.spi.Interpreter.callEndAction(Interpreter.java:309)
at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:193)
at ch.qos.logback.core.joran.spi.Interpreter.endElement(Interpreter.java:179)
at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:62)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:155)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:142)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:103)
at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:53)
at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:75)
at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:156)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:132)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:645)
at org.springframework.core.SpringProperties.<clinit>(SpringProperties.java:51)
at org.springframework.beans.CachedIntrospectionResults.<clinit>(CachedIntrospectionResults.java:97)
at org.springframework.web.util.IntrospectorCleanupListener.contextInitialized(IntrospectorCleanupListener.java:75)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4716)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5178)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
SLF4J: The requested version 1.7.16 by your slf4j binding is not compatible with [1.6]

当我在 logback 中搜索 "ch.qos.logback.core.rolling.helper.FileNamePattern.getDateTokenConverter()" 时。我开始知道这种方法在 logback 较新版本中无效。

它的解决方法是什么?

最佳答案

似乎 tomcat 加载了多个版本的 logback。 stacktrace 中引用的代码已于 2011 年在此 commit 中删除.所以你必须检查 tomcat 加载的库或将你的 logback 版本降级到 1.0.0

关于java.lang.NoSuchMethodError : ch. qos.logback.core.rolling.helper.FileNamePattern.getDateTokenConverter() 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39099385/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com