On Thursday 23 October 2008 5:42:30 am Kirill R. wrote:
> The problem is, with CXFServlet being another bean in our Spring context,
> it prevents the context
> from loading by throwing NPE in updateContext and it doesn't even get to
> the point where I
> retrieve the servlet's bus.
>
> Otherwise, my wrapper (quoted in the first post) does just the same thing
> as this test you
> cited. However, servletConfig isn't set at the time
> CXFServlet.updateContext is called and I have
> no idea where it's supposed to come from.
I wonder if it would make sense for you to just subclass the
AbstractCXFServlet and override loadBus(ServletConfig servletConfig) to get
your ApplicationContext from the config and get the bus (object name would
be "cxf") from that context and then call the registration stuff.
Something like:
private void loadBus(ServletConfig servletConfig)
throws ServletException {
ServletContext svCtx = getServletContext();
ApplicationContext ctx = (ApplicationContext)svCtx
.getAttribute("org.springframework.web.context.WebApplicationContext.ROOT");
bus = ctx.getBean("cxf", Bus.class);
ResourceManager resourceManager =
bus.getExtension(ResourceManager.class);
resourceManager.addResourceResolver(new
ServletContextResourceResolver(
servletConfig.getServletContext()));
replaceDestinationFactory();
// Set up the ServletController
controller = createServletController(servletConfig);
}
In your context, you just need to "import" the various CXF things you need
(cxf.xml/cxf-extension-soap.xml/etc...) (or cxf-all.xml if you use the
bundle)
--
Daniel Kulp
[EMAIL PROTECTED]
http://dankulp.com/blog