【问题标题】:Spring's ContentLoaderListener not found in the web-app but was found on the system classpath在 web-app 中找不到 Spring ContextLoaderListener 但在系统类路径中找到
【发布时间】:2010-07-18 14:27:41
【问题描述】:

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

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

[WARN] 服务器类 'org.springframework.web.context.ContextLoaderListener' 在网络应用程序中找不到,但是 在系统类路径中找到
[警告] 添加类路径条目 '文件:/home/macarse/.m2/repository/org/springframework/spring/2.5.6/spring-2.5.6.jar' 到此的网络应用程序类路径 会话有关其他信息,请参阅: 文件:/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' 在网络应用程序中找不到,但是 在系统类路径中找到
[警告] 添加类路径条目 'file:/home/macarse/tpf/eclipse/plugins/com.google.gwt.eclipse.sdkbundle.2.0.4_2.0.4.v201006301309/gwt-2.0.4/gwt-dev.jar' 到网络应用程序类路径这 会话有关其他信息,请参阅: 文件:/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 INFO:正在刷新 org.springframework.web.context.support.XmlWebApplicationContext@16b904d: 显示名称 [根 Web应用程序上下文];开始升级 [2010 年 7 月 18 日星期日 11:07:00 ART];根 上下文层次结构的 2010 年 7 月 18 日 上午 11:07:00 org.springframework.context.support.AbstractApplicationContext 获得FreshBeanFactory INFO: 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 preInstantiateSingletons 信息: 预实例化单例 org.springframework.beans.factory.support.DefaultListableBeanFactory@1a8dfb3: 定义bean [];工厂根 层次结构 2010 年 7 月 18 日上午 11:07:01 org.springframework.web.context.ContextLoader 初始化WebApplicationContext

这样好吗?

在我的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>

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

【问题讨论】:

    标签: spring gwt web.xml


    【解决方案1】:

    扫描您的应用程序启动日志。您应该找到日志,告诉您它以以下格式加载了哪些上下文文件(日志模式可能因您的日志配置而异):

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

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

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-12-17
    • 2019-02-27
    • 2018-06-03
    • 1970-01-01
    • 2013-08-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多