Apache CXF RS Extensions issue in 2.4.0
Asked Answered
E

2

17

I'm using Apache CXF version 2.4.0. I'm trying to create a Restful service.

The below example works in 2.3.4 but does not work in 2.4.0. What should I do different in beans config file?

When I include the below xml line in my bean config file.

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

I get the following stacktrace error:

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to import bean definitions from URL location [classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml]

Offending resource: ServletContext resource [/WEB-INF/beans.xml]; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException:

IOException parsing XML document from class path resource [META-INF/cxf/cxf-extension-jaxrs-binding.xml]; nested exception is java.io.FileNotFoundException: class path resource [META-INF/cxf/cxf-extension-jaxrs-binding.xml] cannot be opened because it does not exist at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)

My POM dependency is below. This will work for 2.3.4 but not for 2.4.0. Any suggestions? Is that xml extension line deprecated or included in another jar?

    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-bundle-jaxrs</artifactId>
        <version>2.3.4</version>
        <exclusions>
            <exclusion>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-server</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
Eyebrow answered 14/6, 2011 at 20:5 Comment(0)
G
30

It's no longer needed. With 2.4.x, most of the META-INF/cxf files are no longer needed and can be removed. Really, the cxf.xml one is the only one needed.

Gravel answered 15/6, 2011 at 1:26 Comment(1)
It didn't work for me... I am not able to send the json like I was doing it when I had apache 2.2.3 version. Getting the response as "No message body writer has been found for response class". Suggest somethingPotbelly
N
1

Here is the CXF information about embedding cxf inside spring in version 2.4 and above. http://cxf.apache.org/docs/embedding-cxf-inside-spring.html

Nystatin answered 18/10, 2012 at 10:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.