Spring基础xfire报:报 Error initializing XFireServlet.

来源:互联网 发布:赞美女生的网络句子 编辑:程序博客网 时间:2024/05/20 07:58

本人在做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包的命名空间冲突了。