Classloader castException with karaf CXF using blueprint
<p>I have a problem to launch my bundle in karaf. 
I have installed the features cxf and http.
But when i try to install my bundle in Karaf, i have this Exception :</p>

<pre><code>2016-09-18 17:07:49,157 | ERROR | nsole user karaf | BlueprintContainerImpl           | 12 - org.apache.aries.blueprint.core - 1.6.2 | Unable to start blueprint container for bundle karafcxf.rest/1.0.0.SNAPSHOT
org.osgi.service.blueprint.container.ComponentDefinitionException: Unable to initialize bean cxf
....
Caused by: org.apache.cxf.bus.extension.ExtensionException: Could not create object of extension class org.apache.cxf.ws.policy.PolicyEngineImpl.
        at org.apache.cxf.bus.extension.Extension.load(Extension.java:241)
        at org.apache.cxf.bus.osgi.CXFExtensionBundleListener$OSGiExtension.load(CXFExtensionBundleListener.java:145)
        at org.......
Caused by: java.lang.ClassCastException: Cannot cast org.apache.cxf.service.factory.FactoryBeanListenerManager to org.apache.cxf.service.factory.FactoryBeanListenerManager
        at java.lang.Class.cast(Class.java:3258)[:1.8.0]
        at org.apache.cxf.bus.extension.ExtensionManagerImpl.getBeanOfType(ExtensionManagerImpl.java:322)
        at org.apache.cxf.bus.blueprint.BlueprintBeanLocator.getBeanOfType(BlueprintBeanLocator.java:99)
           at .....
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)[:1.8.0]
            at java.lang.reflect.Constructor.newInstance(Constructor.java:408)[:1.8.0]
            at org.apache.cxf.bus.extension.Extension.load(Extension.java:217)
</code></pre>

<p>here is my blueprint context : </p>

<pre><code>&lt;blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
    xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws" xmlns:jaxrs="http://cxf.apache.org/blueprint/jaxrs"
    xmlns:cxf="http://cxf.apache.org/blueprint/core"
    xsi:schemaLocation="
  http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
  http://cxf.apache.org/blueprint/jaxws http://cxf.apache.org/schemas/blueprint/jaxws.xsd
  http://cxf.apache.org/blueprint/jaxrs http://cxf.apache.org/schemas/blueprint/jaxrs.xsd
  http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd"&gt;

    &lt;cxf:bus id="cxfBus1"&gt;
        &lt;cxf:features&gt;
            &lt;cxf:logging /&gt;
        &lt;/cxf:features&gt;
    &lt;/cxf:bus&gt;

    &lt;!-- &lt;bean id="resourceWriter" --&gt;
    &lt;!-- class="com.wordnik.swagger.jaxrs.listing.ResourceListingProvider" /&gt; --&gt;
    &lt;!-- &lt;bean id="apiWriter" --&gt;
    &lt;!-- class="com.wordnik.swagger.jaxrs.listing.ApiDeclarationProvider" /&gt; --&gt;

  &lt;!-- JAXRS providers --&gt;
&lt;!--     &lt;bean id="jsonProvider" class="com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider" /&gt; --&gt;


&lt;!--    &lt;bean id="swaggerResourceJSON" --&gt;
&lt;!--        class="com.wordnik.swagger.jaxrs.listing.ApiListingResourceJSON" /&gt; --&gt;

    &lt;!-- CXF Swagger2Feature --&gt;
&lt;!--    &lt;bean id="swagger2Feature" class="org.apache.cxf.jaxrs.swagger.Swagger2Feature"&gt; --&gt;
&lt;!--        &lt;property name="resourcePackage" value="com.sau.swagger.intg" /&gt; --&gt;
&lt;!--        &lt;property name="version" value="2.0" /&gt; --&gt;
&lt;!--        &lt;property name="basePath" --&gt;
&lt;!--            value="http://localhost:8080/SwaggerUI-Integration/rest" /&gt; --&gt;
&lt;!--        &lt;property name="title" value="Swagger UI Integration Sample" /&gt; --&gt;
&lt;!--        &lt;property name="description" --&gt;
&lt;!--            value="Swagger UI Integration Sample for demonstrating its working." /&gt; --&gt;
&lt;!--        &lt;property name="contact" value="saurabh29july@gmail.com" /&gt; --&gt;
&lt;!--        &lt;property name="scan" value="true" /&gt; --&gt;
&lt;!--    &lt;/bean&gt; --&gt;


    &lt;jaxrs:server address="/karafsimple" id="someRestService"&gt;
        &lt;jaxrs:serviceBeans&gt;
            &lt;ref component-id="restServiceImpl" /&gt;
        &lt;/jaxrs:serviceBeans&gt;
&lt;!--        &lt;jaxrs:providers&gt; --&gt;
&lt;!--            &lt;ref component-id="jsonProvider" /&gt; --&gt;
&lt;!--        &lt;/jaxrs:providers&gt; --&gt;
&lt;!--        &lt;jaxrs:features&gt; --&gt;
&lt;!--            &lt;ref component-id="swagger2Feature" /&gt; --&gt;
&lt;!--        &lt;/jaxrs:features&gt; --&gt;
    &lt;/jaxrs:server&gt;


    &lt;!-- Implementation of the rest service --&gt;
    &lt;bean id="restServiceImpl" class="me.rerun.karafcxf.rest.HelloRestServiceImpl"&gt;
        &lt;property name="helloService" ref="helloServiceBean" /&gt;  &lt;!--Points to the reference below --&gt;
    &lt;/bean&gt;

    &lt;!-- This has to point to the service registered through serviceimpl.xml 
        in the service.impl project --&gt;
    &lt;reference id="helloServiceBean" interface="me.rerun.karafcxf.service.impl.HelloService"&gt;

    &lt;/reference&gt;

