java.lang.NoSuchMethodError:LocationAwareLogger.log(Lorg / slf4j / Marker; Ljava / lang / String; ---



Java Lang Nosuchmethoderror



Maven起動プロジェクトエラー、log4jバージョンの問題:

Critical: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/MarkerLjava/lang/StringILjava/lang/String[Ljava/lang/ObjectLjava/lang/Throwable)V at org.apache.commons.logging.impl.SLF4JLocationAwareLog.info(SLF4JLocationAwareLog.java:159) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:285) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4797) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5221) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1408) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1398) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) May 29, 2019 5:00:44 PM org.apache.catalina.core.StandardContext startInternal Critical: Error listenerStart May 29, 2019 5:00:44 PM org.apache.catalina.core.StandardContext startInternal Critical: Context [] startup failed due to previous errors May 29, 2019 5:00:44 PM org.apache.catalina.core.ApplicationContext log Information: Closing Spring root WebApplicationContext May 29, 2019 5:00:44 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc Warning: The web application [] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. May 29, 2019 5:00:44 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc Warning: The web application [] registered the JDBC driver [com.mysql.fabric.jdbc.FabricMySQLDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. May 29, 2019 5:00:44 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc Warning: The web application [] registered the JDBC driver [com.alibaba.druid.proxy.DruidDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. May 29, 2019 5:00:44 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesJdbc Warning: The web application [] registered the JDBC driver [com.alibaba.druid.mock.MockDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered. May 29, 2019 5:00:44 PM org.apache.catalina.loader.WebappClassLoaderBase clearReferencesThreads Warning: The web application [] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.lang.Object.wait(Native Method) java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:144) com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:41) May 29, 2019 5:00:44 PM org.apache.coyote.AbstractProtocol start Information: Starting ProtocolHandler ['http-nio-8080']

解決する:



jdk1.8とtomcat8を使用し、mavenを使用してエラーの報告を開始しました。log4jのバージョンが低すぎます。バージョンを1.6以上にアップグレードしてください。

|_+_|