Return-Path: X-Original-To: apmail-karaf-issues-archive@minotaur.apache.org Delivered-To: apmail-karaf-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0645410ABD for ; Wed, 9 Apr 2014 13:04:29 +0000 (UTC) Received: (qmail 23704 invoked by uid 500); 9 Apr 2014 13:04:25 -0000 Delivered-To: apmail-karaf-issues-archive@karaf.apache.org Received: (qmail 23313 invoked by uid 500); 9 Apr 2014 13:04:18 -0000 Mailing-List: contact issues-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list issues@karaf.apache.org Received: (qmail 23118 invoked by uid 99); 9 Apr 2014 13:04:15 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Apr 2014 13:04:15 +0000 Date: Wed, 9 Apr 2014 13:04:15 +0000 (UTC) From: =?utf-8?Q?Jean-Baptiste_Onofr=C3=A9_=28JIRA=29?= To: issues@karaf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (KARAF-2807) Unable to have multiple subshells in one bundle MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/KARAF-2807?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1396= 4120#comment-13964120 ]=20 Jean-Baptiste Onofr=C3=A9 commented on KARAF-2807: --------------------------------------------- Fixed on karaf-3.0.x: https://git-wip-us.apache.org/repos/asf?p=3Dkaraf.git= ;a=3Dcommitdiff;h=3D3269d68a42a7278fb8e4123e786ac8f1b79913fe > Unable to have multiple subshells in one bundle > ----------------------------------------------- > > Key: KARAF-2807 > URL: https://issues.apache.org/jira/browse/KARAF-2807 > Project: Karaf > Issue Type: Bug > Components: karaf-shell > Affects Versions: 3.0.0 > Environment: JDK7, Aries Blueprint, karaf shell schema v1.1.0 > Reporter: Rebecca Chan > Assignee: Jean-Baptiste Onofr=C3=A9 > Fix For: 3.0.1, 4.0.0 > > Attachments: fixSubshell.patch > > > *PROBLEM:* > According to Karaf 3.0.0 release note, Karaf "groups" the commands by sco= pe. Each scope form a subshell. Users should be able to enter subshell dir= ectly by typing the subshell name. =20 > However, if commands with different scopes are packaged in one OSGI bund= le, only the scope of the first command in the blueprint xml file will be r= egistered as subshell. > For example, I have the following three commands in a OSGI bundle > {quote} > @Command(scope =3D "children", name =3D "boy", description =3D "boy's com= mand") > public class BoyCommand extends OsgiCommandSupport { > } > @Command(scope =3D "children", name =3D "girl", description =3D "girl's c= ommand") > public class GirlCommand extends OsgiCommandSupport { > } > @Command(scope =3D "pet", name =3D "dog", description =3D "dog's command"= ) > public class DogCommand extends OsgiCommandSupport { > } > {quote} > And they are in blueprint xml file. > {quote} > > > > > > > =20 > > > =20 > =20 > > =20 > {quote} > I can access children subshell directly by type "children" but I cannot a= cess pet subshell by typing "pet" > *SUGGESTION:* > After looking into the source code of karaf 3.0.0, there is a bug around = line 188 in org.apache.karaf.shell.console.commands.NamespaceHandler. If t= he schema is not SHELL_NAMESPACE_1_0_0 or the action name does not contain = the scope name, the variable "scope" will be null and the subShellName will= always be ".subshell.null". Therefore, if schema is not 1.0.0, only the s= cope of the first defined command in the OSGI bundle will be registered as = subshell in the if statement. =20 > A patch is attached. Please review if it is a proper fix to the bug -- This message was sent by Atlassian JIRA (v6.2#6252)