Spring MVC错误,显示“ NoSuchMethodError”

我收到以下错误。

请给我一些建议。

我正在使用spring sts

SEVERE: StandardWrapper.Throwable java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApplicationContext.getEnvironment()Lorg/springframework/web/context/ConfigurableWebEnvironment;

at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:641)

at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:598)

at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:661)

at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:517)

at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:458)

at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:138)

at javax.servlet.GenericServlet.init(GenericServlet.java:158)

at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1241)

at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1154)

at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:827)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:135)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)

at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)

at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:610)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:537)

at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1085)

at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:658)

at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:222)

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1556)

at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1513)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)

at java.lang.Thread.run(Thread.java:745)

回答:

您使用不兼容的库。执行的代码是针对spring

API(ABI)的一个版本编译的,但是在运行时存在不同的版本。确保您的应用程序中没有包含同一库的其他版本或较新版本。当使用诸如Maven之类的工具构建应用程序时,这通常是一种情况。

以上是 Spring MVC错误,显示“ NoSuchMethodError” 的全部内容, 来源链接: utcz.com/qa/398813.html

回到顶部