2009-12-09 68 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" /> 

它對我來說工作正常。

相關問題