在运行时,我的代码,在终端上,它给出了这个错误
线程“main”中的异常java.lang.RuntimeException:org.springframework.beans.factory.parsing.BeanDefinitionParsingException:配置问题:无法找到XML架构命名空间的Spring NamespaceHandler [http://cxf.apache.org/core]
违规资源:类路径资源[Meta-INF / test.xml]
我的test.xml文件是
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:context="http://www.springframework.org/schema/context" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cxf="http://cxf.apache.org/core" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd"> <bean id="clientI" class="LI" /> <bean id="clientL" class="LIn" /> <cxf:bus> <cxf:outInterceptors> <ref bean="clientI" /> </cxf:outInterceptors> <cxf:inInterceptors> <ref bean="clientL" /> </cxf:inInterceptors> </cxf:bus> </beans>
但是相同的代码在eclipse中有效.有谁知道问题可能是什么?
解决方法
出现此问题的原因是我的类路径中不存在cxf-bundle JAR
你可以从这里得到它:http://mvnrepository.com/artifact/org.apache.cxf/cxf-bundle/2.7.6(最新版本).