I am creating JAX-RS application with Apache CXF, Apache Camel and Spring with Maven. When I run the application it is creating an embedded jetty and serving the request.
I want to remove embedded jetty and run it on standalone Tomcat using war file. I tried many suggestions available but not working in my case. Please give any suggestion for the same.
My POMs contains
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-transports-http</artifactId>
<version>2.7.6</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxrs</artifactId>
<version>2.7.6</version>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlets</artifactId>
<version>8.1.3.v20120416</version>
</dependency>
<build>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>8.1.12.v20130726</version>
<configuration>
<scanIntervalSeconds>5</scanIntervalSeconds>
<webApp>
<contextPath>myfashions</contextPath>
<defaultsDescriptor>
${basedir}/src/main/resources/webdefault.xml
</defaultsDescriptor>
</webApp>
</configuration>
</plugin>
</build>
When I run this using jetty:run with port 8081 from intellij idea , my appplication is starting another embedded jetty server on port 8080 and serving requests.
When I remove all jetty dependencies and plugins and deploy generated WAR in tomcat, I am getting error as
013-09-06_01:21:21 ERROR o.a.c.t.http.HTTPTransportFactory - Cannot find any registered HttpDestinationFactory from the Bus.
Sep 06, 2013 1:21:21 AM org.springframework.web.context.ContextLoader initWebApplicationContext
SEVERE: Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'baseApi': Invocation of init method failed; nested exception is org.apache.cxf.service.factory.ServiceConstructionException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1482)
Please suggest a way so that I can genarate WAR which runs inside tomcat without starting embedded jetty.