2010-07-18 22 views
1

我正在用Spring構建GWT應用程序。我有一些問題需要向我的一個Servlet注入依賴項,所以我試圖縮小可能出現的問題。Spring的ContentLoaderListener沒有在網絡應用程序中找到,但在系統類路徑中找到了

首先,我的應用程序啓動時,我得到:

[WARN]服務器類 'org.springframework.web.context.ContextLoaderListener' 無法在Web應用程序中找到,但 被發現在系統類路徑
[WARN]將類路徑條目 'file:/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 [WARN]服務器類 'org.apache.commons.collections.map.CaseInsensitiveMap' could未在網絡應用程序中找到,但在系統類路徑中找到
[WARN]添加類路徑條目 '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'至此 會話的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 Jul 18,2010 11:07:00 AM 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: display name [根 WebApplicationContext];啓動日期 [Sun Jul 18 11:07:00 ART 2010];上下文層次的根 2010年7月18日 上午11時07分00秒 org.springframework.context.support.AbstractApplicationContext obtainFreshBeanFactory INFO:豆 工廠應用上下文 [org.springframework.web.context.support.XmlWebApplicationContext @ 16b904d]: org.s[email protected]1a8dfb3 2010年7月18日上午11點07分01秒 org.springframework.beans.factory.support.DefaultListableBeanFactory 的preInstantiateSingletons INFO: 預實例單身在 org.s[email protected]1a8dfb3: 定義bean [ ]。工廠 層次7月18日的根,2010上午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> 

有沒有辦法知道,如果這兩個XML加載?

回答

1

掃描您的應用程序啓動日誌。您應該找到日誌,告訴您使用以下格式加載哪些上下文文件(日誌格式可能因日誌配置而異):

org.springframework.beans.factory.xml.XmlBeanDefinitionReader(315):加載XML bean定義從ServletContext的資源[/META-INF/spring-presentation.xml]

org.springframework.beans.factory.xml.XmlBeanDefinitionReader(315):從ServletContext的資源裝載XML bean定義[/ META-INF /彈簧的持久性.xml]

+0

與您的答案和http://stackoverflow.com/questions/3283884/spring-xml-files-outside-web-inf我解決了我的問題。謝謝。 – Macarse 2010-07-20 00:01:24

相關問題