Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

For the installation steps, Apache Karaf 3.0.3 OSGi container   is going to be used as it is the most widely used OSGi container. All commands shown below are intended to be executed from Apache Karaf shell. The first step is to install http and Pax CDI features, which is CDI-version dependent.

...

In order for the bundle to be recognized as web CDI one and use Apache CXF CDI capabilities, it should provide special bundle manifest instructions (f.e. by  using maven-bundle-plugin plugin).

...

Web Application Configuration

At the moment,   Apache CXF OSGi application should explicitly provide web.xml descriptor with at least CXFCdiServlet defined. For example:

Code Block
xml
xml
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

    <servlet>
        <servlet-name>CXFServlet</servlet-name>
        <display-name>CXF Servlet</display-name>
        <servlet-class>org.apache.cxf.cdi.CXFCdiServlet</servlet-class>    
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>CXFServlet</servlet-name>
        <url-pattern>/*</url-pattern>
    </servlet-mapping>
</web-app>

Discovery

Pax CDI uses own definition of bean bundles and as such, only bundles which follow these requirements are available for discovery (providers, services and features) and injection (see please https://ops4j1.jira.com/wiki/display/PAXCDI/Getting+Started+for+OSGi+Users for more details).