I just started looking into Camel, and started off with some out of the box examples. It works great when using mvn camel:run
. I am also trying to package this as one uber jar and be able to execute it from the command line.
I am using the Maven shade plugin to build the jar. When I try to execute it, I get this error:
Caused by: org.apache.cxf.BusException: No DestinationFactory was found for the namespace http://cxf.apache.org/transports/http.
at org.apache.cxf.transport.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:126)
at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:88)
at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:72)
at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:149)
I have these dependencies along with some others:
<properties>
<camel.version>2.8.0-fuse-04-01</camel.version>
<cxf.version>2.4.3-fuse-02-02</cxf.version>
</properties>
<dependency>
<groupId>org.apache.camel</groupId>
<artifactId>camel-cxf</artifactId>
<version>${camel.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http-jetty</artifactId>
<version>${cxf.version}</version>
</dependency>
Here is how the transformers are defined within the maven shade plugin:
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>org.apache.camel.spring.Main</mainClass>
</transformer>
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.handlers</resource>
</transformer
<transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
<resource>META-INF/spring.schemas</resource>
</transformer>
</transformers>
I don't know what I am missing. Can someone help me fix this issue? Please let me know of any alternative approaches.