title: How to setup CDI (OpenWebBeans or JBoss Weld) for use with JSF in Apache Karaf 4.0.3 with PAX-WEB 4.2.3 / Jetty 9.2.10
body: <p>I'm trying to setup Apache Karaf 4.0.3 with CDI (PAX-CDI) for using it with JSF / Primefaces. I've already tried it with Apache OpenWebBeans and JBoss Weld, but every try ended up in an Exception (see below).</p>
  
  <h2>My current setup:</h2>
  
  <h3>General</h3>
  
  <p><strong><em>src/main/webapp/WEB-INF/web.xml (stripped)</em></strong></p>
  
  <pre><code>   &lt;?xml version="1.0" encoding="UTF-8"?&gt;
     &lt;web-app version="3.0"
           xmlns="http://java.sun.com/xml/ns/javaee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt;
  
      ...
  
      &lt;resource-env-ref&gt;
          &lt;resource-env-ref-name&gt;BeanManager&lt;/resource-env-ref-name&gt;
          &lt;resource-env-ref-type&gt;javax.enterprise.inject.spi.BeanManager&lt;/resource-env-ref-type&gt;
      &lt;/resource-env-ref&gt;
  
      ...
     &lt;/web-app&gt;
  </code></pre>
  
  <p><strong><em>pom.xml (stripped)</em></strong></p>
  
  <pre><code>    &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
          &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
      ...
  
      &lt;dependencies&gt;
          &lt;!-- OSGi --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.osgi&lt;/groupId&gt;
              &lt;artifactId&gt;org.osgi.core&lt;/artifactId&gt;
              &lt;version&gt;6.0.0&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- JSF --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.faces&lt;/groupId&gt;
              &lt;artifactId&gt;jsf-api&lt;/artifactId&gt;
              &lt;version&gt;2.0&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.faces&lt;/groupId&gt;
              &lt;artifactId&gt;javax.faces-api&lt;/artifactId&gt;
              &lt;version&gt;2.2&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.primefaces&lt;/groupId&gt;
              &lt;artifactId&gt;primefaces&lt;/artifactId&gt;
              &lt;version&gt;5.3&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.myfaces.core&lt;/groupId&gt;
              &lt;artifactId&gt;myfaces-api&lt;/artifactId&gt;
              &lt;version&gt;2.2.6&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.myfaces.core&lt;/groupId&gt;
              &lt;artifactId&gt;myfaces-impl&lt;/artifactId&gt;
              &lt;version&gt;2.2.6&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.el&lt;/groupId&gt;
              &lt;artifactId&gt;el-api&lt;/artifactId&gt;
              &lt;version&gt;2.2&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- CDI --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.xbean&lt;/groupId&gt;
              &lt;artifactId&gt;xbean-bundleutils&lt;/artifactId&gt;
              &lt;version&gt;4.1&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.geronimo.specs&lt;/groupId&gt;
              &lt;artifactId&gt;geronimo-jcdi_1.0_spec&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.apache.geronimo.specs&lt;/groupId&gt;
              &lt;artifactId&gt;geronimo-atinject_1.0_spec&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.annotation&lt;/groupId&gt;
              &lt;artifactId&gt;javax.annotation-api&lt;/artifactId&gt;
              &lt;version&gt;1.2&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;javax.enterprise&lt;/groupId&gt;
              &lt;artifactId&gt;cdi-api&lt;/artifactId&gt;
              &lt;version&gt;1.1&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.ops4j.pax.cdi&lt;/groupId&gt;
              &lt;artifactId&gt;pax-cdi-api&lt;/artifactId&gt;
              &lt;version&gt;0.13.0-SNAPSHOT&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.ops4j.pax.web&lt;/groupId&gt;
              &lt;artifactId&gt;pax-web-jetty&lt;/artifactId&gt;
              &lt;version&gt;4.2.3&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;dependency&gt;
              &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
              &lt;artifactId&gt;jetty-webapp&lt;/artifactId&gt;
              &lt;version&gt;9.2.10.v20150310&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- servlet --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;javax.servlet&lt;/groupId&gt;
              &lt;artifactId&gt;javax.servlet-api&lt;/artifactId&gt;
              &lt;version&gt;3.1.0&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
  
          &lt;!-- Logging --&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.slf4j&lt;/groupId&gt;
              &lt;artifactId&gt;slf4j-api&lt;/artifactId&gt;
              &lt;version&gt;1.7.5&lt;/version&gt;
              &lt;scope&gt;provided&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  ...
          &lt;build&gt;
              &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-war-plugin&lt;/artifactId&gt;
                      &lt;configuration&gt;
                          &lt;failOnMissingWebXml&gt;false&lt;/failOnMissingWebXml&gt;
                          &lt;archive&gt;
                              &lt;manifestFile&gt;${project.build.outputDirectory}/META-INF/MANIFEST.MF&lt;/manifestFile&gt;
                          &lt;/archive&gt;
                          &lt;attachClasses&gt;true&lt;/attachClasses&gt;
                          &lt;classesClassifier&gt;classes&lt;/classesClassifier&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
                      &lt;extensions&gt;true&lt;/extensions&gt;
                      &lt;configuration&gt;
                          &lt;supportedProjectTypes&gt;
                              &lt;supportedProjectType&gt;jar&lt;/supportedProjectType&gt;
                              &lt;supportedProjectType&gt;bundle&lt;/supportedProjectType&gt;
                              &lt;supportedProjectType&gt;war&lt;/supportedProjectType&gt;
                          &lt;/supportedProjectTypes&gt;
  
                          &lt;instructions&gt;
                              &lt;Bundle-SymbolicName&gt;${project.artifactId}&lt;/Bundle-SymbolicName&gt;
                              &lt;Bundle-Version&gt;${project.version}&lt;/Bundle-Version&gt;
                              &lt;Bundle-Activator&gt;de.essendi.platform.ui.Activator&lt;/Bundle-Activator&gt;
                              &lt;Import-Package&gt;
                                  javax.el,
                                  javax.annotation,
                                  javax.faces.webapp,
                                  javax.servlet.jsp;version="[2.2.0,3.0.0)",
                                  javax.servlet.jsp.jstl.core;version="1.2",
                                  javax.servlet.jsp.jstl.fmt;version="1.2",
                                  javax.servlet.jsp.jstl.tlv;version="1.2",
                                  javax.servlet;version="[2.6.0,4.0.0)",
                                  javax.servlet.http;version="[2.6.0,4.0.0)",
                                  org.apache.taglibs.standard.resources;version="1.1.2",
                                  org.apache.taglibs.standard.tag.common.core;version="1.1.2",
                                  org.apache.taglibs.standard.tag.rt.core;version="1.1.2",
                                  org.apache.taglibs.standard.tei;version="1.1.2",
                                  org.apache.taglibs.standard.tlv;version="1.1.2",
                                  org.eclipse.jetty.cdi,
                                  javax.faces.*,
                                  javax.el.*,
                                  org.apache.xbean.osgi.bundle.util.*,
                                  org.apache.myfaces.webapp,
                                  org.apache.myfaces.config,
                                  org.apache.myfaces.config.impl,
                                  org.apache.myfaces.config.impl.digester,
                                  org.apache.myfaces.config.impl.digester.elements,
                                  javassist.*,
                                  org.eclipse.jetty.*,
                                  org.primefaces.*,
                                  org.osgi.framework,
                                  org.slf4j; version="[1.7.0,1.8.0)"; provider=paxlogging
                              &lt;/Import-Package&gt;
                              &lt;Export-Package&gt;!*&lt;/Export-Package&gt;
                              &lt;_wab&gt;src/main/webapp/&lt;/_wab&gt;
                              &lt;Web-ContextPath&gt;cert&lt;/Web-ContextPath&gt;
                              &lt;Webapp-Context&gt;cert&lt;/Webapp-Context&gt;
                              &lt;Bundle-Classpath&gt;WEB-INF/classes&lt;/Bundle-Classpath&gt;
                              &lt;Require-Bundle&gt;
                                  org.primefaces;visibility:=reexport
                              &lt;/Require-Bundle&gt;
                              &lt;Require-Capability&gt;
                                  org.ops4j.pax.cdi.extension; filter:="(&amp;amp;(extension=pax-cdi-extension)(version&amp;gt;=${version;==;${pax.cdi.osgi.version.clean}})(!(version&amp;gt;=${version;=+;${pax.cdi.osgi.version.clean}})))",
                                  osgi.extender; filter:="(osgi.extender=pax.cdi)"
                              &lt;/Require-Capability&gt;
                              &lt;Require-TldBundle&gt;
                                  org.primefaces,
                                  org.ops4j.pax.cdi.jetty
                              &lt;/Require-TldBundle&gt;
                              &lt;_removeheaders&gt;
                                  Include-Resource,
                                  Private-Package,
                                  Embed-Dependency,
                                  Embed-Transitive
                              &lt;/_removeheaders&gt;
                          &lt;/instructions&gt;
                      &lt;/configuration&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;id&gt;versions&lt;/id&gt;
                              &lt;phase&gt;validate&lt;/phase&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;cleanVersions&lt;/goal&gt;
                              &lt;/goals&gt;
                              &lt;configuration&gt;
                                  &lt;versions&gt;
                                      &lt;pax.cdi.osgi.version.clean&gt;0.13.0&lt;/pax.cdi.osgi.version.clean&gt;
                                  &lt;/versions&gt;
                              &lt;/configuration&gt;
                          &lt;/execution&gt;
                          &lt;execution&gt;
                              &lt;id&gt;generate-manifest&lt;/id&gt;
                              &lt;phase&gt;process-classes&lt;/phase&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;manifest&lt;/goal&gt;
                              &lt;/goals&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/build&gt;
      &lt;/project&gt;
  </code></pre>
  
  <p><strong><em>General CDI Features / Bundles</em></strong></p>
  
  <pre><code>&lt;bundle&gt;mvn:org.apache.xbean/xbean-bundleutils/4.1&lt;/bundle&gt;
  &lt;feature&gt;pax-cdi&lt;/feature&gt;
  </code></pre>
  
  <h3>JBoss Weld</h3>
  
  <p><strong><em>Additional Dependencies</em></strong></p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;org.jboss.weld&lt;/groupId&gt;
      &lt;artifactId&gt;weld-core&lt;/artifactId&gt;
      &lt;version&gt;1.2.0.Beta1&lt;/version&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.jboss.weld.servlet&lt;/groupId&gt;
      &lt;artifactId&gt;weld-servlet-core&lt;/artifactId&gt;
      &lt;version&gt;1.2.0.Beta1&lt;/version&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  
  &lt;dependency&gt;
      &lt;groupId&gt;org.eclipse.jetty&lt;/groupId&gt;
      &lt;artifactId&gt;jetty-cdi&lt;/artifactId&gt;
      &lt;version&gt;9.2.10.v20150310&lt;/version&gt;
      &lt;scope&gt;provided&lt;/scope&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p><strong><em>Additional Import-Packages</em></strong></p>
  
  <pre><code>org.jboss.weld.environment.servlet.jsf,
  org.jboss.weld.environment.servlet,
  org.jboss.weld.environment.jetty,
  org.jboss.weld.exceptions,
  org.jboss.weld.bootstrap,
  org.jboss.weld.resources,
  org.jboss.weld.context,
  org.jboss.weld.servlet,
  org.jboss.weld.jsf,
  org.jboss.weld.el,
  org.jboss.weld.*,
  javassist.*,
  org.eclipse.jetty.cdi
  </code></pre>
  
  <p><strong><em>src/main/webapp/META-INF/context.xml</em></strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Context&gt;
      &lt;Resource name="BeanManager"
                auth="Container"
                type="javax.enterprise.inject.spi.BeanManager"
                factory="org.jboss.weld.resources.ManagerObjectFactory"/&gt;
  &lt;/Context&gt;
  </code></pre>
  
  <p><strong><em>CDI Features / Bundles</em></strong></p>
  
  <pre><code>&lt;bundle&gt;wrap:mvn:org.javassist/javassist/3.14.0-GA&lt;/bundle&gt;
  &lt;feature&gt;pax-cdi-web-weld&lt;/feature&gt;
  &lt;bundle&gt;wrap:mvn:org.eclipse.jetty/jetty-cdi/9.2.10.v20150310&lt;/bundle&gt;
  &lt;bundle&gt;wrap:mvn:org.jboss.weld/weld-core/1.2.0.Beta1&lt;/bundle&gt;
  &lt;bundle&gt;wrap:mvn:org.jboss.weld.servlet/weld-servlet-core/1.2.0.Beta1&lt;/bundle&gt;
  </code></pre>
  
  <h3>OpenWebBeans</h3>
  
  <p><strong><em>Additional Dependencies</em></strong></p>
  
  <p>None</p>
  
  <p><strong><em>Additional Import-Packages</em></strong></p>
  
  <pre><code>org.apache.webbeans.servlet
  </code></pre>
  
  <p><strong><em>src/main/webapp/META-INF/context.xml</em></strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Context&gt;
      &lt;Resource name="BeanManager"
                auth="Container"
                type="javax.enterprise.inject.spi.BeanManager"
                factory="org.apache.webbeans.container.ManagerObjectFactory"/&gt;
  &lt;/Context&gt;
  </code></pre>
  
  <p><strong><em>CDI Features / Bundles</em></strong></p>
  
  <pre><code>&lt;feature&gt;pax-cdi-openwebbeans&lt;/feature&gt;
  &lt;feature&gt;pax-cdi-web-openwebbeans&lt;/feature&gt;
  &lt;bundle&gt;mvn:org.apache.openwebbeans/openwebbeans-jsf/1.2.6&lt;/bundle&gt;
  &lt;bundle&gt;mvn:org.apache.openwebbeans/openwebbeans-el22/1.2.6&lt;/bundle&gt;
  &lt;bundle&gt;mvn:org.apache.openwebbeans/openwebbeans-web/1.2.6&lt;/bundle&gt;
  </code></pre>
  
  <h2>My issues with those setups</h2>
  
  <h3>JBoss Weld</h3>
  
  <p>With JBoss Weld I currently end up in a NoClassDefFoundError:</p>
  
  <pre><code>2016-01-14 15:53:15,418 | ERROR | pool-44-thread-1 | ClassUtils                       | 131 - org.apache.myfaces.core.impl - 2.2.6 | Class : org.jboss.weld.jsf.WeldPhaseListener not found.
  java.lang.NoClassDefFoundError: org/jboss/weld/context/ConversationContext
          at java.lang.Class.getDeclaredConstructors0(Native Method)[:1.8.0_65]
          at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)[:1.8.0_65]
          at java.lang.Class.getConstructor0(Class.java:3075)[:1.8.0_65]
          at java.lang.Class.newInstance(Class.java:412)[:1.8.0_65]
          at org.apache.myfaces.shared.util.ClassUtils.newInstance(ClassUtils.java:411)[131:org.apache.myfaces.core.impl:2.2.6]
          at org.apache.myfaces.shared.util.ClassUtils.newInstance(ClassUtils.java:403)[131:org.apache.myfaces.core.impl:2.2.6]
          at org.apache.myfaces.shared.util.ClassUtils.newInstance(ClassUtils.java:379)[131:org.apache.myfaces.core.impl:2.2.6]
          at org.apache.myfaces.config.FacesConfigurator.configureLifecycle(FacesConfigurator.java:1249)[131:org.apache.myfaces.core.impl:2.2.6]
          at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:487)[131:org.apache.myfaces.core.impl:2.2.6]
          at org.apache.myfaces.webapp.AbstractFacesInitializer.buildConfiguration(AbstractFacesInitializer.java:416)[131:org.apache.myfaces.core.impl:2.2.6]
          at org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(Jsp21FacesInitializer.java:73)[131:org.apache.myfaces.core.impl:2.2.6]
          at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:172)[131:org.apache.myfaces.core.impl:2.2.6]
          at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:119)[131:org.apache.myfaces.core.impl:2.2.6]
          at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext$3.call(HttpServiceContext.java:338)[207:org.ops4j.pax.web.pax-web-jetty:4.2.3]
          at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext$3.call(HttpServiceContext.java:334)[207:org.ops4j.pax.web.pax-web-jetty:4.2.3]
          at org.ops4j.pax.swissbox.core.ContextClassLoaderUtils.doWithClassLoader(ContextClassLoaderUtils.java:60)[207:org.ops4j.pax.web.pax-web-jetty:4.2.3]
          at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.callContextInitialized(HttpServiceContext.java:333)[207:org.ops4j.pax.web.pax-web-jetty:4.2.3]
          at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:791)[168:org.eclipse.jetty.server:9.2.10.v20150310]
          at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:294)[169:org.eclipse.jetty.servlet:9.2.10.v20150310]
          at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)[168:org.eclipse.jetty.server:9.2.10.v20150310]
          at org.ops4j.pax.web.service.jetty.internal.HttpServiceContext.doStart(HttpServiceContext.java:245)[207:org.ops4j.pax.web.pax-web-jetty:4.2.3]
          at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)[171:org.eclipse.jetty.util:9.2.10.v20150310]
          at org.ops4j.pax.web.service.jetty.internal.JettyServerImpl$1.start(JettyServerImpl.java:258)[207:org.ops4j.pax.web.pax-web-jetty:4.2.3]
          at org.ops4j.pax.web.service.internal.HttpServiceStarted.end(HttpServiceStarted.java:1047)[209:org.ops4j.pax.web.pax-web-runtime:4.2.3]
          at org.ops4j.pax.web.service.internal.HttpServiceProxy.end(HttpServiceProxy.java:413)[209:org.ops4j.pax.web.pax-web-runtime:4.2.3]
          at org.ops4j.pax.web.extender.war.internal.RegisterWebAppVisitorWC.end(RegisterWebAppVisitorWC.java:380)[205:org.ops4j.pax.web.pax-web-extender-war:4.2.3]
          at org.ops4j.pax.web.extender.war.internal.model.WebApp.accept(WebApp.java:692)[205:org.ops4j.pax.web.pax-web-extender-war:4.2.3]
          at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.register(WebAppPublisher.java:237)[205:org.ops4j.pax.web.pax-web-extender-war:4.2.3]
          at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:182)[205:org.ops4j.pax.web.pax-web-extender-war:4.2.3]
          at org.ops4j.pax.web.extender.war.internal.WebAppPublisher$WebAppDependencyListener.addingService(WebAppPublisher.java:135)[205:org.ops4j.pax.web.pax-web-extender-war:4.2.3]
          at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)[org.osgi.core-6.0.0.jar:]
          at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)[org.osgi.core-6.0.0.jar:]
          at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[org.osgi.core-6.0.0.jar:]
          at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)[org.osgi.core-6.0.0.jar:]
          at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)[org.osgi.core-6.0.0.jar:]
          at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:991)[org.apache.felix.framework-5.4.0.jar:]
          at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:839)[org.apache.felix.framework-5.4.0.jar:]
          at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:546)[org.apache.felix.framework-5.4.0.jar:]
          at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4557)[org.apache.felix.framework-5.4.0.jar:]
          at org.apache.felix.framework.Felix.registerService(Felix.java:3549)[org.apache.felix.framework-5.4.0.jar:]
          at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:348)[org.apache.felix.framework-5.4.0.jar:]
          at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:355)[org.apache.felix.framework-5.4.0.jar:]
          at org.ops4j.pax.cdi.web.CdiWebAppDependencyManager.register(CdiWebAppDependencyManager.java:63)[195:org.ops4j.pax.cdi.web:0.13.0.SNAPSHOT]
          at org.ops4j.pax.cdi.web.CdiWebAppDependencyManager.postCreate(CdiWebAppDependencyManager.java:88)[195:org.ops4j.pax.cdi.web:0.13.0.SNAPSHOT]
          at org.ops4j.pax.cdi.openwebbeans.impl.OpenWebBeansCdiContainerFactory.createContainer(OpenWebBeansCdiContainerFactory.java:66)[193:org.ops4j.pax.cdi.openwebbeans:0.13.0.SNAPSHOT]
          at org.ops4j.pax.cdi.extender.impl.CdiExtender.doCreateContainer(CdiExtender.java:144)[191:org.ops4j.pax.cdi.extender:0.13.0.SNAPSHOT]
          at org.ops4j.pax.cdi.extender.impl.CdiExtender.createContainer(CdiExtender.java:124)[191:org.ops4j.pax.cdi.extender:0.13.0.SNAPSHOT]
          at org.ops4j.pax.cdi.extender.impl.CdiExtender.addingBundle(CdiExtender.java:86)[191:org.ops4j.pax.cdi.extender:0.13.0.SNAPSHOT]
          at org.ops4j.pax.cdi.extender.impl.CdiExtender.addingBundle(CdiExtender.java:44)[191:org.ops4j.pax.cdi.extender:0.13.0.SNAPSHOT]
          at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:469)[org.osgi.core-6.0.0.jar:]
          at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:415)[org.osgi.core-6.0.0.jar:]
          at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[org.osgi.core-6.0.0.jar:]
          at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)[org.osgi.core-6.0.0.jar:]
          at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)[org.osgi.core-6.0.0.jar:]
          at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:916)[org.apache.felix.framework-5.4.0.jar:]
          at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:835)[org.apache.felix.framework-5.4.0.jar:]
          at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:517)[org.apache.felix.framework-5.4.0.jar:]
          at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4541)[org.apache.felix.framework-5.4.0.jar:]
          at org.apache.felix.framework.Felix.startBundle(Felix.java:2172)[org.apache.felix.framework-5.4.0.jar:]
          at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)[org.apache.felix.framework-5.4.0.jar:]
          at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)[org.apache.felix.framework-5.4.0.jar:]
          at org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1189)[9:org.apache.karaf.features.core:4.0.3]
          at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:836)[9:org.apache.karaf.features.core:4.0.3]
          at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1079)[9:org.apache.karaf.features.core:4.0.3]
          at org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:975)[9:org.apache.karaf.features.core:4.0.3]
          at java.util.concurrent.FutureTask.run(FutureTask.java:266)[:1.8.0_65]
          at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_65]
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_65]
          at java.lang.Thread.run(Thread.java:745)[:1.8.0_65]
  Caused by: java.lang.ClassNotFoundException: org.jboss.weld.context.ConversationContext not found by wrap_file__D__mvn-repo_org_jboss_weld_weld-core_1.2.0.Beta1_weld-core-1.2.0.Beta1.jar [230]
          at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1574)[org.apache.felix.framework-5.4.0.jar:]
          at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)[org.apache.felix.framework-5.4.0.jar:]
          at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0_65]
          ... 69 more
  </code></pre>
  
  <p>But the class it is looking for should be present:</p>
  
  <pre><code>karaf@root()&gt; package:exports | grep -i org.jboss.weld.context
  ...
  org.jboss.weld.context    | 0.0.0            | 230 | wrap_file__D__mvn-repo_org_jboss_weld_weld-core_1.2.0.Beta1_weld-core-1.2.0.Beta1.jar
  org.jboss.weld.context    | 1.0.0            | 184 | org.jboss.weld.osgi-bundle
  </code></pre>
  
  <p>It's kind of strange that it doesn't conflict, because two libraries export that package, but I'm not sure if that is the problem and if it should be the problem how to solve it, because both libraries seem to be needed during runtime.</p>
  
  <h3>OpenWebBeans</h3>
  
  <p>With OpenWebBeans I had to <a href="https://github.com/funfried/org.ops4j.pax.cdi/tree/0.x" rel="nofollow">patch the current development branch (0.x) of PAX-CDI</a>! to get it running, because of an old Jetty version (the JettyDecorator implemented an old-style Interface). Now everything is booting up fine, but as soon as a JSF Page is trying to access a Bean I get this exception:</p>
  
  <pre><code>2016-01-14 16:42:44,118 | WARN  | tp2011804352-187 | ServletHandler                   | 175 - org.eclipse.jetty.util - 9.2.10.v20150310 |
  javax.servlet.ServletException: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'loginController' resolved to null
          at javax.faces.webapp.FacesServlet.service(FacesServlet.java:230)[133:org.apache.myfaces.core.api:2.2.6]
          at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)[173:org.eclipse.jetty.servlet:9.2.10.v20150310]
          at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)[173:org.eclipse.jetty.servlet:9.2.10.v20150310]
          at org.primefaces.webapp.filter.FileUploadFilter.doFilter(FileUploadFilter.java:78)[213:org.primefaces:5.3.0]
          at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)[173:org.eclipse.jetty.servlet:9.2.10.v20150310]
          at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)[148:org.apache.shiro.web:1.2.4]
          at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:112)[148:org.apache.shiro.web:1.2.4]
          at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)[148:org.apache.shiro.web:1.2.4]
          at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)[148:org.apache.shiro.web:1.2.4]...
  </code></pre>
  
  <p><strong><em>My Bean</em></strong></p>
  
  <pre><code>...
  import javax.enterprise.context.RequestScoped;
  import javax.inject.Named;
  ...
  
  
  @Named("loginController")
  @RequestScoped
  public class LoginController implements Serializable
  {
      ...
  }
  </code></pre>
  
  <h2>So the questions are:</h2>
  
  <p>Does anybody know if there is something wrong with my configuration?
  Does anybody have a running Apache Karaf / CDI setup with JSF?
  Are there any known issues with Karaf and (PAX-)CDI?</p>
  
  <p>I really appreciate any help!</p>
  
  <p>Thanks in advance and kind regards
  Fabian</p>