我试图用 Spring 加载 Tomcat 服务器但失败并出现错误(见下文),我只使用一个 zip 用于 spring:spring-core-3.1.1.RELEASE.jar 并在 web.xml 中进行了非常基本的配置任何帮助将不胜感激.
提前谢谢。严
网页.xml:
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/config/controllers.xml
</param-value>
</context-param>
错误:
严重:向 org.springframework.web.context.ContextLoaderListener java.lang.NoSuchMethodError 类的侦听器实例发送上下文初始化事件的异常:org.springframework.web.context.ConfigurableWebApplicationContext.setId(Ljava/lang/String;)V at org. springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:369) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:284) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener. java:111) 在 org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779) 在 org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273) 在 org.apache.catalina.util .LifecycleBase.start(LifecycleBase.java:150) 在组织。apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566) 在 org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556) 在 java.util.concurrent.FutureTask$Sync。 innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source ) 在 java.lang.Thread.run(Unknown Source)runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)