I would like to integrate CXF with Google Guice. I am already using Guice in my project and I want to avoid adding extra dependencies.
CXF was my choice because one of the requirements is to be able to provide XML, JSON, JSONP and SOAP interface to the users of the services without having duplicate code (right now we have SOAP-specific classes, for XML we use Struts and for JSON we wrote our own parsers, I know, I feel dirty too).
Anyway, afaik, CXF can fulfill this requirement, so it seems I’m stuck with CXF.
Any ideas or pointers or advice on how to integrate Guice with CXF? I thought of extending the CXFNonSpringJaxrsServlet class and hack Guice into it, but it somehow seems like I would be doing something that someone else has already done.
With CXF 2.4.x, CXF no longer uses Spring to internally configure itself. Thus, you can do pretty much anything without Spring.
The configuration parts are definitely an issue. However, all the spring configuration stuff is just thin wrappers over the CXF API’s. Thus, you can configure pretty much everything via the API’s. You may just need to dig a little bit more.
As an example, with CXF 2.4, we now have started to support using Blueprint instead of Spring in OSGi. The blueprint support doesn’t require any of the Spring stuff, but is modelled from it.