Is there anyway you could package up a simple example project with your 
listener and servlet (and a simple hello world service type thing) and 
send it along to me?   I can then step through parts of it in the 
debugger to see what is going on.    If the Bus is the same, it really 
looks like it should have worked.  :-(

Thanks!
Dan


On Friday 03 October 2008, Alexey Zavizionov wrote:
> Ok, I have the same objects of Bus in both classes listener and
> servlet. In a browser the same message "No service was found.".
>
> Iit doesn't work. Why?
>
> On Fri, Oct 3, 2008 at 10:26 AM, Alexey Zavizionov <
>
> [EMAIL PROTECTED]> wrote:
> > There are different buses.
> >
> > Listener:
> > >>> EXOMAN MyListener.start() 2 = 2
> > >>> EXOMAN MyListener.start() bus =
> >
> > [EMAIL PROTECTED]
> >
> > >>> EXOMAN MyListener.start() System.identityHashCode(bus) =
> > >>> 23247513
> >
> > Servlet:
> > [INFO] MyCxfNonSpringServlet - loadBus method entering
> >
> > >>> EXOMAN MyCxfNonSpringServlet.loadBus() bus =
> >
> > [EMAIL PROTECTED]
> >
> > >>> EXOMAN MyCxfNonSpringServlet.loadBus()
> > >>> System.identityHashCode(bus) =
> >
> > 32110028
> >
> > Thanks and regards,
> > Alexey
> >
> > On Thu, Oct 2, 2008 at 10:15 PM, Daniel Kulp <[EMAIL PROTECTED]> 
wrote:
> >> That all looks correct.    The only thing I can think of is if a
> >> different Bus is getting used in the servlet.   Can you do
> >> something like:
> >> System.out.println(System.identityHashCode(bus));
> >> in your listener and in your servlet to see if they are the same.  
> >> If not, that's definitely the issue.
> >>
> >> You MAY need to stick the Bus into a static variable or something
> >> to make sure the correct Bus is used.
> >>
> >> Dan
> >>
> >> On Thursday 02 October 2008, Alexey Zavizionov wrote:
> >> > Hello Dan,
> >> >
> >> > I tried different ways to do it but I did not get successful
> >> > result. What did I do wrong?
> >> >
> >> > In the listener code:
> >> > -----------------------------------------------------------------
> >> >----- ---------------------- ...
> >> >       Bus bus = BusFactory.newInstance().createBus();
> >> >       BusFactory.setDefaultBus(bus);
> >> >
> >> >       // snap of code from
> >> > AbstractCXFServlet.replaceDestinationFactory()
> >> >
> >> >       DestinationFactoryManager dfm =
> >> > bus.getExtension(DestinationFactoryManager.class);
> >> >       try {
> >> >           DestinationFactory df = dfm.getDestinationFactory("
> >> > http://cxf.apache.org/transports/http/configuration";);
> >> >           if (df instanceof ServletTransportFactory) {
> >> >             ServletTransportFactory servletTransportFactory =
> >> > (ServletTransportFactory)df;
> >> >               LOG.info("DESTIONFACTORY_ALREADY_REGISTERED");
> >> >               return;
> >> >           }
> >> >       } catch (BusException e) {
> >> >       }
> >> >
> >> >       DestinationFactory factory = new
> >> > ServletTransportFactory(bus);
> >> >
> >> >
> >> >       for (String s : factory.getTransportIds()) {
> >> >
> >> > bus.getExtension(DestinationFactoryManager.class).registerDestina
> >> >tionF actory(s, factory);
> >> >       }
> >> >       LOG.info("REPLACED_HTTP_DESTIONFACTORY");
> >> >
> >> >       DestinationFactoryManager factoryManager =
> >> > bus.getExtension(DestinationFactoryManager.class);
> >> >
> >> >       String address = "
> >> > http://localhost:8080/ws-examples/soap/services/TicketOrderServic
> >> >e"; TicketOrderServiceImpl implementor = new
> >> > TicketOrderServiceImpl(); Endpoint.publish(address, implementor);
> >> > ...
> >> > -----------------------------------------------------------------
> >> >----- ----------------------
> >> >
> >> >
> >> > In the MyCxfNonSpringServlet
> >> > -----------------------------------------------------------------
> >> >----- ------------------------- ...
> >> >   @Override
> >> >   public void loadBus(ServletConfig servletConfig) throws
> >> > ServletException { super.loadBus(servletConfig);
> >> >     LOG.info("loadBus method entering");
> >> >
> >> >     Bus bus = getBus();
> >> >     BusFactory.setDefaultBus(bus);
> >> >   }
> >> >
> >> >   @Override
> >> >   public ServletController createServletController(ServletConfig
> >> > servletConfig) {
> >> >     DestinationFactoryManager dfm =
> >> > bus.getExtension(DestinationFactoryManager.class);
> >> >     try {
> >> >       servletTransportFactory = (ServletTransportFactory)
> >> > dfm.getDestinationFactory("
> >> > http://cxf.apache.org/transports/http/configuration";);
> >> >     } catch (Exception e) {
> >> >       e.printStackTrace();
> >> >     }
> >> >     return super.createServletController(servletConfig);
> >> >   }
> >> > ...
> >> > -----------------------------------------------------------------
> >> >----- -------------------------
> >> >
> >> >
> >> > In the process of deployment were not exceptions.
> >> >
> >> > On a console:
> >> > [INFO] WebServiceLoader - REPLACED_HTTP_DESTIONFACTORY
> >> >
> >> > On a browser at url:
> >> > http://localhost:8080/ws-examples/soap/services/TicketOrderServic
> >> >e?wsd l "No service was found."
> >> >
> >> > On Wed, Oct 1, 2008 at 8:51 PM, Daniel Kulp <[EMAIL PROTECTED]> 
wrote:
> >> > > 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 <
> >> > > >
> >> > > > [EMAIL PROTECTED]> 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
> >> > > > > <[EMAIL PROTECTED]>
> >> > >
> >> > > 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://exoplatform.org/soap/cxf%7DTicketOrderServicefrom>
> >>
> >> <http:
> >> > > > >> >//exoplatform.org/soap/cxf%7DTicketOrderServicefrom>
> >> > >
> >> > > <http://ex
> >> > >
> >> > > > >> >oplatform.org/soap/cxf%7DTicketOrderServicefrom>class
> >> > > > >> > org.exoplatform.services.ws.soap.jsr181.TicketOrderServi
> >> > > > >> >ce org.picocontainer.PicoIntrospectionException: Failed
> >> > > > >> > when calling start
> >> > > > >>
> >> > > > >> on
> >> > > > >>
> >> > > > >> > [EMAIL PROTECTED]
> >> > > > >> >c899 at
> >>
> >> 
org.picocontainer.defaults.LifecycleVisitor.traverse(LifecycleVisitor.java:
> >> > > > >> >81) at
> >> > > > >>
> >> > > > >> org.picocontainer.defaults.LifecycleVisitor.start(Lifecycl
> >> > > > >>eVisi tor. java:113
> >> > > > >>
> >> > > > >> >) at
> >> > > > >>
> >> > > > >> org.picocontainer.defaults.DefaultPicoContainer.start(Defa
> >> > > > >>ultPi coCo ntainer.
> >> > > > >>
> >> > > > >> >java:369) at
> >> > > > >>
> >> > > > >> org.exoplatform.container.StandaloneContainer.getInstance(
> >> > > > >>Stand alon eContain
> >> > > > >>
> >> > > > >> >er.java:124) at
> >> > > > >>
> >> > > > >> org.exoplatform.container.StandaloneContainer.getInstance(
> >> > > > >>Stand alon eContain
> >> > > > >>
> >> > > > >> >er.java:91) at
> >> > > > >>
> >> > > > >> org.exoplatform.ws.frameworks.servlet.StandaloneContainerI
> >> > > > >>nitia lize dListene
> >> > > > >>
> >> > > > >> >r.contextInitialized(StandaloneContainerInitializedListen
> >> > > > >> >er.ja va:7 1) at
> >> > > > >>
> >> > > > >> org.apache.catalina.core.StandardContext.listenerStart(Sta
> >> > > > >>ndard Cont ext.java
> >> > > > >>
> >> > > > >> >:3827) at
> >> > > > >>
> >> > > > >> org.apache.catalina.core.StandardContext.start(StandardCon
> >> > > > >>text. java
> >> > > > >>
> >> > > > >>:4336)
> >> > > > >>:
> >> > > > >> >         at
> >>
> >> 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:
> >> > > > >> >761) at
> >> > > > >> > org.apache.catalina.core.ContainerBase.addChild(Containe
> >> > > > >> >rBase .jav a:741) at
> >> > > > >> > org.apache.catalina.core.StandardHost.addChild(StandardH
> >> > > > >> >ost.j ava: 525) at
> >> > > > >>
> >> > > > >> org.apache.catalina.startup.HostConfig.deployDescriptor(Ho
> >> > > > >>stCon fig. java:626
> >> > > > >>
> >> > > > >> >) at
> >> > > > >>
> >> > > > >> org.apache.catalina.startup.HostConfig.deployDescriptors(H
> >> > > > >>ostCo nfig .java:55
> >> > > > >>
> >> > > > >> >3) at
> >> > > > >> > org.apache.catalina.startup.HostConfig.deployApps(HostCo
> >> > > > >> >nfig. java
> >> > > > >> >
> >> > > > >> >:488) at
> >> > > > >> >
> >> > > > >> > org.apache.catalina.startup.HostConfig.start(HostConfig.
> >> > > > >> >java: 1138 ) at
> >> > > > >>
> >> > > > >> org.apache.catalina.startup.HostConfig.lifecycleEvent(Host
> >> > > > >>Confi g.ja va:311)
> >> > > > >>
> >> > > > >> >         at
> >> > > > >>
> >> > > > >> org.apache.catalina.util.LifecycleSupport.fireLifecycleEve
> >> > > > >>nt(Li fecy cleSuppo
> >> > > > >>
> >> > > > >> >rt.java:120) at
> >> > > > >> > org.apache.catalina.core.ContainerBase.start(ContainerBa
> >> > > > >> >se.ja va:1 023) at
> >> > > > >> > org.apache.catalina.core.StandardHost.start(StandardHost
> >> > > > >> >.java
> >> > > > >> >
> >> > > > >> >:719 ) at
> >> > > > >> >
> >> > > > >> > org.apache.catalina.core.ContainerBase.start(ContainerBa
> >> > > > >> >se.ja va:1 015) at
> >> > > > >> > org.apache.catalina.core.StandardEngine.start(StandardEn
> >> > > > >> >gine. java
> >> > > > >> >
> >> > > > >> >:443) at
> >> > > > >> >
> >> > > > >> > org.apache.catalina.core.StandardService.start(StandardS
> >> > > > >> >ervic e.ja va:448) at
> >> > > > >> > org.apache.catalina.core.StandardServer.start(StandardSe
> >> > > > >> >rver. java
> >> > > > >> >
> >> > > > >> >:710) at
> >> > > > >> >
> >> > > > >> > org.apache.catalina.startup.Catalina.start(Catalina.java
> >> > > > >> >:552) at
> >> > > > >> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> >> > > > >> > Method) at
> >> > > > >>
> >> > > > >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAc
> >> > > > >>cesso rImp l.java:3
> >> > > > >>
> >> > > > >> >9) at
> >> > > > >>
> >> > > > >> sun.reflect.DelegatingMethodAccessorImpl.invoke(Delegating
> >> > > > >>Metho dAcc 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.getDestin
> >> > > > >>ation (Soa pTranspo
> >> > > > >>
> >> > > > >> >rtFactory.java:76) at
> >> > > > >> > org.apache.cxf.endpoint.ServerImpl.initDestination(Serve
> >> > > > >> >rImpl .jav a:90) at
> >> > > > >> > org.apache.cxf.endpoint.ServerImpl.<init>(ServerImpl.jav
> >> > > > >> >a:69) at
> >> > > > >>
> >> > > > >> org.apache.cxf.frontend.ServerFactoryBean.create(ServerFac
> >> > > > >>toryB ean. java:117
> >> > > > >>
> >> > > > >> >) at
> >> > > > >>
> >> > > > >> org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsSe
> >> > > > >>rverF acto ryBean.j
> >> > > > >>
> >> > > > >> >ava:168) at
> >> > > > >>
> >> > > > >> org.exoplatform.services.ws.impl.cxf.CXFUtils.complexDeplo
> >> > > > >>yServ ice( CXFUtils
> >> > > > >>
> >> > > > >> >.java:83) at
> >> > > > >>
> >> > > > >> org.exoplatform.services.ws.impl.cxf.WebServiceLoader.star
> >> > > > >>t(Web Serv iceLoade
> >> > > > >>
> >> > > > >> >r.java:82) at
> >> > > > >> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> >> > > > >> > Method)
> >> > > > >>
> >> > > > >> at
> >> > > > >>
> >> > > > >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAc
> >> > > > >>cesso rImp l.java:3
> >> > > > >>
> >> > > > >> >9) at
> >> > > > >>
> >> > > > >> sun.reflect.DelegatingMethodAccessorImpl.invoke(Delegating
> >> > > > >>Metho dAcc 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
> >> > > > >> [EMAIL PROTECTED]
> >> > > > >> http://www.dankulp.com/blog
> >> > >
> >> > > --
> >> > > J. Daniel Kulp
> >> > > Principal Engineer, IONA
> >> > > [EMAIL PROTECTED]
> >> > > http://www.dankulp.com/blog
> >>
> >> --
> >> J. Daniel Kulp
> >> [EMAIL PROTECTED]
> >> http://www.dankulp.com/blog



-- 
J. Daniel Kulp
[EMAIL PROTECTED]
http://www.dankulp.com/blog

Reply via email to