tomcat中運行正常的web項目部署至websphere後,spring無法獲取bean

在tomcat6上運行妥妥的,然後部署到websphere6.1上就報錯

org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type 

找不到bean,自己分析是web.xml監聽器沒有獲取到配置的beans-*.xml,web.xml中配置的監聽器如下:

<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:beans-*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

在網上搜了很久沒有眉目,於是自己寫了個簡單的web project,context-param中只加載一個beans.xml部署到websphere上運行沒問題,於是又採用通配符的方式,結果報相同的錯誤。初步得出結論是websphere不支持通配符的配置,於是在beans.xml中採用import標籤,部署後ok


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章