0
我試圖用Spring來配置一個部署在JBoss中的web應用程序。我把這個添加到web.xml:在默認的戰爭中使用JBoss配置中的Spring ContextLoaderListener
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
不過,我根據我的「默認」 JBoss的配置,其中包括戰爭,如JMX-console.war配置,現在這些失敗部署與錯誤:
[ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from ServletContext resource [/WEB-INF/applicationContext.xml]; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/applicationContext.xml]
所以,我怎麼能告訴的ContextLoaderListener忽略這個錯誤,或者至少繞過這些特殊的戰爭,同時仍試圖處理我自己的戰爭?
我不確定我是否關注你...你是說我必須添加一個/WEB-INF/applicationContext.xml到所有.war文件,即使它只是一個空文件? jboss默認設置包括6個戰爭:admin-console.war,http-invoker.sar/invoker.war,jbossws.sar/jbossws-management.war,jmx-console.war,management/console-mgr.war和ROOT 。戰爭。我已經解決了這個問題(添加一個空的applicationContext.xml),只是想要改變這些隨jboss默認並且永遠不會有任何spring配置的war。 – 2009-12-08 18:19:47
不,我的意思是你必須有ContextLoaderListener只聲明你的應用程序,而不是全部 – Bozho 2009-12-08 18:31:26
哦!出於某種原因,我誤解了你唯一可以添加過濾器的地方是在jbossweb.deployer下的web.xml中。謝謝,那當然是正確的解決方案! – 2009-12-08 19:46:36