Search code examples
cxfcxf-client

CXF not using the bus from the Spring config


I have a standalone java application that uses cxf. I have some features to be added into the bus. thus I added a feature (implementing AbstractFeature) and injecting some headers to outgoing messages. The clients to the endpoints are defined in a core module of my project.

This is working pretty well on containers like tomcat etc.. I can see the injection done and my app working expectedly. But when it comes to the standalone java app. The bus again getting configured with the same feature class. But the requests are not going through the bus. Because the injection class is not triggered while I am debugging it.


Solution

  • well the issue was with some missing libraries. CXF runtime frontend jaxws library is the key to get your bus used. for maven; adding below dependency solves the issue

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