Hi Neale,
This might be similar to this case:
http://www.nabble.com/After-updating-to-2.1.4:-No-DestinationFactory-was-found-for-the-namespace-http:--schemas.xmlsoap.org-soap-http-td21952242.html
or this:
http://mail-archives.apache.org/mod_mbox/cxf-issues/200806.mbox/%3c1323583532.1213085265096.javamail.j...@brutus%3e
Both cases mention the need for including
cxf-rt-transports-http-jetty.jar in the classpath
Hth.
Gabo
Neale Upstone wrote:
Hi,
Progress sounds really great on the blog, but I'm struggling with
getting the basics up and running with CXF 2.2.2.
I have a service which happily runs with Jersey, but I'm struggling
with getting it up and running under CXF.
I'm baffled as to what I'm doing wrong...
The service starts as follows:
@Path("/themes")
public class Service {
...
and I've tried two CXF approaches to publishing it:
1)
final ServletAdapter adapter = new ServletAdapter();
adapter.addInitParameter( "config-location", "cxf-beans.xml" );
adapter.setServletInstance( new CXFServlet() );
adapter.setContextPath( BASE_URI.getPath() );
selector = GrizzlyServerFactory.create(BASE_URI, adapter);
Result shows that my config is being read:
INFO: Pre-instantiating singletons in
org.springframework.beans.factory.support.defaultlistablebeanfact...@e06940:
defining beans
[cxf,org.apache.cxf.bus.spring.BusApplicationListener,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.jaxrs.JAXRSBindingFactory,org.apache.cxf.binding.xml.XMLBindingFactory,org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder,org.apache.cxf.transport.http.policy.NoOpPolicyInterceptorProvider,org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory];
root of factory hierarchy
INFO: Replaced the http destination factory with servlet transport
factory
INFO: Build endpoints from config-location: cxf-beans.xml
where cxf-beans.xml is as per the example:
<beans ...>
<import resource="classpath:META-INF/cxf/cxf.xml" />
<import
resource="classpath:META-INF/cxf/cxf-extension-jaxrs-binding.xml" />
<import resource="classpath:META-INF/cxf/cxf-servlet.xml" />
<jaxrs:server id="server" address="/"> <!-- also tried /themes -->
<jaxrs:serviceBeans>
<ref bean="service" />
</jaxrs:serviceBeans>
</jaxrs:server>
<bean id="service" class="x.x.Service" />
</beans>
But attempts to read give the following log:
INFO: Setting the server's publish address to be /
*WARNING: Can't find the request for http://localhost:9998/themes's
Observer
*
2) I also tried the simpler:
Service service = new Service();
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setServiceBeans(service); // also tried:
sf.setResourceClasses(Service.class);
sf.setBindingId(JAXRSBindingFactory.JAXRS_BINDING_ID);
sf.setAddress(sf.setAddress("http://localhost:9998/");
sf.create();
The result here is that sf.create() fails with the following exception:
org.apache.cxf.service.factory.ServiceConstructionException
at
org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:108)
at ucles.themes.rest.Server.startCXF(Server.java:86)
at ucles.themes.rest.Server.<init>(Server.java:29)
at ucles.themes.rest.ThemeTest.setUpServer(ThemeTest.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
...
Caused by: org.apache.cxf.BusException: No DestinationFactory was
found for the namespace http://schemas.xmlsoap.org/wsdl/soap/http.
at
org.apache.cxf.transport.DestinationFactoryManagerImpl.getDestinationFactory(DestinationFactoryManagerImpl.java:115)
at
org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.java:85)
at org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:69)
at
org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:84)
... 19 more
------------------------------------------------------------------------
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 8.5.339 / Virus Database: 270.12.52/2152 - Release Date: 06/03/09 05:53:00