Blog

Blog from April, 2011

Just read this excellent summary of problems in enterprise applications by Eberhad Wolff. While I think many developers are already aware of most of the problems it is great to have them together with solutions in one small presentation. From my point of view this presentation is a must read:

10 Typical Problems in Enterprise Java Applications

In the CXF 2.4.0 version we did a big refactoring of the http transport to make it easier to use in applications. Up to this version there are four different http transports. The ClientOnlyHttpTransportFactory, ServletTransportFactory, JettyHttpTransportFactory and the OsgiHttpTransportFactory. To initialize them you had to import certain spring config files like cxf-extension-http.xml for ClientOnly. For the server side you had to decide which of the three transport variants you wanted to use and also import the respective xml file.
It was not possible to have jetty and servlet endpoint at the same time.

This all changes in CXF 2.4.0. We replaced the four separate TransportFactories with only one HttpTransportFactory. This delegates to the correct implementation depending on the address of the endpoint. The complete OSGi specific code is removed and replaced by the servlet code. In case the address is a complete url with server name the jetty transport is used. If not the servlet transport is used.  To use http endpoints in OSGi you still need too use the import statement as this makes the connection to the servlet that cxf registers with the OSGi HttpService. While you do not need the imports anymore except for OSGi they are still there and it does not hurt to use them.

So to sum it all up you do not need to change anything to use the new http transport but you can leave out most imports. Additonally you can now have jetty and servlet endpoints on the same cxf bus.