root.addEventListener(new ContextLoaderListener());
root.addServlet(org.apache.cxf.transport.servlet.CXFServlet.class, "/services/*");
server.start();
SpringJAXRSServerFactoryBean factoryBean = new JAXRSServerFactoryBeanDefinitionParser.SpringJAXRSServerFactoryBean();
factoryBean.setAddress("/rest");
factoryBean.setServiceBeanObjects(new CommandExecutor());
List<Object> arrayList = new ArrayList<Object>();
// arrayList.add(new JacksonJsonProvider());
JAXBElementProvider elementProvider = new JAXBElementProvider();
elementProvider.setMarshallAsJaxbElement(true);
elementProvider.setUnmarshallAsJaxbElement(true);
arrayList.add(elementProvider);
factoryBean.setProviders(arrayList);
// List<?> providers = factoryBean.getProviders();
List<?> providers = factoryBean.getProviders();
// factoryBean.getProperties().put("faultStackTraceEnabled", "true");
factoryBean.create();
Thread.sleep(100000);
}