From issues-return-39063-archive-asf-public=cust-asf.ponee.io@karaf.apache.org Mon Mar 12 01:58:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 6654318060F for ; Mon, 12 Mar 2018 01:58:06 +0100 (CET) Received: (qmail 2639 invoked by uid 500); 12 Mar 2018 00:58:05 -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 2628 invoked by uid 99); 12 Mar 2018 00:58:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Mar 2018 00:58:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id E5D96C00CD for ; Mon, 12 Mar 2018 00:58:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id FswOITWGzprx for ; Mon, 12 Mar 2018 00:58:02 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 55FC75F30B for ; Mon, 12 Mar 2018 00:58:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 5A7BCE0117 for ; Mon, 12 Mar 2018 00:58:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 119BA21465 for ; Mon, 12 Mar 2018 00:58:00 +0000 (UTC) Date: Mon, 12 Mar 2018 00:58:00 +0000 (UTC) From: "Matt Pavlovich (JIRA)" To: issues@karaf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (KARAF-5664) Service Component created via xml defines scope='singleton' and service is created with scope='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-5664?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1639= 4720#comment-16394720 ]=20 Matt Pavlovich commented on KARAF-5664: --------------------------------------- Yep, looks like its Felix, moving issue to Felix project ref: org.apache.felix.framework.ServiceRegistrationImpl L327 {noformat} =C2=A0 =C2=A0 =C2=A0 =C2=A0 if ( m_factory !=3D null ) =C2=A0 =C2=A0 =C2=A0 =C2=A0 { =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 props.put(Constants.SERVICE_SCOPE= , =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (m_factory instanceof PrototypeServiceFactory =C2=A0=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 ? Constants.SCOPE_PROTOTYPE : Constants.SCOPE_BUNDLE)); =C2=A0 =C2=A0 =C2=A0 =C2=A0 } =C2=A0 =C2=A0 =C2=A0 =C2=A0 else =C2=A0 =C2=A0 =C2=A0 =C2=A0 { =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 props.put(Constants.SERVICE_SCOPE= , Constants.SCOPE_SINGLETON); =C2=A0 =C2=A0 =C2=A0 =C2=A0 }{noformat} > Service Component created via xml defines scope=3D'singleton' and service= is created with scope=3D'bundle' > -------------------------------------------------------------------------= ----------------------------- > > Key: KARAF-5664 > URL: https://issues.apache.org/jira/browse/KARAF-5664 > Project: Karaf > Issue Type: Bug > Components: karaf-scr > Affects Versions: 4.1.5 > Reporter: Matt Pavlovich > Assignee: Jean-Baptiste Onofr=C3=A9 > Priority: Major > > Project reproducing the issue is=C2=A0available here:=C2=A0[https://githu= b.com/mattrpav/karaf-5664]=C2=A0 > Steps to reproduce: > # Define a serviceComponent via xml (or osgi ds annotation) > # Deploy bundle > # run scr:info (observe Service Scope: singleton) > # run service:list (observe service.scope =3D bundle) > Investigation: > * Debugging in felix.scr confirms=C2=A0that the xml is being parsed corr= ectly and the returned component metadata shows the 'scope' =3D 'singleton'= correctly=C2=A0[o.a.felix.scr.impl.xml.XmlHandler#L362|https://github.com/= apache/felix/blob/trunk/scr/src/main/java/org/apache/felix/scr/impl/xml/Xml= Handler.java#L362] > * Debugging confirms that felix.scr is detecting DS13 namespace > =C2=A0scr:info output: > {noformat} > karaf@root()> scr:info TestModule > *** Bundle: com.foo.test-module (124) > Component Description: > Name: BundleModule > Implementation Class: com.foo.TestModule > Default State: enabled > Activation: immediate > Configuration Policy: optional > Activate Method: activate > Deactivate Method: deactivate > Modified Method: - > Configuration Pid: [TestModule] > Services:=20 > com.foo.api.Module > Service Scope: singleton > Component Description Properties: > Component Configuration: > ComponentId: 4 > State: active=20 > Component Configuration Properties: > component.id =3D 4 > component.name =3D TestModule{noformat} > service:list output > {noformat} > karaf@root()> service:list > [com.foo.api.Module] > ------------------------ > component.id =3D 4 > component.name =3D TestModule > service.bundleid =3D 124 > service.id =3D 141=20 > service.scope =3D bundle > Provided by : > Company :: Foo :: TestModule (124){noformat} > OSGI-INF/serviceComponent.xml > {noformat} > > > > > > > {noformat} > =C2=A0 > Note: When the same impl class is reconfigured to register as a service v= ia BundleActivator, the service has a service.scope =3D 'singleton' -- This message was sent by Atlassian JIRA (v7.6.3#76005)