3

I get the following exception when running Pax Exam. My configuration includes a single bundle from file system and junit and felix only. Any idea why this happens?

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)
    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)
    at org.ops4j.pax.exam.spi.reactors.AllConfinedStagedReactor.invoke(AllConfinedStagedReactor.java:67)
    at org.ops4j.pax.exam.junit.JUnit4TestRunner$2.evaluate(JUnit4TestRunner.java:284)
    at org.ops4j.pax.exam.junit.JUnit4TestRunner.run(JUnit4TestRunner.java:93)

EDIT: I'm using Pax Exam 2.5.0 and following is my configuration method.

@Configuration
public Option[] config() {
    return options(
            bundle("file:/home/nufail/mybundle.jar"),
            junitBundles(),
            felix().version("3.2.2")
    );
}
Nufail
  • 1,588
  • 1
  • 17
  • 31
  • It is very difficult to help without seeing your code. Could you post some? – Dahaka Aug 09 '12 at 09:22
  • Need more information on this one: Which Pax Exam version are you using ? You are using Native Container with Felix, can you provide more of your configuration section (@Configuration) ? – Toni Menzel Aug 09 '12 at 14:15
  • doublecheck with http://stackoverflow.com/questions/5127969/pax-url-protocol-not-supported-at-felixs-startup/5731293#5731293 – Toni Menzel Aug 09 '12 at 14:23
  • @ToniMenzel I've updated the question. BTW it says feilx() method is deprecated. What is the new method to get felix? – Nufail Aug 10 '12 at 10:56

1 Answers1

0

For version 4.9.2 the problem was solved by adding the following dependency to maven

<dependency>
   <groupId>org.ops4j.pax.exam</groupId>
   <artifactId>pax-exam-link-mvn</artifactId>
   <version>4.9.2</version>
   <scope>test</scope>
</dependency>
Pavel_K
  • 10,748
  • 13
  • 73
  • 186