It has been fixed on karaf 4.0.1-SNAPSHOT.
Sent from my Samsung device
-------- Original message --------
From: Serge Huber <[email protected]>
Date: 31/07/2015 10:28 (GMT+01:00)
To: [email protected]
Subject: Karaf 4.0.0 and Integration Tests
Hello Karaf-ers,
I am trying to setup integration tests using Karaf 4.0.0 and I’m basing my code
on the itests project in the Karaf source code.
I was having an issue at startup that looked like this :
------------------------------------------------------- T E S T
S-------------------------------------------------------[org.ops4j.pax.exam.spi.DefaultExamSystem]
: Pax Exam System (Version: 4.5.0)
created.[org.ops4j.pax.exam.junit.impl.ProbeRunner] : creating PaxExam runner
for class com.tofodo.checker.tests.integration.BasicTestRunning
com.tofodo.checker.tests.integration.AllTests[org.ops4j.pax.exam.junit.impl.ProbeRunner]
: creating PaxExam runner for class
com.tofodo.checker.tests.integration.BasicTest[org.ops4j.pax.exam.junit.impl.ProbeRunner]
: running test class
com.tofodo.checker.tests.integration.BasicTest[org.ops4j.pax.exam.karaf.container.internal.KarafTestContainer]
: Wait for test container to finish its initialization [ RelativeTimeout value
= 180000 ][org.ops4j.pax.exam.rbc.client.RemoteBundleContextClient] : Waiting
for remote bundle context.. on 21000 name: f7ac8fed-92c2-4454-a913-77f69a2ffac8
timout: [ RelativeTimeout value = 180000 ]22:58:35,238 | ERROR |
af.features.internal.service.BootFeaturesInstaller | Error installing boot
feature repository
file:/x1/asf/karaf/k40x/target/checkout/assemblies/apache-karaf/target/assembly/system/org/apache/karaf/features/framework/4.0.0/framework-4.0.0-features.xmljava.io.IOException:
/x1/asf/karaf/k40x/target/checkout/assemblies/apache-karaf/target/assembly/system/org/apache/karaf/features/framework/4.0.0/framework-4.0.0-features.xml
(No such file or directory) :
file:/x1/asf/karaf/k40x/target/checkout/assemblies/apache-karaf/target/assembly/system/org/apache/karaf/features/framework/4.0.0/framework-4.0.0-features.xml
at
org.apache.karaf.features.internal.service.RepositoryImpl.load(RepositoryImpl.java:85)[8:org.apache.karaf.features.core:4.0.0]
at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.loadRepository(FeaturesServiceImpl.java:391)[8:org.apache.karaf.features.core:4.0.0]
at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.addRepository(FeaturesServiceImpl.java:411)[8:org.apache.karaf.features.core:4.0.0]
at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.addRepository(FeaturesServiceImpl.java:402)[8:org.apache.karaf.features.core:4.0.0]
at
org.apache.karaf.features.internal.service.BootFeaturesInstaller.installBootFeatures(BootFeaturesInstaller.java:86)[8:org.apache.karaf.features.core:4.0.0]
at
org.apache.karaf.features.internal.service.BootFeaturesInstaller.start(BootFeaturesInstaller.java:76)[8:org.apache.karaf.features.core:4.0.0]
at
org.apache.karaf.features.internal.osgi.Activator.doStart(Activator.java:257)[8:org.apache.karaf.features.core:4.0.0]
at
org.apache.karaf.util.tracker.BaseActivator.run(BaseActivator.java:233)[8:org.apache.karaf.features.core:4.0.0]
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_79]
at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_79] at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_79]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_79]
at java.lang.Thread.run(Thread.java:745)[:1.7.0_79]Caused by:
java.io.FileNotFoundException:
/x1/asf/karaf/k40x/target/checkout/assemblies/apache-karaf/target/assembly/system/org/apache/karaf/features/framework/4.0.0/framework-4.0.0-features.xml
(No such file or directory) at java.io.FileInputStream.open(Native
Method)[:1.7.0_79] at
java.io.FileInputStream.<init>(FileInputStream.java:146)[:1.7.0_79] at
java.io.FileInputStream.<init>(FileInputStream.java:101)[:1.7.0_79] at
sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)[:1.7.0_79]
at
sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)[:1.7.0_79]
at java.net.URL.openStream(URL.java:1037)[:1.7.0_79] at
org.apache.karaf.features.internal.service.RepositoryImpl.load(RepositoryImpl.java:80)[8:org.apache.karaf.features.core:4.0.0]
... 12 more
It took me a while to track down the origin of this problem until I realized
that the problem comes from the apache-karaf-4.0.0.tar.gz itself ! Specifically
the etc/org.apache.karaf.features.cfg file contains the following hardcoded
path :
featuresRepositories = \
file:/x1/asf/karaf/k40x/target/checkout/assemblies/apache-karaf/target/assembly/system/org/apache/karaf/features/framework/4.0.0/framework-4.0.0-features.xml,
\ mvn:org.apache.karaf.features/enterprise/4.0.0/xml/features, \
mvn:org.apache.karaf.features/spring/4.0.0/xml/features, \
mvn:org.apache.karaf.features/standard/4.0.0/xml/features
It’s not entirely clear where this path is coming from. I’m guessing it’s
somehow related to the Builder but I’m not an expert (yet) on this codebase so
I might be wrong.
Is it possible to simply use my own custom org.apache.karaf.features.cfg file
in my integration test project as a workaround until this issue is solved ?
Thanks a lot for your help,cheers, Serge…