本人在做spring集成xfire時:報09:37:18,713 INFO [STDOUT] 09:37:18,698 ERROR [XFireServlet] Error initializing XFireServlet.
org.springframework.beans.factory.BeanDefinitionStoreException: Unrecognized xbean element mapping: beans in namespacehttp://xfire.codehaus.org/config/1.0錯誤。(錯誤只提取重部分)
自己也尋思了一天,想肯定不是jar的問題。而後查資料發現
原因是因爲xfire中內嵌的是spring1.2.8,而spring的1.X與2.X之間命名空間的方式改變了...
只用改xfire的services.xml就可以了
a:我原來的services.xml形式如下:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xfire.codehaus.org/config/1.0">
<service>
<name>getPnrInfo</name>
<serviceClass>com.rthb.hx.service.PnrService</serviceClass>
<implementationClass>
com.rthb.hx.service.PnrServiceImpl
</implementationClass>
<style>wrapped</style>
<use>literal</use>
<scope>application</scope>
</service></beans>
修改後爲:
<?xml version="1.0" encoding="UTF-8"?>
<beans>
<service xmlns="http://xfire.codehaus.org/config/1.0">
<name>getPnrInfo</name>
<serviceClass>com.rthb.hx.service.PnrService</serviceClass>
<implementationClass>
com.rthb.hx.service.PnrServiceImpl
</implementationClass>
<style>wrapped</style>
<use>literal</use>
<scope>application</scope>
</service>
</beans>
這樣就可以避免spring包的命名空間衝突了。