James, no, but I'm happy to share more snippets or gists. Are you in Karaf or just in plain Java? I've done a lot of these over the years.
On Sun, Mar 6, 2016 at 4:37 PM, James Carman <ja...@carmanconsulting.com> wrote: > Benson, is this code on github somewhere? I'm looking to add CXF services > at runtime by code and this looks promising. > On Sun, Mar 6, 2016 at 4:33 PM Benson Margulies <ben...@basistech.com> > wrote: > >> It's also possible that the code on the other end is not, in fact, >> trying the correct URL as a health check. I got some evidence of that >> today, so this may all be a false alarm. >> >> On Sun, Mar 6, 2016 at 4:15 PM, Sergey Beryozkin <sberyoz...@gmail.com> >> wrote: >> > Interesting, I guess more analysis may be needed. >> > Perhaps Jetty does take few seconds to get 'really' ready after >> sf.create() >> > returns, may be it is Jetty version specific ? >> > >> > Sergey >> > >> > On 06/03/16 12:51, Benson Margulies wrote: >> >> >> >> On Sun, Mar 6, 2016 at 7:08 AM, Sergey Beryozkin <sberyoz...@gmail.com> >> >> wrote: >> >>> >> >>> May be the service has not been started (exception is lost, not sure) >> or >> >>> address is wrong ? >> >> >> >> >> >> A moment later all is well. >> >> >> >>> >> >>> Sergey >> >>> >> >>> On 05/03/16 00:20, Benson Margulies wrote: >> >>>> >> >>>> >> >>>> The code below runs in Karaf. Is there any chance of a caller getting: >> >>>> >> >>>> <html><body>No service was found.</body></html> >> >>>> >> >>>> after this has executed? >> >>>> >> >>>> >> >>>> bus = BusFactory.newInstance().createBus(); >> >>>> // set the class loader so that the TCCL is reliably 'us' >> when >> >>>> we get called. >> >>>> >> >>>> >> >>>> >> bus.setExtension(bundleContext.getBundle().adapt(BundleWiring.class).getClassLoader(), >> >>>> ClassLoader.class); >> >>>> JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean(); >> >>>> sf.setBus(bus); >> >>>> sf.setServiceBean(this); >> >>>> sf.setAddress("/worker"); >> >>>> server = sf.create(); >> >>>> >> >>> >> > >> > >>