1 Reply Latest reply on Mar 12, 2012 7:48 PM by doug smith

    CamelBlueprintTestSupport and org.osgi.vendor.framework property

    doug smith Newbie

      I am using CamelBlueprintTestSupport to write a unit test for a route, and am getting the following error originating from the test setUp method:

       

      java.lang.NoClassDefFoundError: org.osgi.vendor.framework property not set

       

      This is with camel 2.9.1 and the 2.10-SNAPSHOT version of camel-test-blueprint

       

      Should I simply set this property (and to what) or does this represent a deeper problem?

       

      I am fairly new to OSGi and am trying to figure out how to unit test route components that depend on OSGi services. Stripping down my test to bare scaffolding does not eliminate the problem. Stack trace is below.

       

      Thanks,

       

      --doug

       

      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.(FrameworkUtil.java:59)

           at org.osgi.framework.FrameworkUtil.createFilter(FrameworkUtil.java:127)

           at de.kalpatec.pojosr.framework.launch.ClasspathScanner.scanForBundles(ClasspathScanner.java:44)

           at org.apache.camel.test.blueprint.CamelBlueprintTestSupport.getBundleDescriptors(CamelBlueprintTestSupport.java:113)

           at org.apache.camel.test.blueprint.CamelBlueprintTestSupport.setUp(CamelBlueprintTestSupport.java:74)

           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

           at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

           at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

           at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

           at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)

           at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)

           at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48)

           at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

           at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

           at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

           at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

           at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

           at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

           at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

           at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)

           at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

           at org.junit.runner.JUnitCore.run(JUnitCore.java:157)

           at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)

           at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)

           at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)

           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

           at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

       

       

      java.lang.NullPointerException

           at org.apache.camel.test.blueprint.CamelBlueprintTestSupport.tearDown(CamelBlueprintTestSupport.java:89)

           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

           at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)

           at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

           at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)

           at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:37)

           at org.junit.rules.TestWatchman$1.evaluate(TestWatchman.java:48)

           at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)

           at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

           at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)

           at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

           at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)

           at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)

           at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)

           at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)

           at org.junit.runners.ParentRunner.run(ParentRunner.java:236)

           at org.junit.runner.JUnitCore.run(JUnitCore.java:157)

           at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)

           at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)

           at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)

           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

           at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)