无法在终端中找到XML架构命名空间错误的Spring NamespaceHandler

时间:2013-09-19 13:40:02

标签: java eclipse spring spring-mvc

在运行时,我的代码,在终端上,它会出现此错误

线程“main”中的异常java.lang.RuntimeException:org.springframework.beans.factory.parsing.BeanDefinitionParsingException:配置问题:无法找到XML架构命名空间的Spring NamespaceHandler [http://cxf.apache.org/芯

违规资源:类路径资源[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中有效。有谁知道问题可能是什么?

2 个答案:

答案 0 :(得分:3)

出现此问题是因为我的类路径中没有cxf-bundle JAR

你可以从这里得到它:http://mvnrepository.com/artifact/org.apache.cxf/cxf-bundle/2.7.6(最新版本)。

答案 1 :(得分:0)

我猜你在类路径中没有包含cxf架构的JAR 尝试将其添加到类路径