cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kirill R." <>
Subject configuring CXFServlet to publish services using JAX-WS API
Date Thu, 23 Oct 2008 07:18:25 GMT

I have found a few threads on this topic but none really answered my
question, so here goes:

We have a standalone application which uses a Spring context with embedded
I want to be able to start and stop web services in runtime using the CXF
servlet hosted in that Jetty.
In order to do this, I need to access servlet's bus as suggested in docs. So
I create the servlet
as a bean in our Spring context, hook it up to Jetty using a simple wrapper:

    public ServletWrapperBean(ContextHandlerCollection contexts,
        CXFServlet cxfServlet, String path) throws Exception
        final Context root = new Context(contexts, "/", Context.SESSIONS);
        ServletHolder servlet = new ServletHolder(cxfServlet);
        root.addServlet(servlet, path);

and then pass to my class which uses it to set BusFactory's defaultBus
before publishing services.

And it doesn't quite work:
in 2.1.1 the servlet's bus was null and CXF was unable to locate the HTTP
transport extension.
With newer versions (tried 2.1.3 today), it can't even load our Spring
context because CFXServlet throws
an NPE in updateContext (ServletConfig is null).

How do I configure it properly?

Sorry if this is an amateurish question.
View this message in context:
Sent from the cxf-user mailing list archive at

View raw message