cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Starting up service within listener: Could not find destination factory for transport.
Date Wed, 01 Oct 2008 17:51:31 GMT


I think it's possible, but it's certainly not trivial.

Looking at the code in the AbstractCXFServlet, it LOOKS like you could 
do:

1) Before creating your services, if you create a bus and add the servlet 
transport into it.   You can take that code from 
replaceDestinationFactory in the AbstractCXFSerlvlet.   That should 
allow the services to register fine.

2) In you servlet subclass, override the createServletController to do:

DestinationFactoryManager dfm =
     bus.getExtension(DestinationFactoryManager.class); 
servletTransportFactory = (SerlvetTransportFactory)
     dfm.getDestinationFactory(
           "http://cxf.apache.org/transports/http/configuration");
super.createServletController(....);

That looks like it SHOULD work.

Dan



On Wednesday 01 October 2008, Alexey Zavizionov wrote:
> Hello list,
>
> Is there a CXF API methods to hold on deploy service from listener
> before MyCxfNonSpringServlet servlet is started.
> Will it work with register service to the servlet context outside
> servlet code?
>
> Thanks and regards,
> Alexey.
>
> On Tue, Sep 30, 2008 at 11:30 AM, Alexey Zavizionov <
>
> alexey.zavizionov@gmail.com> wrote:
> > Thanks for reply,
> >
> > NOTE: I have a listener which starts before MyCxfNonSpringServlet is
> > deployed.
> >    All code for registering endpoint I moved to the listener.
> >
> > How can I register the servlets transport factory with the bus?
> >
> > Regards,
> > Alexey.
> >
> > On Mon, Sep 29, 2008 at 8:36 PM, Daniel Kulp <dkulp@apache.org> 
wrote:
> >> It looks like the servlets transport factory is not registered with
> >> the bus.
> >> Are you subclassing our CXFNonSpringServlet or similar to make sure
> >> the appropriate transport is setup to handle that namespace?
> >>
> >> Dan
> >>
> >> On Monday 29 September 2008 5:26:39 am Alexey Zavizionov wrote:
> >> > Hello list,
> >> >
> >> > I published services within test unit and in a servlet
> >> > (nonspring) successfully with command "Endpoint.publish(address,
> >> > object);".
> >> >
> >> > But, the same thing has failed within listener (in the Tomcat ).
> >> >
> >> > Does somebody have publish your service within listener?
> >> >
> >> > INFO: Creating Service
> >> > {http://exoplatform.org/soap/cxf}TicketOrderServicefrom<http://ex
> >> >oplatform.org/soap/cxf%7DTicketOrderServicefrom>class
> >> > org.exoplatform.services.ws.soap.jsr181.TicketOrderService
> >> > org.picocontainer.PicoIntrospectionException: Failed when calling
> >> > start
> >>
> >> on
> >>
> >> > org.exoplatform.services.ws.impl.cxf.WebServiceLoader@7bc899
> >> >         at
> >>
> >> 
org.picocontainer.defaults.LifecycleVisitor.traverse(LifecycleVisitor.java:
> >> >81) at
> >>
> >> org.picocontainer.defaults.LifecycleVisitor.start(LifecycleVisitor.
> >>java:113
> >>
> >> >) at
> >>
> >> org.picocontainer.defaults.DefaultPicoContainer.start(DefaultPicoCo
> >>ntainer.
> >>
> >> >java:369) at
> >>
> >> org.exoplatform.container.StandaloneContainer.getInstance(Standalon
> >>eContain
> >>
> >> >er.java:124) at
> >>
> >> org.exoplatform.container.StandaloneContainer.getInstance(Standalon
> >>eContain
> >>
> >> >er.java:91) at
> >>
> >> org.exoplatform.ws.frameworks.servlet.StandaloneContainerInitialize
> >>dListene
> >>
> >> >r.contextInitialized(StandaloneContainerInitializedListener.java:7
> >> >1) at
> >>
> >> org.apache.catalina.core.StandardContext.listenerStart(StandardCont
> >>ext.java
> >>
> >> >:3827) at
> >>
> >> org.apache.catalina.core.StandardContext.start(StandardContext.java
> >>:4336)
> >>
> >> >         at
> >>
> >> 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:
> >> >761) at
> >> > org.apache.catalina.core.ContainerBase.addChild(ContainerBase.jav
> >> >a:741) at
> >> > org.apache.catalina.core.StandardHost.addChild(StandardHost.java:
> >> >525) at
> >>
> >> org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.
> >>java:626
> >>
> >> >) at
> >>
> >> org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig
> >>.java:55
> >>
> >> >3) at
> >> > org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java
> >> >:488) at
> >> > org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138
> >> >) at
> >>
> >> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.ja
> >>va:311)
> >>
> >> >         at
> >>
> >> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecy
> >>cleSuppo
> >>
> >> >rt.java:120) at
> >> > org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1
> >> >023) at
> >> > org.apache.catalina.core.StandardHost.start(StandardHost.java:719
> >> >) at
> >> > org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1
> >> >015) at
> >> > org.apache.catalina.core.StandardEngine.start(StandardEngine.java
> >> >:443) at
> >> > org.apache.catalina.core.StandardService.start(StandardService.ja
> >> >va:448) at
> >> > org.apache.catalina.core.StandardServer.start(StandardServer.java
> >> >:710) at
> >> > org.apache.catalina.startup.Catalina.start(Catalina.java:552) at
> >> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
> >>
> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp
> >>l.java:3
> >>
> >> >9) at
> >>
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc
> >>essorImp
> >>
> >> >l.java:25) at java.lang.reflect.Method.invoke(Method.java:585)
> >> >         at
> >>
> >> org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
> >>
> >> >         at
> >>
> >> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
> >>
> >> > Caused by: java.lang.RuntimeException: Could not find destination
> >>
> >> factory
> >>
> >> > for transport http://schemas.xmlsoap.org/soap/http
> >> >         at
> >>
> >> org.apache.cxf.binding.soap.SoapTransportFactory.getDestination(Soa
> >>pTranspo
> >>
> >> >rtFactory.java:76) at
> >> > org.apache.cxf.endpoint.ServerImpl.initDestination(ServerImpl.jav
> >> >a:90) at
> >> > org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.java:69) at
> >>
> >> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.
> >>java:117
> >>
> >> >) at
> >>
> >> org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFacto
> >>ryBean.j
> >>
> >> >ava:168) at
> >>
> >> org.exoplatform.services.ws.impl.cxf.CXFUtils.complexDeployService(
> >>CXFUtils
> >>
> >> >.java:83) at
> >>
> >> org.exoplatform.services.ws.impl.cxf.WebServiceLoader.start(WebServ
> >>iceLoade
> >>
> >> >r.java:82) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> >> > Method)
> >>
> >> at
> >>
> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImp
> >>l.java:3
> >>
> >> >9) at
> >>
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcc
> >>essorImp
> >>
> >> >l.java:25) at java.lang.reflect.Method.invoke(Method.java:585)
> >> >         at
> >>
> >> 
org.picocontainer.defaults.LifecycleVisitor.traverse(LifecycleVisitor.java:
> >> >75) ... 29 more
> >> >
> >> > Regards,
> >> > Alexey.
> >>
> >> --
> >> Daniel Kulp
> >> dkulp@apache.org
> >> http://www.dankulp.com/blog



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Mime
View raw message