&lt;/blueprint&gt;
</code></pre>

<p>Here is my maven dependecy tree : </p>

<pre><code>[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building karafcxf.rest 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ karafcxf.rest ---
[INFO] karafcxf:karafcxf.rest:bundle:1.0-SNAPSHOT
[INFO] +- karafcxf:karafcxf.service.impl:jar:1.0-SNAPSHOT:compile
[INFO] +- log4j:log4j:jar:1.2.17:compile
[INFO] +- com.google.guava:guava:jar:14.0.1:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.1:compile
[INFO] +- org.codehaus.jackson:jackson-core-asl:jar:1.8.9:compile
[INFO] +- org.codehaus.jackson:jackson-mapper-asl:jar:1.8.9:compile
[INFO] +- org.slf4j:slf4j-api:jar:1.7.2:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.6:compile
[INFO] +- org.apache.solr:solr-solrj:jar:4.4.0:compile
[INFO] |  +- org.apache.zookeeper:zookeeper:jar:3.4.5:compile
[INFO] |  +- commons-io:commons-io:jar:2.1:compile
[INFO] |  +- org.noggit:noggit:jar:0.5:compile
[INFO] |  +- org.apache.httpcomponents:httpmime:jar:4.2.3:compile
[INFO] |  \- org.codehaus.woodstox:wstx-asl:jar:3.2.7:runtime
[INFO] +- org.osgi:org.osgi.core:jar:4.3.1:provided
[INFO] +- org.apache.cxf:cxf-rt-frontend-jaxrs:jar:2.7.11:compile
[INFO] |  +- org.apache.cxf:cxf-api:jar:2.7.11:compile
[INFO] |  |  +- org.codehaus.woodstox:woodstox-core-asl:jar:4.2.1:compile
[INFO] |  |  |  \- org.codehaus.woodstox:stax2-api:jar:3.1.4:compile
[INFO] |  |  +- org.apache.ws.xmlschema:xmlschema-core:jar:2.1.0:compile
[INFO] |  |  +- org.apache.geronimo.specs:geronimo-javamail_1.4_spec:jar:1.7.1:compile
[INFO] |  |  \- wsdl4j:wsdl4j:jar:1.6.3:compile
[INFO] |  +- org.apache.cxf:cxf-rt-core:jar:2.7.11:compile
[INFO] |  |  \- com.sun.xml.bind:jaxb-impl:jar:2.1.13:compile
[INFO] |  +- javax.ws.rs:javax.ws.rs-api:jar:2.0-m10:compile
[INFO] |  \- org.apache.cxf:cxf-rt-bindings-xml:jar:2.7.11:compile
[INFO] +- org.apache.cxf:cxf-rt-frontend-jaxws:jar:2.7.11:compile
[INFO] |  +- xml-resolver:xml-resolver:jar:1.2:compile
[INFO] |  +- asm:asm:jar:3.3.1:compile
[INFO] |  +- org.apache.cxf:cxf-rt-bindings-soap:jar:2.7.11:compile
[INFO] |  |  \- org.apache.cxf:cxf-rt-databinding-jaxb:jar:2.7.11:compile
[INFO] |  +- org.apache.cxf:cxf-rt-frontend-simple:jar:2.7.11:compile
[INFO] |  \- org.apache.cxf:cxf-rt-ws-addr:jar:2.7.11:compile
[INFO] |     \- org.apache.cxf:cxf-rt-ws-policy:jar:2.7.11:compile
[INFO] |        \- org.apache.neethi:neethi:jar:3.0.3:compile
[INFO] +- org.apache.cxf:cxf-rt-transports-http:jar:2.7.11:compile
[INFO] +- org.apache.cxf:cxf-rt-transports-http-jetty:jar:2.7.11:compile
[INFO] |  +- org.eclipse.jetty:jetty-server:jar:8.1.14.v20131031:compile
[INFO] |  |  +- org.eclipse.jetty:jetty-continuation:jar:8.1.14.v20131031:compile
[INFO] |  |  \- org.eclipse.jetty:jetty-http:jar:8.1.14.v20131031:compile
[INFO] |  |     \- org.eclipse.jetty:jetty-io:jar:8.1.14.v20131031:compile
[INFO] |  |        \- org.eclipse.jetty:jetty-util:jar:8.1.14.v20131031:compile
[INFO] |  +- org.eclipse.jetty:jetty-security:jar:8.1.14.v20131031:compile
[INFO] |  \- org.apache.geronimo.specs:geronimo-servlet_3.0_spec:jar:1.0:compile
[INFO] \- org.apache.httpcomponents:httpclient:jar:4.2.3:compile
[INFO]    +- org.apache.httpcomponents:httpcore:jar:4.2.2:compile
[INFO]    +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO]    \- commons-codec:commons-codec:jar:1.6:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 6.865 s
[INFO] Finished at: 2016-09-18T17:17:41+02:00
[INFO] Final Memory: 14M/246M
[INFO] ------------------------------------------------------------------------
</code></pre>