ServiceMix 4
  1. ServiceMix 4
  2. SMX4-764

Override Apache Felix Framework to 3.0.8 version

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.3.0
    • Fix Version/s: 4.3.0
    • Component/s: None
    • Labels:
      None

      Description

      By default, ServiceMix 4.3.0 uses Karaf 2.1.3. The default OSGi framework used is Apache Felix Framework 3.0.2.

      We have two issues using Felix 3.0.2:

      1/ NoClassDefFoundError: javax.xml.namespace.QName
      The workaround is to add javax.xml.namespace in the Import-Package statement of the bundles (using CXF especially).

      2/ IllegalStateException: zip file closed
      It's a known Felix bug around refresh.

      We don't have these issues using Equinox (adding karaf.framework=equinox in etc/custom.properties).

      The update to Felix 3.0.8 looks to solve the issue (I perform some tests to validate that).

        Activity

        Hide
        Jean-Baptiste Onofré added a comment -

        From my mail on the dev mailing list:

        Hi guys,

        What I did:

        1/ in etc/config.properties, I overrided the Felix Framework version:
        karaf.framework.felix=$

        {karaf.default.repository}

        /org/apache/felix/org.apache.felix.framework/3.0.8/org.apache.felix.framework-3.0.8.jar
        2/ in the system folder repo, I have added the Felix Framework 3.0.8 jar.

        ServiceMix 4.3.0 starts without problem and I haven't the "zip closed" message during features:install camel-nmr.
        The features:install camel-cxf also works:

        karaf@root> shell:info
        [...]
        OSGi Framework org.apache.felix.framework - 3.0.8
        [...]
        karaf@root> features:install camel-cxf
        karaf@root>

        It's something that I can easily do in the ServiceMix assembly.

        However, if I try:

        features:install examples-cxf-nmr

        I got the same error:
        Caused by: java.lang.NoClassDefFoundError: javax.xml.namespace.QName not found from bundle [cxf-nmr]
        at $Proxy120.<clinit>(Unknown Source)

        So the examples should be fix to add Import-Package javax.xml.namespace statement.

        I propose:
        1/ I cancel the ServiceMix 4.3.0 release
        2/ I update the ServiceMix assembly to override the Felix framework version in ServiceMix
        3/ I update the examples/web/pom.xml (correct the parent POM version)
        4/ I fix the examples/cxf-nmr with Import-Package: javax.xml.namespace
        5/ I resubmit a release tonight

        Show
        Jean-Baptiste Onofré added a comment - From my mail on the dev mailing list: Hi guys, What I did: 1/ in etc/config.properties, I overrided the Felix Framework version: karaf.framework.felix=$ {karaf.default.repository} /org/apache/felix/org.apache.felix.framework/3.0.8/org.apache.felix.framework-3.0.8.jar 2/ in the system folder repo, I have added the Felix Framework 3.0.8 jar. ServiceMix 4.3.0 starts without problem and I haven't the "zip closed" message during features:install camel-nmr. The features:install camel-cxf also works: karaf@root> shell:info [...] OSGi Framework org.apache.felix.framework - 3.0.8 [...] karaf@root> features:install camel-cxf karaf@root> It's something that I can easily do in the ServiceMix assembly. However, if I try: features:install examples-cxf-nmr I got the same error: Caused by: java.lang.NoClassDefFoundError: javax.xml.namespace.QName not found from bundle [cxf-nmr] at $Proxy120.<clinit>(Unknown Source) So the examples should be fix to add Import-Package javax.xml.namespace statement. I propose: 1/ I cancel the ServiceMix 4.3.0 release 2/ I update the ServiceMix assembly to override the Felix framework version in ServiceMix 3/ I update the examples/web/pom.xml (correct the parent POM version) 4/ I fix the examples/cxf-nmr with Import-Package: javax.xml.namespace 5/ I resubmit a release tonight
        Hide
        Jean-Baptiste Onofré added a comment -

        The examples itests use AbstractIntegrationTest coming from the NMR.
        Without upgrade the NMR to use Felix Framework 3.0.8, the itests fail because there are two bundles exporting org.osgi.util.tracker package.

        As I don't wanna release a new NMR version, I propose to disable the itests for the release and fix that after the release.

        I send an e-mail on the dev mailing list.

        Show
        Jean-Baptiste Onofré added a comment - The examples itests use AbstractIntegrationTest coming from the NMR. Without upgrade the NMR to use Felix Framework 3.0.8, the itests fail because there are two bundles exporting org.osgi.util.tracker package. As I don't wanna release a new NMR version, I propose to disable the itests for the release and fix that after the release. I send an e-mail on the dev mailing list.
        Hide
        Jean-Baptiste Onofré added a comment -

        Nevermind, I defined the framework in features. I limited the change only on the assembly. It looks good so far.

        Show
        Jean-Baptiste Onofré added a comment - Nevermind, I defined the framework in features. I limited the change only on the assembly. It looks good so far.
        Hide
        Jean-Baptiste Onofré added a comment -

        Revision 1074469.
        The Felix framework version is not override to use 3.0.8.

        Show
        Jean-Baptiste Onofré added a comment - Revision 1074469. The Felix framework version is not override to use 3.0.8.
        Hide
        Jean-Baptiste Onofré added a comment -

        Examples tests:

        • features:install examples-cxf-osgi: OK
        • features:install examples-cxf-jaxrs: OK
        • features:install examples-cxf-nmr: already the same issue around NoClassDefFoundError: javax.xml.namespace.QName not found from bundle [cxf-nmr]. To be fixed in the example.
        • features:install examples-camel-osgi: OK
        • features:install examples-camel-blueprint: OK
        • features:install examples-camel-nmr: it's stuck after Refreshing bundles org.apache.servicemix.document (81). Removing ServiceMix components in featuresBoot looks to fix but I got ClassNotFoundException: org.osgi.framework.ServiceRegistration not found by org.springframework.osgi.core [71] even if it works.
        • features:install examples-camel-nmr-blueprint: error java.lang.ClassNotFoundException: org.apache.servicemix.nmr.api.service.ServiceHelper not found by org.apache.servicemix.jbi.runtime [94] and stuck. Removing the ServiceMix components fix the stuck issue.
        • features:install examples-cxf-camel-nmr: same stuck issue. After removing the ServiceMix components, I got ERROR: Bundle org.apache.servicemix.nmr.osgi [85]: EventDispatcher: Error during dispatch. (java.lang.NoClassDefFoundError: org/apache/servicemix/executors/Executor)
          java.lang.NoClassDefFoundError: org/apache/servicemix/executors/Executor ... ClassNotFoundException: org.osgi.framework.ServiceRegistration not found by org.springframework.osgi.core [71]
        • features:install examples-cxf-ws-addressing: OK
        • features:install examples-cxf-wsdl-first-osgi-package: OK
        • features:install examples-cxf-ws-security-osgi: NoClassDefFoundError: javax.xml.namespace.QName not found from bundle [cxf-ws-security-osgi]
        • features:install examples-cxf-ws-rm: OK
        • features:install examples-nmr: OK
        • features:install examples-ode-helloworld: OK
        • features:install examples-ode-ping-pong: OK

        I'm gonna make new tests using Felix framework 3.0.9.

        Show
        Jean-Baptiste Onofré added a comment - Examples tests: features:install examples-cxf-osgi: OK features:install examples-cxf-jaxrs: OK features:install examples-cxf-nmr: already the same issue around NoClassDefFoundError: javax.xml.namespace.QName not found from bundle [cxf-nmr] . To be fixed in the example. features:install examples-camel-osgi: OK features:install examples-camel-blueprint: OK features:install examples-camel-nmr: it's stuck after Refreshing bundles org.apache.servicemix.document (81). Removing ServiceMix components in featuresBoot looks to fix but I got ClassNotFoundException: org.osgi.framework.ServiceRegistration not found by org.springframework.osgi.core [71] even if it works. features:install examples-camel-nmr-blueprint: error java.lang.ClassNotFoundException: org.apache.servicemix.nmr.api.service.ServiceHelper not found by org.apache.servicemix.jbi.runtime [94] and stuck. Removing the ServiceMix components fix the stuck issue. features:install examples-cxf-camel-nmr: same stuck issue. After removing the ServiceMix components, I got ERROR: Bundle org.apache.servicemix.nmr.osgi [85] : EventDispatcher: Error during dispatch. (java.lang.NoClassDefFoundError: org/apache/servicemix/executors/Executor) java.lang.NoClassDefFoundError: org/apache/servicemix/executors/Executor ... ClassNotFoundException: org.osgi.framework.ServiceRegistration not found by org.springframework.osgi.core [71] features:install examples-cxf-ws-addressing: OK features:install examples-cxf-wsdl-first-osgi-package: OK features:install examples-cxf-ws-security-osgi: NoClassDefFoundError: javax.xml.namespace.QName not found from bundle [cxf-ws-security-osgi] features:install examples-cxf-ws-rm: OK features:install examples-nmr: OK features:install examples-ode-helloworld: OK features:install examples-ode-ping-pong: OK I'm gonna make new tests using Felix framework 3.0.9.
        Hide
        Jean-Baptiste Onofré added a comment -

        Gert said to try to add examples-camel-cxf and examples-camel-nmr in the featuresBoot.

        I try it.

        Show
        Jean-Baptiste Onofré added a comment - Gert said to try to add examples-camel-cxf and examples-camel-nmr in the featuresBoot. I try it.
        Hide
        Jean-Baptiste Onofré added a comment -

        Revision 1074609: I enhanced the Felix Framework override using a more elegant way: I override in the etc/custom.properties file in place of overriding the whole etc/config.properties file.

        Show
        Jean-Baptiste Onofré added a comment - Revision 1074609: I enhanced the Felix Framework override using a more elegant way: I override in the etc/custom.properties file in place of overriding the whole etc/config.properties file.
        Hide
        Jean-Baptiste Onofré added a comment -

        Adding camel-nmr and cxf-nmr in the featuresBoot (just before the ServiceMix Components) doesn't fix the issue.
        For instance, I'm still stuck on org.apache.servicemix.document refresh and get:

        karaf@root> features:install examples-camel-nmr
        Refreshing bundles org.apache.servicemix.document (81)
        Exception in thread "pool-component.servicemix-wsn2005.consumer-thread-3" java.lang.NoClassDefFoundError: org/apache/servicemix/nmr/api/service/ServiceHelper
        at org.apache.servicemix.jbi.runtime.impl.ComponentContextImpl.deactivateEndpoint(ComponentContextImpl.java:129)
        at org.apache.servicemix.common.endpoints.ProviderEndpoint.deactivate(ProviderEndpoint.java:69)
        at org.apache.servicemix.common.DefaultServiceUnit.removeEndpoint(DefaultServiceUnit.java:206)
        at org.apache.servicemix.common.DefaultComponent.removeEndpoint(DefaultComponent.java:301)
        at org.apache.servicemix.wsn.component.WSNComponent$WSNEndpointManager$1.run(WSNComponent.java:283)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
        Caused by: java.lang.ClassNotFoundException: org.apache.servicemix.nmr.api.service.ServiceHelper not found by org.apache.servicemix.jbi.runtime [94]
        at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:787)
        at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
        at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
        ... 8 more

        I'm testing the others examples and digging around.

        Show
        Jean-Baptiste Onofré added a comment - Adding camel-nmr and cxf-nmr in the featuresBoot (just before the ServiceMix Components) doesn't fix the issue. For instance, I'm still stuck on org.apache.servicemix.document refresh and get: karaf@root> features:install examples-camel-nmr Refreshing bundles org.apache.servicemix.document (81) Exception in thread "pool-component.servicemix-wsn2005.consumer-thread-3" java.lang.NoClassDefFoundError: org/apache/servicemix/nmr/api/service/ServiceHelper at org.apache.servicemix.jbi.runtime.impl.ComponentContextImpl.deactivateEndpoint(ComponentContextImpl.java:129) at org.apache.servicemix.common.endpoints.ProviderEndpoint.deactivate(ProviderEndpoint.java:69) at org.apache.servicemix.common.DefaultServiceUnit.removeEndpoint(DefaultServiceUnit.java:206) at org.apache.servicemix.common.DefaultComponent.removeEndpoint(DefaultComponent.java:301) at org.apache.servicemix.wsn.component.WSNComponent$WSNEndpointManager$1.run(WSNComponent.java:283) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662) Caused by: java.lang.ClassNotFoundException: org.apache.servicemix.nmr.api.service.ServiceHelper not found by org.apache.servicemix.jbi.runtime [94] at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:787) at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71) at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) ... 8 more I'm testing the others examples and digging around.
        Hide
        Jean-Baptiste Onofré added a comment -

        With camel-nmr and camel-cxf in the featuresBoot, it works.

        Show
        Jean-Baptiste Onofré added a comment - With camel-nmr and camel-cxf in the featuresBoot, it works.
        Hide
        Jean-Baptiste Onofré added a comment -

        So quick summary with Felix Framework 3.0.9 and camel-nmr/camel-cxf in featuresBoot:

        • examples-camel-nmr: OK
        • examples-camel-nmr-blueprint doesn't work: ServiceMix is stuck just after the org.apache.servicemix.document refresh (and the CPU usage is 100%) and I got ClassNotFoundException: org.apache.servicemix.nmr.api.service.ServiceHelper not found by org.apache.servicemix.jbi.runtime [94]
        • examples-cxf-camel-nmr doesn't work: ServiceMix is stuck after the refresh and the CPU usage is 100%
        • examples-cxf-ws-security-osgi doesn't work, same NoClassDefFoundError on javax.xml.namespace.QName
        Show
        Jean-Baptiste Onofré added a comment - So quick summary with Felix Framework 3.0.9 and camel-nmr/camel-cxf in featuresBoot: examples-camel-nmr: OK examples-camel-nmr-blueprint doesn't work: ServiceMix is stuck just after the org.apache.servicemix.document refresh (and the CPU usage is 100%) and I got ClassNotFoundException: org.apache.servicemix.nmr.api.service.ServiceHelper not found by org.apache.servicemix.jbi.runtime [94] examples-cxf-camel-nmr doesn't work: ServiceMix is stuck after the refresh and the CPU usage is 100% examples-cxf-ws-security-osgi doesn't work, same NoClassDefFoundError on javax.xml.namespace.QName
        Hide
        Jean-Baptiste Onofré added a comment -

        Fix on examples-cxf-ws-security-osgi: revision 1074812.

        Show
        Jean-Baptiste Onofré added a comment - Fix on examples-cxf-ws-security-osgi: revision 1074812.
        Hide
        Jean-Baptiste Onofré added a comment -

        Revision 1074823.

        Fix examples-cxf-nmr, examples-cxf-camel-nmr.
        Add camel-nmr and camel-cxf in the featuresBoot.

        I'm gonna perform new tests.

        Show
        Jean-Baptiste Onofré added a comment - Revision 1074823. Fix examples-cxf-nmr, examples-cxf-camel-nmr. Add camel-nmr and camel-cxf in the featuresBoot. I'm gonna perform new tests.
        Hide
        Jean-Baptiste Onofré added a comment -

        With the latest Gert's fix on features descriptor (to avoid to refresh Aries Blueprint bundle), all examples are OK.

        I'm gonna prepare a new release to vote.

        Show
        Jean-Baptiste Onofré added a comment - With the latest Gert's fix on features descriptor (to avoid to refresh Aries Blueprint bundle), all examples are OK. I'm gonna prepare a new release to vote.
        Hide
        Jean-Baptiste Onofré added a comment -

        All examples look good now so far.

        Thanks to Gert's latest fix on features descriptor (to avoid to refresh the Aries Blueprint bundle), see SMX4-762.

        We must update the features descriptor to use the OBR resolver to avoid this kind of issue.

        Show
        Jean-Baptiste Onofré added a comment - All examples look good now so far. Thanks to Gert's latest fix on features descriptor (to avoid to refresh the Aries Blueprint bundle), see SMX4-762 . We must update the features descriptor to use the OBR resolver to avoid this kind of issue.

          People

          • Assignee:
            Jean-Baptiste Onofré
            Reporter:
            Jean-Baptiste Onofré
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development