2009-12-09 66 views
2

将使用Apache CXF RESTful服务于我的春节(和检票)项目中,我得到下面的异常后:CXF JAX-RS导致BusException

org.apache.cxf.BusException:命名空间没有约束力厂http://apache.org/cxf/binding/jaxrs已注册。

我已经在我的Spring配置中包含了下面的行,并认为这实际上可以解决我的问题。但事实并非如此。

进口来源= “类路径:META-INF/CXF/CXF波及JAXRS-binding.xml”

关于如何解决这个问题或想法在看哪些方面的解决方案的任何反馈将非常感激。

我使用Spring 3.0.0.RC2和Apache CXF 2.2.5。 (Maven依赖于org.springframework.core,org.springframework.test,org.springframework.orm,org.springframework.web和CXF束。)

预先感谢。

回答

1

问题通过将Spring降级到版本2.5.6来解决。

0

我有同样的问题。 我有这三瓶当依赖于我的pom.xml

<dependency> 
     <groupId>org.apache.cxf</groupId> 
     <artifactId>cxf-rt-frontend-jaxws</artifactId> 
     <version>${cxf.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.apache.cxf</groupId> 
     <artifactId>cxf-rt-transports-http</artifactId> 
     <version>${cxf.version}</version> 
    </dependency> 

    <dependency> 
     <groupId>org.apache.cxf</groupId> 
     <artifactId>cxf-rt-databinding-aegis</artifactId> 
     <version>${cxf.version}</version> 
    </dependency> 

我的问题被删除这些依赖条件解决。

2

真的,我只需输入您在主application-context.xml文件中提到的资源解决了这个问题:

<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" /> 

我使用Spring 4.1.0.RELEASE和CXF 2.2.3。

在过去,当我使用Spring 3.0和Apacy CXF 2.2.2时,我不需要导入这个文件。但现在我主要在application-context.xml文件中有以下情况:

<import resource="classpath:META-INF/cxf/cxf.xml" /> 
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> 
<import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> 
<import resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" /> 

它对我来说工作正常。

相关问题