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 1C558200CF0 for ; Thu, 7 Sep 2017 10:22:19 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1AEB41609DB; Thu, 7 Sep 2017 08:22:19 +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 624F61609BF for ; Thu, 7 Sep 2017 10:22:18 +0200 (CEST) Received: (qmail 60405 invoked by uid 500); 7 Sep 2017 08:22:17 -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 60394 invoked by uid 99); 7 Sep 2017 08:22:17 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 Sep 2017 08:22:17 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id F356B18C729 for ; Thu, 7 Sep 2017 08:22:16 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.981 X-Spam-Level: X-Spam-Status: No, score=0.981 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id VRcw3zdOAwNU for ; Thu, 7 Sep 2017 08:22:10 +0000 (UTC) Received: from outbound-gw.openxchange.ahost.me (outbound-gw.openxchange.ahost.me [94.136.40.163]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 12E425FE43 for ; Thu, 7 Sep 2017 08:22:10 +0000 (UTC) Received: from [127.0.0.1] (helo=outbound-gw.openxchange.ahost.me) by outbound-gw.openxchange.ahost.me with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) (Exim 4.89) (envelope-from ) id 1dps4f-0008UJ-M1 for user@karaf.apache.org; Thu, 07 Sep 2017 09:22:09 +0100 Date: Thu, 7 Sep 2017 09:22:09 +0100 (BST) From: tom@quarendon.net Reply-To: tom@quarendon.net To: user@karaf.apache.org Message-ID: <477167559.3315003.1504772529603@webmail.123-reg.co.uk> In-Reply-To: <3e08155a-bd63-67a4-4825-24b8d5746854@nanthrax.net> References: <871074778.3313754.1504771579747@webmail.123-reg.co.uk> <3e08155a-bd63-67a4-4825-24b8d5746854@nanthrax.net> Subject: Re: Creating a karaf feature containing a karaf shell command breaks karaf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Priority: 3 Importance: Medium X-Mailer: Open-Xchange Mailer v7.8.3-Rev22 X-Originating-IP: 86.188.252.244 X-Originating-Client: com.openexchange.ox.gui.dhtml archived-at: Thu, 07 Sep 2017 08:22:19 -0000 There's a complete example here: https://github.com/tomq42/karaf-command-feature Thanks. > On 07 September 2017 at 09:15 Jean-Baptiste Onofr=C3=A9 = wrote: >=20 >=20 > Hi Tom, >=20 > can you share the pom.xml you use to create your custom distro ? >=20 > It looks like some resources are missing in the distro. >=20 > Regards > JB >=20 > On 09/07/2017 10:06 AM, tom@quarendon.net wrote: > > Clearly this can't be true, since karaf ships with features containing = bundles containing commands, but I can't get it to work. > >=20 > > I've created a simple karaf shell command, following the tutorial in th= e documentation. As per the example, it just says "hello world". > > If I build that as an isolated bundle, install it into karaf and run it= , it works, as per the documentation. > >=20 > > What I'm trying to do though is build that into a feature to include in= to a custom karaf distribution. > > I can build the feature, and I can manually install the feature into a = karaf distribution, and it works OK, I can run the resulting command. > > I can build the karaf distribution containing the feature OK, but when = I then run the resulting karaf then fails to initialise properly. > >=20 > >=20 > > In the log file, I get: > > Adding features: > > Changes to perform: > > Region: root > > Bundles to install: > > ... > > mvn:org.apache.karaf.shell/org.apache.karaf.shell.console/4.1.2 > > null <-- This is clearly bad > > mvn:org.apache.karaf.shell/org.apache.karaf.shell.ssh/4.1.2 > > ... > >=20 > > Installing bundles: > > ... > > null <-- This is the same null as before and causes the problem below. > > Error installing boot features > > java.lang.IllegalStateException: Resource has no uri > > =09at org.apache.karaf.features.internal.service.Deployer.getBundleInpu= tStream(Deployer.java:1460) [10:org.apache.karaf.features.core:4.1.2] > > =09at org.apache.karaf.features.internal.service.Deployer.deploy(Deploy= er.java:766) [10:org.apache.karaf.features.core:4.1.2] > > =09at org.apache.karaf.features.internal.service.FeaturesServiceImpl.do= Provision(FeaturesServiceImpl.java:1233) [10:org.apache.karaf.features.core= :4.1.2] > > =09at org.apache.karaf.features.internal.service.FeaturesServiceImpl.la= mbda$doProvisionInThread$0(FeaturesServiceImpl.java:1132) [10:org.apache.ka= raf.features.core:4.1.2] > > =09at org.apache.karaf.features.internal.service.FeaturesServiceImpl$$L= ambda$15/951619949.call(Unknown Source) [10:org.apache.karaf.features.core:= 4.1.2] > > =09at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?] > > =09at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecu= tor.java:1142) [?:?] > > =09at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExec= utor.java:617) [?:?] > >=20 > > The console then goes funny, and you get: > > Error in initialization script: etc\shell.init.script: String index out= of range: 0 > > which I'm assuming is a knockon issue. > >=20 > > I've got no idea where this "null" bundle is coming from, but it's clea= rly causing the karaf initialisation to go wrong. > >=20 > > I have created an example project at https://github.com/tomq42/karaf-co= mmand-feature which I hope shows the problem. > > Just build with maven, then run the karaf-distro\target\assembly\bin\ka= raf(.bat) command. You should see the error above on the console, and the e= rror in the log. > >=20 > > Any insight would be very welcome. > > Thanks. > >=20 >=20 > --=20 > Jean-Baptiste Onofr=C3=A9 > jbonofre@apache.org > http://blog.nanthrax.net > Talend - http://www.talend.com