I want to create an uber JAR for a CXF-based application server. I want to run the server from the commandline with java -jar
. In the IDE, I can run the main class com.connexta.desertcodecamp.Server
, but I am not correctly creating the uber jar.
When I run the command java -jar server-1.0-SNAPSHOT.jar
, I get
org.apache.cxf.service.factory.ServiceConstructionException
at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:215)
at com.connexta.desertcodecamp.Server.<init>(Server.java:19)
at com.connexta.desertcodecamp.Server.main(Server.java:33)
Caused by: org.apache.cxf.BusException: No DestinationFactory was found for the namespace http://cxf.apache.org/transports/http.
at org.apache.cxf.bus.managers.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:122)
at org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:79)
at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:63)
at org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:170)
Here is a link to the POM file (and GitHub repo): https://github.com/ahoffer/desert-code-camp/blob/master/server/pom.xml
Other posts reference a missing dependency, cxf-rt-transports-http
, but I have that as a dependency in the POM.xml.