Thanks Oliver & JB for your quick answers. I've checked the generated org.apache.karaf.features.cfg file and it has some strange contents:
*#Modified by paxexam* *#Fri Mar 02 16:59:52 CET 2018* *featuresBootAsynchronous=false* *featuresBoot=instance, package, log, ssh, aries-blueprint, framework, system, eventadmin, feature, shell, management, service, jaas, shell-compat, deployer, diagnostic, wrap, bundle, config, kar,shell,wrap,war,cxf,cellar,unomi-kar,unomi-router-karaf-feature,exam* *featuresRepositories=mvn\:org.apache.karaf.features/framework/4.1.5/xml/features, mvn\:org.apache.karaf.features/spring/4.1.5/xml/features, mvn\:org.apache.karaf.features/standard/4.1.5/xml/features, mvn\:org.apache.karaf.features/enterprise/4.1.5/xml/features,mvn\:org.ops4j.pax.web/pax-web-features/3.1.0/xml/features,mvn\:org.apache.karaf.features/standard/4.1.5/xml/features,mvn\:org.ops4j.pax.web/pax-web-features/3.1.0/xml/features,mvn\:org.apache.cxf.karaf/apache-cxf/3.1.10/xml/features,mvn\:org.apache.karaf.cellar/apache-karaf-cellar/4.1.0/xml/features,mvn\:org.apache.unomi/unomi-kar/1.3.0-incubating-unomi_5_karaf4_1-SNAPSHOT/xml/features,mvn\:org.apache.unomi/unomi-router-karaf-feature/1.3.0-incubating-unomi_5_karaf4_1-SNAPSHOT/xml/features,mvn\:org.ops4j.pax.exam/pax-exam-features/4.11.0/xml* I seems the wrap feature is listed twice, not sure if that is a problem. I installed the unomi-kar and unomi-router-karaf-feature as boot features because this is what is done in the Karaf package, but I don't have a problem changing this for the integration tests. I'm just not sure how this can be achieved ? Do you have an example or some documentation ? I checked the Karaf documentation but I couldn't find anything related to injection or executeCommand. Regards, Serge... Serge Huber CTO & Co-Founder T +41 22 361 3424 9 route des Jeunes | 1227 Acacias | Switzerland jahia.com <http://www.jahia.com/> SKYPE | LINKEDIN <https://www.linkedin.com/in/sergehuber> | TWITTER <https://twitter.com/sergehuber> | VCARD <http://www.jahia.com/vcard/HuberSerge.vcf> > JOIN OUR COMMUNITY <http://www.jahia.com/> to evaluate, get trained and to discover why Jahia is a leading User Experience Platform (UXP) for Digital Transformation. On Sun, Mar 4, 2018 at 5:51 AM, Jean-Baptiste Onofré <j...@nanthrax.net> wrote: > Hi Serge, > > I think that the problem is that wrap should be a bootFeature in early > stage > compared to the Unomi router. > > Can you check (in the @Config) the org.apache.karaf.feature.cfg (if wrap > is at > first stage) ? > > More over, I would install unomi feature using executeCommand or feature > service > (with @Inject) to be sure to be "in" Karaf. > > Regards > JB > > On 03/03/2018 04:31 PM, Serge Huber wrote: > > Hello, > > > > I'm struggling getting Apache Unomi tests to work since I migrated from > Karaf 3 > > to Karaf 4. > > > > Here is the error I am getting in the logs: > > > > *2018-03-02T17:01:54,018 | ERROR | pool-1-thread-2 | > BootFeaturesInstaller > > | 10 - org.apache.karaf.features.core - 4.1.5 | Error installing > boot > > features* > > > > *org.apache.karaf.features.internal.util.MultiException: Error:* > > > > * Error downloading > > wrap:file:/Users/loom/.m2/repository/org/apache/kafka/kafka-clients/ > 0.10.1.0/kafka-clients-0.10.1.0.jar > > <http://0.10.1.0/kafka-clients-0.10.1.0.jar>* > > > > * Error downloading > > wrap:file:/Users/loom/.m2/repository/org/apache/kafka/kafka-clients/ > 0.10.1.0/kafka-clients-0.10.1.0.jar > > <http://0.10.1.0/kafka-clients-0.10.1.0.jar>* > > > > * at > > org.apache.karaf.features.internal.download.impl.MavenDownloadManager$ > MavenDownloader.<init>(MavenDownloadManager.java:84) > > ~[?:?]* > > > > * at > > org.apache.karaf.features.internal.download.impl.MavenDownloadManager. > createDownloader(MavenDownloadManager.java:72) > > ~[?:?]* > > > > * at > > org.apache.karaf.features.internal.region.Subsystem. > downloadBundles(Subsystem.java:375) > > ~[?:?]* > > > > * at > > org.apache.karaf.features.internal.region.Subsystem. > downloadBundles(Subsystem.java:372) > > ~[?:?]* > > > > * at > > org.apache.karaf.features.internal.region.SubsystemResolver.resolve( > SubsystemResolver.java:187) > > ~[?:?]* > > > > * at > > org.apache.karaf.features.internal.service.Deployer. > deploy(Deployer.java:291) > > ~[?:?]* > > > > * at > > org.apache.karaf.features.internal.service.FeaturesServiceImpl. > doProvision(FeaturesServiceImpl.java:1248) > > ~[?:?]* > > > > * at > > org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$ > doProvisionInThread$1(FeaturesServiceImpl.java:1147) > > ~[?:?]* > > > > * at java.util.concurrent.FutureTask.run(FutureTask.java:266) > [?:?]* > > > > * at > > java.util.concurrent.ThreadPoolExecutor.runWorker( > ThreadPoolExecutor.java:1142) > > [?:?]* > > > > * at > > java.util.concurrent.ThreadPoolExecutor$Worker.run( > ThreadPoolExecutor.java:617) > > [?:?]* > > > > * at java.lang.Thread.run(Thread.java:745) [?:?]* > > > > * Suppressed: java.io.IOException: Error downloading > > wrap:file:/Users/loom/.m2/repository/org/apache/kafka/kafka-clients/ > 0.10.1.0/kafka-clients-0.10.1.0.jar > > <http://0.10.1.0/kafka-clients-0.10.1.0.jar>* > > > > * at > > org.apache.karaf.features.internal.download.impl. > AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:77) > > [10:org.apache.karaf.features.core:4.1.5]* > > > > * at > > java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) > [?:?]* > > > > * at java.util.concurrent.FutureTask.run(FutureTask.java:266) > [?:?]* > > > > * at > > java.util.concurrent.ScheduledThreadPoolExecutor$ > ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) > > [?:?]* > > > > * at > > java.util.concurrent.ScheduledThreadPoolExecutor$ > ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) > > [?:?]* > > > > * at > > java.util.concurrent.ThreadPoolExecutor.runWorker( > ThreadPoolExecutor.java:1142) > > [?:?]* > > > > * at > > java.util.concurrent.ThreadPoolExecutor$Worker.run( > ThreadPoolExecutor.java:617) > > [?:?]* > > > > * at java.lang.Thread.run(Thread.java:745) [?:?]* > > > > * Caused by: java.io.IOException: Could not download > > [wrap:file:/Users/loom/.m2/repository/org/apache/kafka/kafka-clients/ > 0.10.1.0/kafka-clients-0.10.1.0.jar > > <http://0.10.1.0/kafka-clients-0.10.1.0.jar>]* > > > > * at > > org.apache.karaf.features.internal.download.impl. > SimpleDownloadTask.download(SimpleDownloadTask.java:90) > > ~[?:?]* > > > > * at > > org.apache.karaf.features.internal.download.impl. > AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:60) > > ~[?:?]* > > > > * ... 7 more* > > > > * Caused by: java.net.MalformedURLException: Unknown protocol: > wrap* > > > > * at java.net.URL.<init>(URL.java:627) ~[?:?]* > > > > * at java.net.URL.<init>(URL.java:490) ~[?:?]* > > > > * at java.net.URL.<init>(URL.java:439) ~[?:?]* > > > > * at > > org.apache.karaf.features.internal.download.impl. > SimpleDownloadTask.download(SimpleDownloadTask.java:62) > > ~[?:?]* > > > > * at > > org.apache.karaf.features.internal.download.impl. > AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:60) > > ~[?:?]* > > > > * ... 7 more* > > > > * Caused by: java.lang.IllegalStateException: Unknown protocol: > wrap* > > > > * at > > org.apache.felix.framework.URLHandlersStreamHandlerProxy.parseURL( > URLHandlersStreamHandlerProxy.java:373) > > ~[?:?]* > > > > * at java.net.URL.<init>(URL.java:622) ~[?:?]* > > > > * at java.net.URL.<init>(URL.java:490) ~[?:?]* > > > > * at java.net.URL.<init>(URL.java:439) ~[?:?]* > > > > * at > > org.apache.karaf.features.internal.download.impl. > SimpleDownloadTask.download(SimpleDownloadTask.java:62) > > ~[?:?]* > > > > * at > > org.apache.karaf.features.internal.download.impl. > AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:60) > > ~[?:?]* > > > > * ... 7 more* > > > > > > Here is the setup for the Test case: > > > > protected static final String HTTP_PORT = "8181"; > > > > protected static final String URL = "http://localhost:" + HTTP_PORT; > > > > protected static final String KARAF_DIR = "target/exam"; > > > > @Configuration > > public Option[] config() { > > MavenArtifactUrlReference karafUrl = maven() > > .groupId("org.apache.karaf") > > .artifactId("apache-karaf") > > .version("4.1.5") > > .type("tar.gz"); > > > > MavenUrlReference karafStandardRepo = maven() > > .groupId("org.apache.karaf.features") > > .artifactId("standard") > > .classifier("features") > > .type("xml") > > .versionAsInProject(); > > MavenUrlReference karafCellarRepo = maven() > > .groupId("org.apache.karaf.cellar") > > .artifactId("apache-karaf-cellar") > > .classifier("features") > > .type("xml") > > .versionAsInProject(); > > MavenUrlReference karafPaxWebRepo = maven() > > .groupId("org.ops4j.pax.web") > > .artifactId("pax-web-features") > > .classifier("features") > > .type("xml") > > .versionAsInProject(); > > MavenUrlReference karafCxfRepo = maven() > > .groupId("org.apache.cxf.karaf") > > .artifactId("apache-cxf") > > .classifier("features") > > .type("xml") > > .versionAsInProject(); > > MavenUrlReference contextServerRepo = maven() > > .groupId("org.apache.unomi") > > .artifactId("unomi-kar") > > .classifier("features") > > .type("xml") > > .versionAsInProject(); > > MavenUrlReference routerRepo = maven() > > .groupId("org.apache.unomi") > > .artifactId("unomi-router-karaf-feature") > > .classifier("features") > > .type("xml") > > .versionAsInProject(); > > > > return new Option[]{ > > debugConfiguration("5005", false), > > karafDistributionConfiguration() > > .frameworkUrl(karafUrl) > > .unpackDirectory(new File(KARAF_DIR)) > > .useDeployFolder(true), > > replaceConfigurationFile("etc/org.apache.unomi.router.cfg", > new File( > > "src/test/resources/org. > apache.unomi.router.cfg")), > > > > replaceConfigurationFile("data/tmp/recurrent_import/2-surfers-test.csv", > new File( > > "src/test/resources/2-surfers-test.csv")), > > > > replaceConfigurationFile("data/tmp/recurrent_import/3-surfers-overwrite-test.csv", > new File( > > "src/test/resources/3-surfers- > overwrite-test.csv")), > > > > replaceConfigurationFile("data/tmp/recurrent_import/4-surfers-delete-test.csv", > new File( > > "src/test/resources/4-surfers- > delete-test.csv")), > > > > replaceConfigurationFile("data/tmp/recurrent_import/5-ranking-test.csv", > new File( > > "src/test/resources/5-ranking-test.csv")), > > > > replaceConfigurationFile("data/tmp/recurrent_import/6-actors-test.csv", > new File( > > "src/test/resources/6-actors-test.csv")), > > keepRuntimeFolder(), > > configureConsole().ignoreLocalConsole(), > > logLevel(LogLevel.INFO), > > // editConfigurationFilePut("etc/org.ops4j.pax.web.cfg", > > "org.osgi.service.http.port", HTTP_PORT), > > // systemProperty("org.osgi.service.http.port").value(HTTP_PORT), > > systemProperty("org.ops4j.pax.exam.rbc.rmi.port").value("1199"), > > systemProperty("org.apache.unomi.itests.elasticsearch. > transport.port").value("9500"), > > systemProperty("org.apache.unomi.itests.elasticsearch. > cluster.name > > <http://org.apache.unomi.itests.elasticsearch.cluster.name>").value(" > contextElasticSearchITests"), > > systemProperty("org.apache.unomi.itests.elasticsearch. > http.port").value("9400"), > > systemProperty("org.apache.unomi.itests.elasticsearch. > bootstrap.seccomp").value("false"), > > systemProperty("unomi.autoStart").value("true"), > > features(karafPaxWebRepo, "shell"), > > features(karafStandardRepo, "wrap"), > > features(karafPaxWebRepo, "war"), > > features(karafCxfRepo, "cxf"), > > features(karafCellarRepo, "cellar"), > > features(contextServerRepo, "unomi-kar"), > > features(routerRepo, "unomi-router-karaf-feature"), > > // we need to wrap the HttpComponents libraries > ourselves since the OSGi bundles > > provided by the project are incorrect > > wrappedBundle(mavenBundle("org.apache.httpcomponents", > > "httpcore").versionAsInProject()), > > wrappedBundle(mavenBundle("org.apache.httpcomponents", > > "httpmime").versionAsInProject()), > > wrappedBundle(mavenBundle("org.apache.httpcomponents", > > "httpclient").versionAsInProject()) > > }; > > > > It seems the problem is that the "unomi-router-karaf-feature" uses the > wrap > > protocol but the resolver can't use it because it's also being deployed > as a > > feature. It seems I need to specifiy it as a startup feature but I don't > know > > how to achieve that. > > > > If you prefer to have a look at the repository, you can find the full > > integration test here : > > > > https://github.com/apache/incubator-unomi/tree/feature- > UNOMI-5-KARAF4-1/itests > > > > I'm quite stuck with this, so any help would be greatly appreciated ! > > > > cheers, > > Serge... > > > > > > Serge Huber > > CTO & Co-Founder > > > > > > T +41 22 361 3424 > > 9 route des Jeunes | 1227 Acacias | Switzerland > > jahia.com <http://www.jahia.com/> > > SKYPE | LINKEDIN <https://www.linkedin.com/in/sergehuber> | TWITTER > > <https://twitter.com/sergehuber> | VCARD > > <http://www.jahia.com/vcard/HuberSerge.vcf> > > > > > > > JOIN OUR COMMUNITY <http://www.jahia.com/> to evaluate, get trained > and to discover why Jahia is > > a leading User Experience Platform (UXP) for Digital Transformation. > > > > -- > Jean-Baptiste Onofré > jbono...@apache.org > http://blog.nanthrax.net > Talend - http://www.talend.com >