Hi Harald,
Thank you.
I tried adding all pax-url-* bundles to classpath and I still get the error.
I'm not sure how to exactly enable DEBUG logging but I do get some logs
with DEBUG prefix already. I tried adding the following to my test class
systemProperty("logback.configurationFile").value( "file:" +
PathUtils.getBaseDir() + "/logback.xml" )
with a xml with <configuration debug="true"> tag. But still I get same
output.
I tried adding EagerSingleStagedReactorFactory and now the stacktrace seems
to have bit more details, but still the same exception.
1) initializationError(test.OSGiTest)
org.ops4j.pax.exam.TestContainerException: Problem starting test container.
at
org.ops4j.pax.exam.nat.internal.NativeTestContainer.start(NativeTestContainer.java:166)
at
org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactor.<init>(EagerSingleStagedReactor.java:55)
at
org.ops4j.pax.exam.spi.reactors.EagerSingleStagedReactorFactory.create(EagerSingleStagedReactorFactory.java:34)
at
org.ops4j.pax.exam.spi.DefaultExamReactor.stage(DefaultExamReactor.java:83)
at
org.ops4j.pax.exam.junit.JUnit4TestRunner.prepareReactor(JUnit4TestRunner.java:182)
at
org.ops4j.pax.exam.junit.JUnit4TestRunner.<init>(JUnit4TestRunner.java:86)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at
org.junit.internal.builders.AnnotatedBuilder.buildRunner(AnnotatedBuilder.java:31)
at
org.junit.internal.builders.AnnotatedBuilder.runnerForClass(AnnotatedBuilder.java:24)
at
org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at
org.junit.internal.builders.AllDefaultPossibilitiesBuilder.runnerForClass(AllDefaultPossibilitiesBuilder.java:29)
at org.junit.runner.Computer.getRunner(Computer.java:38)
at org.junit.runner.Computer$1.runnerForClass(Computer.java:29)
at
org.junit.runners.model.RunnerBuilder.safeRunnerForClass(RunnerBuilder.java:57)
at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:98)
at org.junit.runners.model.RunnerBuilder.runners(RunnerBuilder.java:84)
at org.junit.runners.Suite.<init>(Suite.java:79)
at org.junit.runner.Computer.getSuite(Computer.java:26)
at org.junit.runner.Request.classes(Request.java:69)
at org.junit.runner.JUnitCore.run(JUnitCore.java:117)
at org.junit.runner.JUnitCore.runMain(JUnitCore.java:98)
at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:53)
at org.junit.runner.JUnitCore.main(JUnitCore.java:45)
Caused by: org.osgi.framework.BundleException: Unable to cache bundle:
link:classpath:META-INF/links/org.ops4j.pax.exam.link
at org.apache.felix.framework.Felix.installBundle(Felix.java:2545)
at org.apache.felix.framework.Felix.installBundle(Felix.java:2501)
at
org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:150)
at
org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:123)
at
org.ops4j.pax.exam.nat.internal.NativeTestContainer.installAndStartBundles(NativeTestContainer.java:319)
at
org.ops4j.pax.exam.nat.internal.NativeTestContainer.start(NativeTestContainer.java:163)
... 25 more
Caused by: java.lang.IllegalStateException: Stream handler unavailable due
to: null
at
org.apache.felix.framework.URLHandlersStreamHandlerProxy.openConnection(URLHandlersStreamHandlerProxy.java:311)
at java.net.URL.openConnection(URL.java:945)
at
org.apache.felix.framework.cache.JarRevision.initialize(JarRevision.java:155)
at
org.apache.felix.framework.cache.JarRevision.<init>(JarRevision.java:82)
at
org.apache.felix.framework.cache.JarRevision.<init>(JarRevision.java:60)
at
org.apache.felix.framework.cache.BundleArchive.createRevisionFromLocation(BundleArchive.java:868)
at
org.apache.felix.framework.cache.BundleArchive.reviseInternal(BundleArchive.java:549)
at
org.apache.felix.framework.cache.BundleArchive.<init>(BundleArchive.java:148)
at
org.apache.felix.framework.cache.BundleCache.create(BundleCache.java:251)
at org.apache.felix.framework.Felix.installBundle(Felix.java:2541)
... 30 more
On Sat, Aug 11, 2012 at 9:55 PM, Harald Wellmann <[email protected]>wrote:
> Hi Nufail,
>
> some ideas you might want to try:
>
> - Enable DEBUG logging to see which bundle is being installed when the
> exception is thrown.
>
> - This might be your own bundle or one of Pax Exam's bundles.
>
> - My guess is you're missing one of the pax-url-* dependencies required to
> install the Exam bundles.
>
> By the way, you don't need the felix() option with the Native Test
> Container. It's enough to put the OSGi framework of your choice on the
> classpath, so that java.util.ServiceLoader will find it.
>
> Hope that helps,
> Harald
>
> Am 11.08.2012 16:52, schrieb Mohamed Nufail:
>
>> Hi,
>>
>> I'm trying out PaxExam butI get the following exception when running it.|
>>
>>
>>
>>
>>
>> java.lang.**IllegalStateException: Stream handler unavailable due to:
>> null
>>
>>
>> at org.apache.felix.framework.**URLHandlersStreamHandlerProxy.**
>> openConnection(**URLHandlersStreamHandlerProxy.**java:311)
>>
>>
>> at java.net.URL.openConnection(**URL.java:945)
>>
>>
>> at org.apache.felix.framework.**cache.JarRevision.initialize(**
>> JarRevision.java:155)
>>
>>
>> My configuration looks like this and I'm running Pax Exam 2.5.0
>>
>> |@Configuration
>> public Option[] config() {
>>
>>
>> return options(
>> bundle("file:/home/nufail/**mybundle.jar"),
>>
>>
>> junitBundles(),
>> felix().version("3.2.2")
>>
>>
>> );
>> }
>>
>
>
> ______________________________**_________________
> general mailing list
> [email protected]
> http://lists.ops4j.org/**mailman/listinfo/general<http://lists.ops4j.org/mailman/listinfo/general>
>
--
Mohamed Nufail
Undergraduate,
Department of Computer Science & Engineering,
University of Moratuwa.
Blog: http://www.nufailm.blogspot.com/
_______________________________________________
general mailing list
[email protected]
http://lists.ops4j.org/mailman/listinfo/general