You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Serge Huber <sh...@jahia.com> on 2018/03/03 15:31:53 UTC

Help needed with Karaf 4 Integration test writing

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").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.

Re: Help needed with Karaf 4 Integration test writing

Posted by Serge Huber <sh...@jahia.com>.
Hi JB,

I tried editing the generated file manually but for some strange reason it
doesn't seem to install my features, maybe I did a stupid mistake ? I did
all of this in the generated target/exam/*/ folder.

Here's the features.cfg contents:

#Modified by paxexam
#Sun Mar 04 07:50:26 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,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.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

Here's the karaf.log:

Mar 04, 2018 8:28:05 AM org.apache.karaf.main.lock.SimpleFileLock lock

INFO: Trying to lock
/Users/loom/java/technologies/apache-git/incubator-unomi-karaf4/itests/target/exam/7874d4a8-c3b0-4850-b6d5-3029999cfe79/lock

Mar 04, 2018 8:28:05 AM org.apache.karaf.main.lock.SimpleFileLock lock

INFO: Lock acquired

Mar 04, 2018 8:28:05 AM org.apache.karaf.main.Main$KarafLockCallback
lockAquired

INFO: Lock acquired. Setting startlevel to 100

2018-03-04T08:28:08,059 | INFO  | pool-1-thread-2  | FeaturesServiceImpl
          | 10 - org.apache.karaf.features.core - 4.1.5 | Adding features:
instance/[4.1.5,4.1.5], package/[4.1.5,4.1.5], log/[4.1.5,4.1.5],
ssh/[4.1.5,4.1.5], aries-blueprint/[4.1.5,4.1.5], framework/[4.1.5,4.1.5],
system/[4.1.5,4.1.5], eventadmin/[4.1.5,4.1.5], feature/[4.1.5,4.1.5],
shell/[4.1.5,4.1.5], management/[4.1.5,4.1.5], service/[4.1.5,4.1.5],
jaas/[4.1.5,4.1.5], shell-compat/[4.1.5,4.1.5], deployer/[4.1.5,4.1.5],
diagnostic/[4.1.5,4.1.5], wrap/[0,0.0.0], bundle/[4.1.5,4.1.5],
config/[4.1.5,4.1.5], kar/[4.1.5,4.1.5], war/[4.1.5,4.1.5],
cxf/[3.1.10,3.1.10], cellar/[4.1.0,4.1.0]


Even if it did work, this file is generated by Pax Exam so it's not clear
to me the changes I need to make to the integration tests to set this up ?


Sorry about all the questions, but I'm really struggling with this.


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 8:17 AM, Jean-Baptiste Onofré <jb...@nanthrax.net>
wrote:

> As said, the featuresBoot doesn't seem good to me as wrap can be not yet
> installed (async) before your feature is installed.
>
> It should be:
>
> featuresBoot=(instance, package, log, ssh, aries-blueprint, framework,
> system,
>  eventadmin, feature, shell, management, service, jaas, shell-compat,
> deployer,
>  diagnostic, wrap, bundle, config,
>  kar,shell,war,cxf,cellar),unomi-kar,unomi-router-karaf-feature,exam
>
> Regards
> JB
>
> On 03/04/2018 08:02 AM, Serge Huber wrote:
> > 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é <jb@nanthrax.net
> > <ma...@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>
> >     > <http://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>
> >     > <http://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>
> >     > <http://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>
> >     > <http://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 <http://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>
> >     > <http://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
> >     <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 <tel:%2B41%2022%20361%203424>
> >     >   9 route des Jeunes | 1227 Acacias | Switzerland
> >     >   jahia.com <http://jahia.com> <http://www.jahia.com/>
> >     >   SKYPE | LINKEDIN <https://www.linkedin.com/in/sergehuber
> >     <https://www.linkedin.com/in/sergehuber>> | TWITTER
> >     >   <https://twitter.com/sergehuber <https://twitter.com/sergehuber
> >> | VCARD
> >     >   <http://www.jahia.com/vcard/HuberSerge.vcf
> >     <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é
> >     jbonofre@apache.org <ma...@apache.org>
> >     http://blog.nanthrax.net
> >     Talend - http://www.talend.com
> >
> >
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: Help needed with Karaf 4 Integration test writing

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
As said, the featuresBoot doesn't seem good to me as wrap can be not yet
installed (async) before your feature is installed.

It should be:

featuresBoot=(instance, package, log, ssh, aries-blueprint, framework, system,
 eventadmin, feature, shell, management, service, jaas, shell-compat, deployer,
 diagnostic, wrap, bundle, config,
 kar,shell,war,cxf,cellar),unomi-kar,unomi-router-karaf-feature,exam

Regards
JB

On 03/04/2018 08:02 AM, Serge Huber wrote:
> 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é <jb@nanthrax.net
> <ma...@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>
>     > <http://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>
>     > <http://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>
>     > <http://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>
>     > <http://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 <http://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>
>     > <http://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
>     <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 <tel:%2B41%2022%20361%203424>
>     >   9 route des Jeunes | 1227 Acacias | Switzerland
>     >   jahia.com <http://jahia.com> <http://www.jahia.com/>
>     >   SKYPE | LINKEDIN <https://www.linkedin.com/in/sergehuber
>     <https://www.linkedin.com/in/sergehuber>> | TWITTER
>     >   <https://twitter.com/sergehuber <https://twitter.com/sergehuber>> | VCARD
>     >   <http://www.jahia.com/vcard/HuberSerge.vcf
>     <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é
>     jbonofre@apache.org <ma...@apache.org>
>     http://blog.nanthrax.net
>     Talend - http://www.talend.com
> 
> 

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Help needed with Karaf 4 Integration test writing

Posted by Serge Huber <sh...@jahia.com>.
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é <jb...@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é
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: Help needed with Karaf 4 Integration test writing

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
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é
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Help needed with Karaf 4 Integration test writing

Posted by Oliver Lietz <ap...@oliverlietz.de>.
On Saturday 03 March 2018 16:31:53 Serge Huber wrote:
> Hello,

Hi Serge,

> 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$MavenD
> ownloader.<init>(MavenDownloadManager.java:84) ~[?:?]*
> 
> *        at
> org.apache.karaf.features.internal.download.impl.MavenDownloadManager.create
> Downloader(MavenDownloadManager.java:72) ~[?:?]*
> 
> *        at
> org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsyste
> m.java:375) ~[?:?]*
> 
> *        at
> org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsyste
> m.java:372) ~[?:?]*
> 
> *        at
> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(Subsyste
> mResolver.java:187) ~[?:?]*
> 
> *        at
> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:291
> ) ~[?:?]*
> 
> *        at
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(F
> eaturesServiceImpl.java:1248) ~[?:?]*
> 
> *        at
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProv
> isionInThread$1(FeaturesServiceImpl.java:1147) ~[?:?]*
> 
> *        at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]*
> 
> *        at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11
> 42) [?:?]*
> 
> *        at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
> 17) [?:?]*
> 
> *        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.AbstractRetryableDownloadTa
> sk.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(Sch
> eduledThreadPoolExecutor.java:293) [?:?]*
> 
> *                at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:11
> 42) [?:?]*
> 
> *                at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:6
> 17) [?:?]*
> 
> *                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.AbstractRetryableDownloadTa
> sk.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.AbstractRetryableDownloadTa
> sk.run(AbstractRetryableDownloadTask.java:60) ~[?:?]*
> 
> *                ... 7 more*
> 
> *        Caused by: java.lang.IllegalStateException: Unknown protocol: wrap*
> 
> *                at
> org.apache.felix.framework.URLHandlersStreamHandlerProxy.parseURL(URLHandler
> sStreamHandlerProxy.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.AbstractRetryableDownloadTa
> sk.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.cs
> v", 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").value("
> contextElasticSearchITests"),
> 
> systemProperty("org.apache.unomi.itests.elasticsearch.http.port").value("940
> 0"),
> 
> systemProperty("org.apache.unomi.itests.elasticsearch.bootstrap.seccomp").va
> lue("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/ites
> ts
> 
> I'm quite stuck with this, so any help would be greatly appreciated !

you may find some hints in SLING-4412:

https://issues.apache.org/jira/browse/SLING-4412

HTH,
O.

> 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.