Return-Path: X-Original-To: apmail-karaf-dev-archive@minotaur.apache.org Delivered-To: apmail-karaf-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 04AB390CD for ; Tue, 16 Dec 2014 10:40:27 +0000 (UTC) Received: (qmail 90246 invoked by uid 500); 16 Dec 2014 10:40:26 -0000 Delivered-To: apmail-karaf-dev-archive@karaf.apache.org Received: (qmail 90203 invoked by uid 500); 16 Dec 2014 10:40:26 -0000 Mailing-List: contact dev-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 dev@karaf.apache.org Received: (qmail 90191 invoked by uid 99); 16 Dec 2014 10:40:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Dec 2014 10:40:26 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of freeman.fang@gmail.com designates 209.85.220.50 as permitted sender) Received: from [209.85.220.50] (HELO mail-pa0-f50.google.com) (209.85.220.50) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Dec 2014 10:39:59 +0000 Received: by mail-pa0-f50.google.com with SMTP id bj1so13861142pad.37 for ; Tue, 16 Dec 2014 02:39:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:mime-version:content-type:subject:date:in-reply-to:to :references:message-id; bh=P7OA4M4tSvsBbSvxEB+cMPdu+nOcjlIgg/iEma9MqDs=; b=JAKi9v4guGWU5N+4bCNBBBvnv0sLrNrbOdduXT9KsGs2PVenJFduHYJE6IE5aadbSs z6OsIHFxvtplyz8XiPwajFctxz4H3DZIOU7zXRxKVK3Bkh/7JnKQJA7jYRF9CR0l/Ryx 9tmd6+yJIt4pi5SzrzzxgZIuUVTfnx84F7aL2a9Hj2LcpM/fWg452APLpuBQ8ZJqoNs/ +P2olNePGZJeKKNg0jgwXtwdV7iFDcso03hblPL3YKBOHXRIB8tGh36Lyz7TFScoxnPc y8AMJ8/2+Cda1MKAx3XPWFUI1Cb+/kamtrTtW8DliG5LmCLdIOKhqMVJ71OdIjadPzuT Jyhw== X-Received: by 10.70.128.15 with SMTP id nk15mr58345075pdb.121.1418726352420; Tue, 16 Dec 2014 02:39:12 -0800 (PST) Received: from [192.168.1.101] ([114.252.25.133]) by mx.google.com with ESMTPSA id f12sm498832pdm.90.2014.12.16.02.38.50 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 16 Dec 2014 02:39:11 -0800 (PST) From: Freeman Fang Mime-Version: 1.0 (Apple Message framework v1280) Content-Type: multipart/alternative; boundary="Apple-Mail=_61F6B8BF-15CB-4EFF-9371-35EA023A93F3" Subject: Re: Unable to convert value org.apache.aries.blueprint.container.ServiceRecipe$ServiceRegistrationProxy Date: Tue, 16 Dec 2014 18:38:45 +0800 In-Reply-To: To: dev@karaf.apache.org References: <7ycd2iyahafxivq56uieecm6.1418721558142@email.android.com> Message-Id: <344F68CF-2E76-4EF9-9E36-DC27B9F41DFC@gmail.com> X-Mailer: Apple Mail (2.1280) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail=_61F6B8BF-15CB-4EFF-9371-35EA023A93F3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 No, because the containerManagerId is service id but not the bean id. =EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF= =BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D Freeman(Yue) Fang Red Hat, Inc.=20 FuseSource is now part of Red Hat On 2014-12-16, at =E4=B8=8B=E5=8D=886:27, Andy Schmidt wrote: > Is this no direct usage? >=20 > [XML HEADERS] > = class=3D"de.kisters.project.domain.impl.session.repository.RepositoryFacto= ry"=20 > init-method=3D"activate" destroy-method=3D"deactivate"> > > > [EOF] >=20 > I just pass the bean ID as the ref-value. >=20 > = --------------------------------------------------------------------------= ------------------------------------------------------------------ > Andy Schmidt - KISTERS AG - Pascalstra=C3=9Fe 8+10 - 52076 Aachen - = Germany > Handelsregister Aachen, HRB-Nr. 7838 | Vorstand: Klaus Kisters, Hanns = Kisters | Aufsichtsratsvorsitzender: Dr. Thomas Klevers > Phone: +49 2408 9385 -449 | Fax: +49 2408 9385 -555 | E-Mail: = Andy.Schmidt@kisters.de | WWW: http://www.kisters.de > = --------------------------------------------------------------------------= ------------------------------------------------------------------ > Diese E-Mail enth=C3=A4lt vertrauliche und/oder rechtlich gesch=C3=BCtzt= e Informationen. Wenn Sie nicht der richtige Adressat sind oder diese = E-Mail irrt=C3=BCmlich erhalten haben, informieren Sie bitte sofort den = Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie = die unbefugte Weitergabe dieser Mail ist nicht gestattet.=20 > This e-mail may contain confidential and/or privileged information. If = you are not the intended recipient (or have received this e-mail in = error) please notify the sender immediately and destroy this e-mail. Any = unauthorised copying, disclosure or distribution of the material in this = e-mail is strictly forbidden. >=20 > From: Jean-Baptiste Onofr=C3=A9 > To: dev@karaf.apache.org,=20 > Date: 16.12.2014 10:47 > Subject: Re: Unable to convert value=20 > = org.apache.aries.blueprint.container.ServiceRecipe$ServiceRegistrationProx= y >=20 >=20 >=20 > The problem is the usage of reference. Just use bean directly. >=20 >=20 > Sent from my Samsung Galaxy smartphone. >=20 >=20 > -------- Original message -------- > From: Andy Schmidt =20 > Date:16/12/2014 09:48 (GMT+01:00)=20 > To: dev@karaf.apache.org=20 > Cc:=20 > Subject: Re: Unable to convert value=20 > = org.apache.aries.blueprint.container.ServiceRecipe$ServiceRegistrationProx= y=20 >=20 >=20 > Hi Freeman Fang, >=20 > thank you for your response. >=20 > How would you do it? What do you mean with "refer to the bean = directly"? > It is a service and still has to be a service because another bundle = also=20 > uses it. > So how do I get the one service instance that is registered in the=20 > blueprint container? >=20 > To the "chicken-egg" problem: >=20 > I saw in the IBM tutorial that it is possible to use the blueprint = "ref"=20 > property to refer to a blueprint bean of the same bundle. > = http://www-01.ibm.com/support/knowledgecenter/SSCKBL_8.5.5/com.ibm.websphe= re.osgi.nd.doc/ae/ca_blueprint_references.html?lang=3Den >=20 >=20 > If I understood it right, this is possible by only using the = ref-property=20 > with the desired bean ID and NOT including the reference tag: >=20 > =20 > = interface=3D"de.kisters.project.domain.api.session.container.IContainerMan= ager" > availability=3D"mandatory" /> >=20 > Thank you and regards > Tim >=20 >=20 >=20 > = --------------------------------------------------------------------------= ------------------------------------------------------------------ > Andy Schmidt - KISTERS AG - Pascalstra=C3=9Fe 8+10 - 52076 Aachen - = Germany > Handelsregister Aachen, HRB-Nr. 7838 | Vorstand: Klaus Kisters, Hanns=20= > Kisters | Aufsichtsratsvorsitzender: Dr. Thomas Klevers > Phone: +49 2408 9385 -449 | Fax: +49 2408 9385 -555 | E-Mail:=20 > Andy.Schmidt@kisters.de | WWW: http://www.kisters.de > = --------------------------------------------------------------------------= ------------------------------------------------------------------ > Diese E-Mail enth=C3=A4lt vertrauliche und/oder rechtlich gesch=C3=BCtzt= e=20 > Informationen. Wenn Sie nicht der richtige Adressat sind oder diese = E-Mail=20 > irrt=C3=BCmlich erhalten haben, informieren Sie bitte sofort den = Absender und=20 > vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte=20= > Weitergabe dieser Mail ist nicht gestattet.=20 > This e-mail may contain confidential and/or privileged information. If = you=20 > are not the intended recipient (or have received this e-mail in error)=20= > please notify the sender immediately and destroy this e-mail. Any=20 > unauthorised copying, disclosure or distribution of the material in = this=20 > e-mail is strictly forbidden. >=20 > From: Freeman Fang > To: dev@karaf.apache.org,=20 > Date: 16.12.2014 07:09 > Subject: Re: Unable to convert value=20 > = org.apache.aries.blueprint.container.ServiceRecipe$ServiceRegistrationProx= y >=20 >=20 >=20 > Hi, >=20 > If they are in the same bundle context, why not refer the=20 > de.kisters.project.domain.impl.session.container.ContainerManager bean=20= > directly but not the service. >=20 > Your way run into the chicken-egg problem, that said, your bundle = depend=20 > on a service provided by the bundle itself. > =EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D= =EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D=EF=BC=8D > Freeman(Yue) Fang >=20 > Red Hat, Inc.=20 > FuseSource is now part of Red Hat >=20 >=20 >=20 > On 2014-12-15, at =E4=B8=8B=E5=8D=8811:15, Andy Schmidt wrote: >=20 >> Hey, >>=20 >> we are trying to register a couple of blueprint services using Karaf=20= >> 3.0.2. >>=20 >> Two of those services (lets call them "service A" and "service B") = are=20 >> located in one and the same bundle. >> Service A has a reference to service B. >>=20 >> We are getting the following exception: >>=20 >> org.osgi.service.blueprint.container.ComponentDefinitionException: = Error=20 >=20 >=20 >> setting property: PropertyDescriptor > null, setter: [class=20 >>=20 > = de.kisters.kimatman.domain.impl.session.repository.RepositoryFactory.setCo= ntainerManager(interface=20 >=20 >=20 >> de.kisters.kimatman.domain.api.session.container.IContainerManager)] = at=20 >>=20 > = org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.jav= a:941)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.j= ava:907)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.blueprint.container.BeanRecipe.setProperties(BeanRecipe.j= ava:888)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.blueprint.container.BeanRecipe.internalCreate2(BeanRecipe= .java:820)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.blueprint.container.BeanRecipe.internalCreate(BeanRecipe.= java:787)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.blueprint.di.AbstractRecipe$1.call(AbstractRecipe.java:79= )=20 >=20 >=20 >> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) = at=20 >=20 >=20 >> java.util.concurrent.FutureTask.run(FutureTask.java:166) at=20 >>=20 > = org.apache.aries.blueprint.di.AbstractRecipe.create(AbstractRecipe.java:88= )=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.blueprint.container.BlueprintRepository.createInstances(B= lueprintRepository.java:245)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.blueprint.container.BlueprintRepository.createAll(Bluepri= ntRepository.java:183)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.blueprint.container.BlueprintContainerImpl.instantiateEag= erComponents(BlueprintContainerImpl.java:681)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.blueprint.container.BlueprintContainerImpl.doRun(Blueprin= tContainerImpl.java:378)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.blueprint.container.BlueprintContainerImpl.run(BlueprintC= ontainerImpl.java:269)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.blueprint.container.BlueprintExtender.createContainer(Blu= eprintExtender.java:276)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.blueprint.container.BlueprintExtender.createContainer(Blu= eprintExtender.java:245)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.blueprint.container.BlueprintExtender.modifiedBundle(Blue= printExtender.java:235)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customi= zerModified(BundleHookBundleTracker.java:500)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.customi= zerModified(BundleHookBundleTracker.java:433)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.util.tracker.hook.BundleHookBundleTracker$AbstractTracked= .track(BundleHookBundleTracker.java:725)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.util.tracker.hook.BundleHookBundleTracker$Tracked.bundleC= hanged(BundleHookBundleTracker.java:463)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.util.tracker.hook.BundleHookBundleTracker$BundleEventHook= .event(BundleHookBundleTracker.java:422)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.felix.framework.util.SecureAction.invokeBundleEventHook(SecureA= ction.java:1103)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.felix.framework.util.EventDispatcher.createWhitelistFromHooks(E= ventDispatcher.java:695)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispa= tcher.java:483)=20 >=20 >=20 >> at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4403) = at=20 >> org.apache.felix.framework.Felix.startBundle(Felix.java:2092) at=20 >> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955) at=20= >>=20 > = org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(Directo= ryWatcher.java:1245)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(Direct= oryWatcher.java:1217)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(Directory= Watcher.java:509)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWa= tcher.java:358)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatche= r.java:310)=20 >=20 >=20 >>=20 >>=20 >> Caused by: java.lang.Exception: Unable to convert value=20 >>=20 > = org.apache.aries.blueprint.container.ServiceRecipe$ServiceRegistrationProx= y@20766905=20 >=20 >=20 >> to type=20 > de.kisters.kimatman.domain.api.session.container.IContainerManager=20 >> at=20 >>=20 > = org.apache.aries.blueprint.container.AggregateConverter.convert(AggregateC= onverter.java:184)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.blueprint.container.BlueprintRepository.convert(Blueprint= Repository.java:402)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.blueprint.utils.ReflectionUtils$PropertyDescriptor.conver= t(ReflectionUtils.java:394)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.blueprint.utils.ReflectionUtils$MethodPropertyDescriptor.= internalSet(ReflectionUtils.java:628)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.blueprint.utils.ReflectionUtils$PropertyDescriptor.set(Re= flectionUtils.java:378)=20 >=20 >=20 >> at=20 >>=20 > = org.apache.aries.blueprint.container.BeanRecipe.setProperty(BeanRecipe.jav= a:939)=20 >=20 >=20 >> ... 32 more=20 >>=20 >> Our blueprint files look like: >>=20 >> >> > xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" = xmlns:jpa=3D" >> http://aries.apache.org/xmlns/jpa/v1.1.0" >> xmlns:tx=3D"http://aries.apache.org/xmlns/transactions/v1.0.0" >> xsi:schemaLocation=3D"http://www.osgi.org/xmlns/blueprint/v1.0.0=20= >> http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd >> http://camel.apache.org/schema/blueprint=20 >> http://camel.apache.org/schema/blueprint/camel-blueprint-2.8.0.xsd >> = http://aries.apache.org/xmlns/transactions/v1.0.0=20 >=20 >=20 >> http://aries.apache.org/schemas/transaction/transactionv10.xsd >> http://aries.apache.org/xmlns/jpa/v1.1.0=20 >> http://aries.apache.org/schemas/jpa/jpa_110.xsd"> >>=20 >> >=20 >>=20 > = interface=3D"de.kisters.project.domain.api.session.container.IContainerMan= ager"> >> >=20 > = class=3D"de.kisters.project.domain.impl.session.container.ContainerManager= "=20 >> /> >> >>=20 >>=20 >> >>=20 >> >> > xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" = xmlns:jpa=3D" >> http://aries.apache.org/xmlns/jpa/v1.1.0" >> xmlns:tx=3D"http://aries.apache.org/xmlns/transactions/v1.0.0" >> xsi:schemaLocation=3D"http://www.osgi.org/xmlns/blueprint/v1.0.0=20= >> http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd >> http://camel.apache.org/schema/blueprint=20 >> http://camel.apache.org/schema/blueprint/camel-blueprint-2.8.0.xsd >> = http://aries.apache.org/xmlns/transactions/v1.0.0=20 >=20 >=20 >> http://aries.apache.org/schemas/transaction/transactionv10.xsd >> http://aries.apache.org/xmlns/jpa/v1.1.0=20 >> http://aries.apache.org/schemas/jpa/jpa_110.xsd"> >> >=20 >>=20 > = class=3D"de.kisters.project.domain.impl.session.repository.RepositoryFacto= ry" >> init-method=3D"activate" destroy-method=3D"deactivate"> >> ref=3D"containerManagerId"=20 >> /> >> >>=20 >> >>=20 >> Do you have any hints how to solve the problem? >>=20 >> Best regards, >>=20 >> Andy & Tim >>=20 > = --------------------------------------------------------------------------= ------------------------------------------------------------------ >> Andy Schmidt - KISTERS AG - Pascalstra=C3=9Fe 8+10 - 52076 Aachen - = Germany >> Handelsregister Aachen, HRB-Nr. 7838 | Vorstand: Klaus Kisters, Hanns=20= > Kisters | Aufsichtsratsvorsitzender: Dr. Thomas Klevers >> Phone: +49 2408 9385 -449 | Fax: +49 2408 9385 -555 | E-Mail:=20 > Andy.Schmidt@kisters.de | WWW: http://www.kisters.de >>=20 > = --------------------------------------------------------------------------= ------------------------------------------------------------------ >> Diese E-Mail enth=C3=A4lt vertrauliche und/oder rechtlich gesch=C3=BCtz= te=20 > Informationen. Wenn Sie nicht der richtige Adressat sind oder diese = E-Mail=20 >=20 > irrt=C3=BCmlich erhalten haben, informieren Sie bitte sofort den = Absender und=20 > vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte=20= > Weitergabe dieser Mail ist nicht gestattet.=20 >> This e-mail may contain confidential and/or privileged information. = If=20 > you are not the intended recipient (or have received this e-mail in = error)=20 >=20 > please notify the sender immediately and destroy this e-mail. Any=20 > unauthorised copying, disclosure or distribution of the material in = this=20 > e-mail is strictly forbidden. >=20 >=20 >=20 >=20 >=20 --Apple-Mail=_61F6B8BF-15CB-4EFF-9371-35EA023A93F3--