Spring 弹簧&x27;在web应用程序中找不到s ContentLoaderListener,但在系统类路径中找到了

Spring 弹簧&x27;在web应用程序中找不到s ContentLoaderListener,但在系统类路径中找到了,spring,gwt,web.xml,Spring,Gwt,Web.xml,我正在用Spring构建一个GWT应用程序。我在向我的一个servlet注入依赖项时遇到了一些问题,因此我试图缩小可能出现的问题 首先,当我的应用程序启动时,我得到: [警告]服务器类 'org.springframework.web.context.ContextLoaderListener' 在web应用中找不到,但 已在系统类路径上找到 [警告]正在添加类路径项 '文件:/home/macarse/.m2/repository/org/springframework/spring/2.5.

我正在用Spring构建一个GWT应用程序。我在向我的一个servlet注入依赖项时遇到了一些问题,因此我试图缩小可能出现的问题

首先,当我的应用程序启动时,我得到:

[警告]服务器类 'org.springframework.web.context.ContextLoaderListener' 在web应用中找不到,但 已在系统类路径上找到
[警告]正在添加类路径项 '文件:/home/macarse/.m2/repository/org/springframework/spring/2.5.6/spring-2.5.6.jar' 指向此应用程序的web应用程序类路径 会话有关更多信息,请参阅: 文件:/home/macarse/tpf/eclipse/plugins/com.google.gwt.eclipse.sdkbundle.2.0.4_2.0.4.v201006301309/gwt-2.0.4/doc/helpInfo/webAppClassPath.html [警告]服务器类 'org.apache.commons.collections.map.CaseInsensitiveMap' 在web应用中找不到,但 已在系统类路径上找到
[警告]正在添加类路径项 '文件:/home/macarse/tpf/eclipse/plugins/com.google.gwt.eclipse.sdkbundle.2.0.4_2.0.4.v201006301309/gwt-2.0.4/gwt-dev.jar'指向此web应用程序的类路径' 会话有关更多信息,请参阅: 文件:/home/macarse/tpf/eclipse/plugins/com.google.gwt.eclipse.sdkbundle.2.0.4_2.0.4.v201006301309/gwt-2.0.4/doc/helpInfo/webAppClassPath.html 2010年7月18日上午11:07:00 org.springframework.web.context.ContextLoader initWebApplicationContext信息:根 WebApplicationContext:初始化 开始于2010年7月18日上午11:07:00 org.springframework.context.support.AbstractApplicationContext prepareRefresh信息:刷新 org.springframework.web.context.support。XmlWebApplicationContext@16b904d: 显示名称[根目录] WebApplicationContext];启动日期 [太阳7月18日11:07:00艺术2010];根 上下文层次结构的定义2010年7月18日 上午11:07:00 org.springframework.context.support.AbstractApplicationContext 获取FreshBean工厂信息:Bean 应用程序上下文的工厂 [org.springframework.web.context.support。XmlWebApplicationContext@16b904d]: org.springframework.beans.factory.support。DefaultListableBeanFactory@1a8dfb3 2010年7月18日上午11:07:01 org.springframework.beans.factory.support.DefaultListableBeanFactory 预实例化单例信息: 在中预实例化单例 org.springframework.beans.factory.support。DefaultListableBeanFactory@1a8dfb3: 定义bean[];工厂之根 层次结构2010年7月18日上午11:07:01 org.springframework.web.context.ContextLoader initWebApplicationContext

可以吗

在我的
web.xml
中,我有:

<listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
        classpath*:/META-INF/spring-presentation.xml, classpath*:/META-INF/spring-persistence.xml
    </param-value>
</context-param>

org.springframework.web.context.ContextLoaderListener
上下文配置位置
classpath*:/META-INF/spring-presentation.xml,classpath*:/META-INF/spring-persistence.xml

有没有办法知道这两个xml是否已加载?

扫描应用程序启动日志。您应该可以找到日志,这些日志告诉您它以以下格式加载了哪些上下文文件(根据您的日志配置,日志模式可能会有所不同):

org.springframework.beans.factory.xml.XmlBeanDefinitionReader(315):从ServletContext资源[/META-INF/spring presentation.xml]加载xml bean定义


org.springframework.beans.factory.xml.XmlBeanDefinitionReader(315):从ServletContext资源[/META-INF/spring persistence.xml]加载xml bean定义扫描应用程序启动日志。您应该可以找到日志,这些日志告诉您它以以下格式加载了哪些上下文文件(根据您的日志配置,日志模式可能会有所不同):

org.springframework.beans.factory.xml.XmlBeanDefinitionReader(315):从ServletContext资源[/META-INF/spring presentation.xml]加载xml bean定义

org.springframework.beans.factory.xml.XmlBeanDefinitionReader(315):使用您的答案从ServletContext资源[/META-INF/spring persistence.xml]

加载xml bean定义,我解决了我的问题。谢谢你的回答,我解决了我的问题。谢谢