不明原因抛出 异常如下
org.springframework.beans.factory.BeanDefinitionStoreException: Unrecognized xbean namespace mapping: http://XFire.codehaus.org/config/1.0
org.apache.xbean.spring.context.v1.XBeanXmlBeanDefinitionParser.parseBeanFromExtensionElement(XBeanXmlBeanDefinitionParser.java:182)
org.apache.xbean.spring.context.v1.XBeanXmlBeanDefinitionParser.parseBeanDefinitions(XBeanXmlBeanDefinitionParser.java:807)
org.springframework.beans.factory.xml.DefaultXmlBeanDefinitionParser.registerBeanDefinitions(DefaultXmlBeanDefinitionParser.java:191)
org.apache.xbean.spring.context.v1.XBeanXmlBeanDefinitionReader.registerBeanDefinitions(XBeanXmlBeanDefinitionReader.java:78)
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:223)
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:173)
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:148)
org.codehaus.xfire.spring.XFireConfigLoader.getXFireApplicationContext(XFireConfigLoader.java:103)
org.codehaus.xfire.spring.XFireConfigLoader.loadContext(XFireConfigLoader.java:41)
org.codehaus.xfire.transport.http.XFireConfigurableServlet.loadConfig(XFireConfigurableServlet.java:86)
org.codehaus.xfire.transport.http.XFireConfigurableServlet.createXFire(XFireConfigurableServlet.java:54)
org.codehaus.xfire.transport.http.XFireServlet.init(XFireServlet.java:45)
javax.servlet.GenericServlet.init(GenericServlet.java:211)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
java.lang.Thread.run(Unknown Source)
估计问题出在配置文件 services.xml
查阅官方文档,发现 xmlns="http://xfire.codehaus.org/config/1.0"> 是全部小写,立即替换,解决!
以下是一个实例
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xfire.codehaus.org/config/1.0">
<service>
<name>HelloWorldService</name>
<namespace>http://localhost:8080/HelloService</namespace>
<serviceClass>
com.tom.pojo.HelloService
</serviceClass>
<implementationClass>
com.tom.pojo.HelloServiceImp
</implementationClass>
</service>
</beans>