Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 702AA200C77 for ; Mon, 1 May 2017 08:48:53 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 6EB67160BAE; Mon, 1 May 2017 06:48:53 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id B6452160BAB for ; Mon, 1 May 2017 08:48:52 +0200 (CEST) Received: (qmail 60494 invoked by uid 500); 1 May 2017 06:48:51 -0000 Mailing-List: contact user-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@karaf.apache.org Delivered-To: mailing list user@karaf.apache.org Received: (qmail 60484 invoked by uid 99); 1 May 2017 06:48:51 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 May 2017 06:48:51 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 631C51B12EB for ; Mon, 1 May 2017 06:48:51 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.001 X-Spam-Level: **** X-Spam-Status: No, score=4.001 tagged_above=-999 required=6.31 tests=[HEADER_FROM_DIFFERENT_DOMAINS=0.001, KAM_LAZY_DOMAIN_SECURITY=1, RDNS_NONE=3] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id Q7XvV0jXHYij for ; Mon, 1 May 2017 06:48:48 +0000 (UTC) Received: from blaine.gmane.org (unknown [195.159.176.226]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 887F45FDE5 for ; Mon, 1 May 2017 06:48:48 +0000 (UTC) Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1d558R-0005WH-W1 for user@karaf.apache.org; Mon, 01 May 2017 08:48:39 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: user@karaf.apache.org To: user@karaf.apache.org From: Steinar Bang Subject: Re: Pax Exam test with embedded karaf container: One mvn dependency in feature must be preloaded Date: Mon, 01 May 2017 08:48:39 +0200 Organization: Probably a good idea Lines: 50 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@blaine.gmane.org User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (windows-nt) Mail-Copies-To: never Cancel-Lock: sha1:FiETb5IKQDsiUJOyGBXiCQpF0wI= archived-at: Mon, 01 May 2017 06:48:53 -0000 >>>>> Steinar Bang : >>>>> Steinar Bang : >> But that failed on startup with a strange error message, and was fixed >> by a strange cure. >> The error message I got, was: >> 2017-04-17 16:04:54,117 | ERROR | FelixStartLevel | BootFeaturesInstaller | 6 - org.apache.karaf.features.core - 4.0.9 | Error installing boot features >> org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=ukelonn; type=karaf.feature; version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]"; filter:="(&(osgi.identity=ukelonn)(type=karaf.feature)(version>=1.0.0.SNAPSHOT)(version<=1.0.0.SNAPSHOT))" [caused by: Unable to resolve ukelonn/1.0.0.SNAPSHOT: missing requirement [ukelonn/1.0.0.SNAPSHOT] osgi.identity; osgi.identity=no.priv.bang.ukelonn; type=osgi.bundle; version="[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]"; resolution:=mandatory [caused by: Unable to resolve no.priv.bang.ukelonn/1.0.0.SNAPSHOT: missing requirement [no.priv.bang.ukelonn/1.0.0.SNAPSHOT] osgi.wiring.package; filter:="(&(osgi.wiring.package=org.apache.shiro.authc)(version>=1.3.0)(!(version>=2.0.0)))"]] >> at org.apache.felix.resolver.ResolutionError.toException(ResolutionError.java:42) >> at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:389) >> at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:375) >> at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:347) >> at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:216) >> at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:263) >> at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1176) >> at org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:1074) >> at java.util.concurrent.FutureTask.run(Unknown Source)[:1.8.0_121] >> at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)[:1.8.0_121] >> at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)[:1.8.0_121] >> at java.lang.Thread.run(Unknown Source)[:1.8.0_121] > I have no idea how or why, but karaf stopped requiring the preloaded > bundle. Now it works as expected, with the dependency loaded from the > feature: > https://github.com/steinarb/ukelonn/blob/using-vaadin/ukelonn.tests/src/test/java/no/priv/bang/ukelonn/tests/UkelonnServiceIntegrationTest.java#L37 > I haven't tried building from a clean workspace and clean > ~/.m2/repository (I will cross that bridge if I get to it). FWIW I think that all of the weirdness I saw was caused by me using three different versions of osgi core to build the various bundles. When I moved to karaf 4.1.1 and OSGi 6.0 I cleaned up all of that and all bundles now have the same version of OSGi core (and the need for the troublesome OSGi compendium went away): https://github.com/steinarb/ukelonn/commit/9fc41d0ee19b5758526bc8165667569e697dfa36 The reason for the different osgi.core versions in the project predates my move to karaf, where I wanted my app to run both with "mvn pax:provision" and running from a manually set up pax exam test. This required quite a bit of trial and error experimentation. I think part of my reluctance to make the move to karaf last autumn, was that I had invested so much time and effort into making the "mvn pax:provision" run, and the manually set up pax exam test load the bundles right... I didn't just want to throw that effort away...:-) But now I'm glad I did. :-)