Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-4761

Transitive Dependency on org.osgi.core 4.1.0 Breaks Unit Tests

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: jboss-fuse-6.2.1
    • Fix Version/s: jboss-fuse-6.3
    • Component/s: Fabric8 v1
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      Create a simple blueprint project using a fabric-based route (example attached) with dependencies on the 6.2.1 GA versions of camel and fabric components (2.15.1.redhat-621084 and 1.2.0.redhat-621084 respectively)

      Add unit test support via camel-test-blueprint.

      Add fabric-camel as a project dependency.

      Execute unit tests and the above exception is received.

      Add an exclusion for org.osgi.core to the fabric camel dependency and the exception does not occur.

      Rebuilding the fabric8-bom after adding the exclusion to the felix utils dependency eliminates the transitive dependency and clears the issue.

                  <dependency>
                      <groupId>org.apache.felix</groupId>
                      <artifactId>org.apache.felix.utils</artifactId>
                      <exclusions>
                          <exclusion>
                              <groupId>org.osgi</groupId>
                              <artifactId>org.osgi.compendium</artifactId>
                          </exclusion>
                          <exclusion>
                              <groupId>org.osgi</groupId>
                              <artifactId>org.osgi.core</artifactId>
                          </exclusion>
                      </exclusions>
                      <version>${felix-utils-version}</version>
                  </dependency>
      

      Show
      Create a simple blueprint project using a fabric-based route (example attached) with dependencies on the 6.2.1 GA versions of camel and fabric components (2.15.1.redhat-621084 and 1.2.0.redhat-621084 respectively) Add unit test support via camel-test-blueprint. Add fabric-camel as a project dependency. Execute unit tests and the above exception is received. Add an exclusion for org.osgi.core to the fabric camel dependency and the exception does not occur. Rebuilding the fabric8-bom after adding the exclusion to the felix utils dependency eliminates the transitive dependency and clears the issue. < dependency > < groupId >org.apache.felix</ groupId > < artifactId >org.apache.felix.utils</ artifactId > < exclusions > < exclusion > < groupId >org.osgi</ groupId > < artifactId >org.osgi.compendium</ artifactId > </ exclusion > < exclusion > < groupId >org.osgi</ groupId > < artifactId >org.osgi.core</ artifactId > </ exclusion > </ exclusions > < version >${felix-utils-version}</ version > </ dependency >
    • Sprint:
      6.3 Sprint 1 (4-Jan->29-Jan)

      Description

      In the fabric8-bom dependency management, the org.apache.felix.utils dependency excludes org.osgi.compendium, but org.osgi.core is not excluded. As a result, including the fabric-camel component in a project causes unit tests to break during teardown with:

      java.lang.NoClassDefFoundError: org.osgi.vendor.framework property not set
      at org.osgi.framework.FrameworkUtil$ImplHolder.run(FrameworkUtil.java:69)
      at java.security.AccessController.doPrivileged(Native Method)
      at org.osgi.framework.FrameworkUtil$ImplHolder.<clinit>(FrameworkUtil.java:59)
      at org.osgi.framework.FrameworkUtil.createFilter(FrameworkUtil.java:127)
      at org.apache.felix.connect.launch.ClasspathScanner.scanForBundles(ClasspathScanner.java:55)
      at org.apache.felix.connect.launch.ClasspathScanner.scanForBundles(ClasspathScanner.java:49)
      at org.apache.camel.test.blueprint.CamelBlueprintHelper.getBundleDescriptors(CamelBlueprintHelper.java:343)
      at org.apache.camel.test.blueprint.CamelBlueprintHelper.createBundleContext(CamelBlueprintHelper.java:124)
      at org.apache.camel.test.blueprint.CamelBlueprintHelper.createBundleContext(CamelBlueprintHelper.java:108)
      at org.apache.camel.test.blueprint.CamelBlueprintTestSupport.createBundleContext(CamelBlueprintTestSupport.java:94)
      at org.apache.camel.test.blueprint.CamelBlueprintTestSupport.setUp(CamelBlueprintTestSupport.java:199)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
      at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
      at org.junit.rules.RunRules.evaluate(RunRules.java:20)
      at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
      at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
      at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
      at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
      at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
      at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
      at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                janstey Jonathan Anstey
                Reporter:
                hawkinsds Duane Hawkins
                Tester:
                Roman Jakubco
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: