ServiceMix 4
  1. ServiceMix 4
  2. SMX4-545

Update SMX to use aries version of blueprint and latest Felix/Karaf stuff that also uses aries

    Details

    • Type: Task Task
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3.0
    • Component/s: None
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      There is a nasty bug in geronimo blueprint that prevents it from working properly. We need to update to Aries to get the fix, but that means also updating a bunch of other things.

      Will supply patch.

      1. aries-nmr.patch
        28 kB
        Daniel Kulp
      2. aries-features.patch
        7 kB
        Daniel Kulp

        Activity

        Hide
        Freeman Fang added a comment -

        apply patch on behalf of Dan with thanks
        http://svn.apache.org/viewvc?rev=959663&view=rev

        Show
        Freeman Fang added a comment - apply patch on behalf of Dan with thanks http://svn.apache.org/viewvc?rev=959663&view=rev
        Hide
        Freeman Fang added a comment -

        Hi Guillaume,

        Use karaf snapshot is a good idea, we also can see if org.apache.felix.framework-3.0.1.jar work well with nmr/features.

        I will commit this patch very soon and create another ticket for changing dependency groupId in pom.xml and package name in src code of nmr/features, which can accommodate recent changes in karaf as a new TLP, so that we can upgrade to use karaf snapshot.

        Thanks
        Freeman

        Show
        Freeman Fang added a comment - Hi Guillaume, Use karaf snapshot is a good idea, we also can see if org.apache.felix.framework-3.0.1.jar work well with nmr/features. I will commit this patch very soon and create another ticket for changing dependency groupId in pom.xml and package name in src code of nmr/features, which can accommodate recent changes in karaf as a new TLP, so that we can upgrade to use karaf snapshot. Thanks Freeman
        Hide
        Guillaume Nodet added a comment -

        I guess we could use a karaf snapshot if that helps.

        Show
        Guillaume Nodet added a comment - I guess we could use a karaf snapshot if that helps.
        Hide
        Freeman Fang added a comment -

        Hi,

        No, that not fix it.

        But I figured out why I see the error but you didn't.

        Your nmr patch still use /org.apache.felix.framework-3.0.1.jar, it will cause similar error when we use nmr kit, some exception like
        ~/projects/smx/smx4/all/nmr/assembly/target/apache-servicemix-nmr-1.3.0-SNAPSHOT/bin ffang$ ./nmr
        Could not create framework: java.io.FileNotFoundException: /Users/ffang/projects/smx/smx4/all/nmr/assembly/target/apache-servicemix-nmr-1.3.0-SNAPSHOT/system/org/apache/felix/org.apache.felix.framework/3.0.1/org.apache.felix.framework-3.0.1.jar
        java.io.FileNotFoundException: /Users/ffang/projects/smx/smx4/all/nmr/assembly/target/apache-servicemix-nmr-1.3.0-SNAPSHOT/system/org/apache/felix/org.apache.felix.framework/3.0.1/org.apache.felix.framework-3.0.1.jar
        at org.apache.felix.karaf.main.Main.updateClassLoader(Main.java:813)
        at org.apache.felix.karaf.main.Main.launch(Main.java:187)
        at org.apache.felix.karaf.main.Main.main(Main.java:325)

        So I just change your nmr patch a little bit to use org.apache.felix.framework 2.0.5, to keep it same as karaf and features, then when I apply your features patch, I see the itests failure. If I keep your nmr patch, I will pass all tests, but it means org.apache.felix.framework version is different between karaf/nmr/features, which still also cause kit runtime problem.

        FYI, karaf[1] just upgrade to felix framework 3.0.1, maybe we can keep this issue open util next karaf release, which means we can use felix framework 3.0.1 also in nmr and features

        [1]https://issues.apache.org/jira/browse/KARAF-97

        Best Regards
        Freeman

        Show
        Freeman Fang added a comment - Hi, No, that not fix it. But I figured out why I see the error but you didn't. Your nmr patch still use /org.apache.felix.framework-3.0.1.jar, it will cause similar error when we use nmr kit, some exception like ~/projects/smx/smx4/all/nmr/assembly/target/apache-servicemix-nmr-1.3.0-SNAPSHOT/bin ffang$ ./nmr Could not create framework: java.io.FileNotFoundException: /Users/ffang/projects/smx/smx4/all/nmr/assembly/target/apache-servicemix-nmr-1.3.0-SNAPSHOT/system/org/apache/felix/org.apache.felix.framework/3.0.1/org.apache.felix.framework-3.0.1.jar java.io.FileNotFoundException: /Users/ffang/projects/smx/smx4/all/nmr/assembly/target/apache-servicemix-nmr-1.3.0-SNAPSHOT/system/org/apache/felix/org.apache.felix.framework/3.0.1/org.apache.felix.framework-3.0.1.jar at org.apache.felix.karaf.main.Main.updateClassLoader(Main.java:813) at org.apache.felix.karaf.main.Main.launch(Main.java:187) at org.apache.felix.karaf.main.Main.main(Main.java:325) So I just change your nmr patch a little bit to use org.apache.felix.framework 2.0.5, to keep it same as karaf and features, then when I apply your features patch, I see the itests failure. If I keep your nmr patch, I will pass all tests, but it means org.apache.felix.framework version is different between karaf/nmr/features, which still also cause kit runtime problem. FYI, karaf [1] just upgrade to felix framework 3.0.1, maybe we can keep this issue open util next karaf release, which means we can use felix framework 3.0.1 also in nmr and features [1] https://issues.apache.org/jira/browse/KARAF-97 Best Regards Freeman
        Hide
        Daniel Kulp added a comment -

        Freeman,

        Hmm... the tests are passing for me. Strange.

        in anycase, can you try removing the line:
        + getBundle("org.osgi", "org.osgi.core"),

        of:
        testing/support/src/main/java/org/apache/servicemix/platform/testing/support/AbstractIntegrationTest.java
        (in nmr)

        That may fix it.

        Show
        Daniel Kulp added a comment - Freeman, Hmm... the tests are passing for me. Strange. in anycase, can you try removing the line: + getBundle("org.osgi", "org.osgi.core"), of: testing/support/src/main/java/org/apache/servicemix/platform/testing/support/AbstractIntegrationTest.java (in nmr) That may fix it.
        Hide
        Freeman Fang added a comment - - edited

        Hi Dan,

        After apply features patch, all tests in examples/itests/tests are failed.
        The reason is that can't start several bundles (such as pax-logging-service, pax-web-runtime, pax-web-extender-whiteboard, org.apache.servicemix.nmr.osgi) for Constraint violation.
        The detailed exception is
        [org.apache.servicemix.examples.CXFNMRIntegrationTest] : Starting Apache ServiceMix NMR OSGi (org.apache.servicemix.nmr.osgi)
        DEBUG: Constraint violation for 71.0 detected; module can see org.osgi.util.tracker from [5.0] and org.osgi.util.tracker from [0]
        [org.apache.servicemix.examples.CXFNMRIntegrationTest] : cannot start bundle Apache ServiceMix NMR OSGi (org.apache.servicemix.nmr.osgi)
        org.osgi.framework.BundleException: Unable to resolve due to constraint violation.
        at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3306)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1657)
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:905)
        at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:892)
        at org.springframework.osgi.test.AbstractOsgiTests.startBundle(AbstractOsgiTests.java:341)
        at org.springframework.osgi.test.AbstractOsgiTests.startup(AbstractOsgiTests.java:258)
        at org.springframework.osgi.test.AbstractOsgiTests.prepareTestExecution(AbstractOsgiTests.java:374)
        at org.springframework.osgi.test.AbstractOsgiTests.runBare(AbstractOsgiTests.java:203)
        at org.springframework.osgi.test.AbstractOsgiTests$1.protect(AbstractOsgiTests.java:184)
        at junit.framework.TestResult.runProtected(TestResult.java:128)
        at org.springframework.osgi.test.AbstractOsgiTests.run(AbstractOsgiTests.java:181)
        at junit.framework.TestSuite.runTest(TestSuite.java:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
        at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
        at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:163)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:84)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:261)
        at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:875)
        [org.apache.servicemix.examples.CXFNMRIntegrationTest] : Caught exception starting up

        Seems now we have two system bundles(one with bundle id 0, one with bundle id 5, the second one should be here) both export org.osgi.util.tracker which cause this error.

        Best Regards
        Freeman

        Show
        Freeman Fang added a comment - - edited Hi Dan, After apply features patch, all tests in examples/itests/tests are failed. The reason is that can't start several bundles (such as pax-logging-service, pax-web-runtime, pax-web-extender-whiteboard, org.apache.servicemix.nmr.osgi) for Constraint violation. The detailed exception is [org.apache.servicemix.examples.CXFNMRIntegrationTest] : Starting Apache ServiceMix NMR OSGi (org.apache.servicemix.nmr.osgi) DEBUG: Constraint violation for 71.0 detected; module can see org.osgi.util.tracker from [5.0] and org.osgi.util.tracker from [0] [org.apache.servicemix.examples.CXFNMRIntegrationTest] : cannot start bundle Apache ServiceMix NMR OSGi (org.apache.servicemix.nmr.osgi) org.osgi.framework.BundleException: Unable to resolve due to constraint violation. at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3306) at org.apache.felix.framework.Felix.startBundle(Felix.java:1657) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:905) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:892) at org.springframework.osgi.test.AbstractOsgiTests.startBundle(AbstractOsgiTests.java:341) at org.springframework.osgi.test.AbstractOsgiTests.startup(AbstractOsgiTests.java:258) at org.springframework.osgi.test.AbstractOsgiTests.prepareTestExecution(AbstractOsgiTests.java:374) at org.springframework.osgi.test.AbstractOsgiTests.runBare(AbstractOsgiTests.java:203) at org.springframework.osgi.test.AbstractOsgiTests$1.protect(AbstractOsgiTests.java:184) at junit.framework.TestResult.runProtected(TestResult.java:128) at org.springframework.osgi.test.AbstractOsgiTests.run(AbstractOsgiTests.java:181) at junit.framework.TestSuite.runTest(TestSuite.java:232) at junit.framework.TestSuite.run(TestSuite.java:227) at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83) at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:163) at org.apache.maven.surefire.Surefire.run(Surefire.java:84) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:261) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:875) [org.apache.servicemix.examples.CXFNMRIntegrationTest] : Caught exception starting up Seems now we have two system bundles(one with bundle id 0, one with bundle id 5, the second one should be here) both export org.osgi.util.tracker which cause this error. Best Regards Freeman
        Hide
        Daniel Kulp added a comment -


        Updated patches that just take felix up to 2.0.5 to match what karaf is using. When the new "TLP version" of Karaf is released, we can re-look at updating the Felix stuff.

        Show
        Daniel Kulp added a comment - Updated patches that just take felix up to 2.0.5 to match what karaf is using. When the new "TLP version" of Karaf is released, we can re-look at updating the Felix stuff.
        Hide
        Freeman Fang added a comment -

        Hi Dan,

        I build servicemx 4 kit with your patch, when I start it, I get exception like
        Could not create framework: java.io.FileNotFoundException: /Users/ffang/apache-servicemix-4.3.0-SNAPSHOT/system/org/apache/felix/org.apache.felix.framework/3.0.1/org.apache.felix.framework-3.0.1.jar
        java.io.FileNotFoundException: /Users/ffang/apache-servicemix-4.3.0-SNAPSHOT/system/org/apache/felix/org.apache.felix.framework/3.0.1/org.apache.felix.framework-3.0.1.jar
        at org.apache.felix.karaf.main.Main.updateClassLoader(Main.java:813)
        at org.apache.felix.karaf.main.Main.launch(Main.java:187)
        at org.apache.felix.karaf.main.Main.main(Main.java:325)

        Actually the org.apache.felix.framework jar should be picked up and assembled by karaf, so we need a karaf version which use felix.framework.version as 3.0.1, unfortunately the latest karaf release still use felix.framework.version 2.0.5, this mismatch cause the exception.

        We need upgrade karaf side felix.framework.version firstly if we really need felix.framework.version 3.0.1 for aries side blueprint.

        Best Regards
        Freeman

        Show
        Freeman Fang added a comment - Hi Dan, I build servicemx 4 kit with your patch, when I start it, I get exception like Could not create framework: java.io.FileNotFoundException: /Users/ffang/apache-servicemix-4.3.0-SNAPSHOT/system/org/apache/felix/org.apache.felix.framework/3.0.1/org.apache.felix.framework-3.0.1.jar java.io.FileNotFoundException: /Users/ffang/apache-servicemix-4.3.0-SNAPSHOT/system/org/apache/felix/org.apache.felix.framework/3.0.1/org.apache.felix.framework-3.0.1.jar at org.apache.felix.karaf.main.Main.updateClassLoader(Main.java:813) at org.apache.felix.karaf.main.Main.launch(Main.java:187) at org.apache.felix.karaf.main.Main.main(Main.java:325) Actually the org.apache.felix.framework jar should be picked up and assembled by karaf, so we need a karaf version which use felix.framework.version as 3.0.1, unfortunately the latest karaf release still use felix.framework.version 2.0.5, this mismatch cause the exception. We need upgrade karaf side felix.framework.version firstly if we really need felix.framework.version 3.0.1 for aries side blueprint. Best Regards Freeman
        Hide
        Daniel Kulp added a comment -

        Patch updates to a bunch of latest things.

        Also allows ability to run jbi/ittests in eclipse directly if you modify the "order" to put the pax stuff first in the eclipse project.

        Show
        Daniel Kulp added a comment - Patch updates to a bunch of latest things. Also allows ability to run jbi/ittests in eclipse directly if you modify the "order" to put the pax stuff first in the eclipse project.

          People

          • Assignee:
            Freeman Fang
            Reporter:
            Daniel Kulp
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development