Return-Path: Delivered-To: apmail-tuscany-user-archive@www.apache.org Received: (qmail 98582 invoked from network); 17 Jun 2009 10:02:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Jun 2009 10:02:33 -0000 Received: (qmail 91530 invoked by uid 500); 17 Jun 2009 10:02:44 -0000 Delivered-To: apmail-tuscany-user-archive@tuscany.apache.org Received: (qmail 91461 invoked by uid 500); 17 Jun 2009 10:02:44 -0000 Mailing-List: contact user-help@tuscany.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@tuscany.apache.org Delivered-To: mailing list user@tuscany.apache.org Received: (qmail 91452 invoked by uid 99); 17 Jun 2009 10:02:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Jun 2009 10:02:44 +0000 X-ASF-Spam-Status: No, hits=3.7 required=10.0 tests=HTML_MESSAGE,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of santiago.aranda.telvent@gmail.com designates 209.85.220.207 as permitted sender) Received: from [209.85.220.207] (HELO mail-fx0-f207.google.com) (209.85.220.207) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Jun 2009 10:02:32 +0000 Received: by fxm3 with SMTP id 3so175335fxm.20 for ; Wed, 17 Jun 2009 03:02:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:reply-to:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=stoA9sa75trczOOJqDkK2P1Xl0lnRtY1gEEAituYFxo=; b=EOWecrZRBkaGsxhityFsUhrfl2InJLs0kfLJQexxEkLlf8zH1YEMa5lfYqtvagTzk9 PtQN3PmirMIRQmT4r08qssQDZ/ka/yrCnnjsLZhxhgmTirFsNqs1gWsKF4EZ65aD56k+ Aud64TXvnlExHqwsbrjqdfOtSig5MTox1fA4Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:date:message-id :subject:from:to:content-type; b=ooGwwULyD33PIQ6dLhblVEG6bD1yezghV2Xp5bMNHnqXQJNFMIJOydLbPaxJue/1Ai WIyOJsDsFnLZxCJTVMDpCCk/wDq0nTn1+O3WZYbub0uUgSqPDmMRyb4HDIP5K8+FpxoJ YLwXmLCJcTmbh/teWhtLZps3nhPhAF1hWtCNQ= MIME-Version: 1.0 Received: by 10.223.110.211 with SMTP id o19mr6196187fap.57.1245232929946; Wed, 17 Jun 2009 03:02:09 -0700 (PDT) Reply-To: santiago.aranda@telvent.com In-Reply-To: <03DDAE4BBE284FCD866223B583D2F357@rfengt61p> References: <833c9480906160144h1373d254l13552e8f26135b7f@mail.gmail.com> <03DDAE4BBE284FCD866223B583D2F357@rfengt61p> Date: Wed, 17 Jun 2009 12:02:09 +0200 Message-ID: <833c9480906170302t5d8786f0v4af523ab7eb6a8ec@mail.gmail.com> Subject: Re: Fwd: Problem with "implementation.osgi" reference From: Santiago Miguel Aranda Rojas To: user@tuscany.apache.org, miguel.luna@telvent.com Content-Type: multipart/alternative; boundary=001636c5bb1373be2d046c886299 X-Virus-Checked: Checked by ClamAV on apache.org --001636c5bb1373be2d046c886299 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Ok. I have checked and I don=B4t need to write code in order to register SCA node. Tuscany is trying to register the node with both options * With "SCA-Composite: true" in the manifest.mf * Without SCA-Composite header but with a OSGI-INF/sca directory. The second option has a problem using Eclipse. I have seen the source code of NodeManager.java and "isSCABundle" method. bundle.findEntries("OSGI-INF/sca", "*", false) is not working correctly in Eclipse because tries to find these files in /OSGI-INF/sca but they are really in /src/main/resources/OSGI-INF/sca. When I pack the bundle into a jar I have the right structure. But it is not important. I have copied this structure into the root of my Eclipse project. I have a new error with both options. Tuscany recognizes the bundle as SCA bundle but 17-jun-2009 11:41:01 org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl configureNode INFO: Loading contribution: bundleentry://33/ *Could not load resource META-INF/maven/es.amivital.calculatorservice2/CalculatorService3/pom.proper= ties * 17-jun-2009 11:41:01 org.apache.tuscany.sca.node.osgi.impl.NodeManager bundleStarted GRAVE: java.lang.NullPointerException org.oasisopen.sca.ServiceRuntimeException: java.lang.NullPointerException at org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl$NodeImpl.(NodeF= actoryImpl.java:579) at org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl$NodeImpl.(NodeF= actoryImpl.java:562) at org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl.createNode(NodeFactor= yImpl.java:506) at org.apache.tuscany.sca.node.osgi.impl.NodeManager.bundleStarted(NodeManager= .java:96) at org.apache.tuscany.sca.node.osgi.impl.NodeManager.bundleChanged(NodeManager= .java:119) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(Bu= ndleContextImpl.java:1210) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager= .java:195) at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(= ListenerQueue.java:141) at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPrivil= eged(Framework.java:1558) at org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Frame= work.java:1509) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.= java:355) at org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBund= le.java:350) at org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework.j= ava:1118) at org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(St= artLevelManager.java:634) at org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartLev= elManager.java:508) at org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(= StartLevelManager.java:282) at org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(St= artLevelManager.java:468) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager= .java:195) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManag= er.java:297) Caused by: java.lang.NullPointerException at org.apache.tuscany.sca.workspace.processor.impl.ContributionContentProcesso= r.read(ContributionContentProcessor.java:131) at org.apache.tuscany.sca.workspace.processor.impl.ContributionContentProcesso= r.read(ContributionContentProcessor.java:1) at org.apache.tuscany.sca.contribution.processor.DefaultURLArtifactProcessorEx= tensionPoint$LazyURLArtifactProcessor.read(DefaultURLArtifactProcessorExten= sionPoint.java:337) at org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl.configureNode(NodeFac= toryImpl.java:369) at org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl.access$2(NodeFactoryI= mpl.java:351) at org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl$NodeImpl.(NodeF= actoryImpl.java:574) ... 18 more When I was using code in order to register the node it was working Ok. I think I need something more. What is sca-contribution.xml. Do I need this file? Where should it be ? I don=B4t know why "Could not load resource META-INF/maven/es.amivital.calculatorservice2/CalculatorService3/pom.proper= ties" if this file it is from maven and it is not from Tuscany Thank you very much for your help ---------------------------------------------------------------------------= --------------------------------- 2009/6/16 Raymond Feng > You don't have to write the code to start the Node. The node-impl-osgi > bundle is watching the SCA enabled OSGi bundles and it will start the Nod= e > when the bundle is started. > > Thanks, > Raymond > > From: Santiago Miguel Aranda Rojas > Sent: Tuesday, June 16, 2009 1:44 AM > To: user@tuscany.apache.org > Subject: Re: Fwd: Problem with "implementation.osgi" reference > > > > Sorry I forgot one question. > > > I am using this code in order to register CalculatorService as SCA servic= e. > > > try { > > //Registrado el servicio SensorNetworkManagement en el dominio SCA > NodeFactory factory =3D NodeFactory.newInstance(); > String url =3D > ContributionLocationHelper.getContributionLocation(getClass()); > Contribution contrib =3D new Contribution("c1", url); > node =3D factory.createNode("OSGI-INF/sca/bundle.composite", > contrib); > node.start(); > } catch (Throwable e) { > e.printStackTrace(); > } > > > Is it neccesary this??? Can I put composite and component type in > "OSGI-INF/sca" directory only? I mean have I to write this code? Does > Tuscany read these files automatically? > > > > > Does TestService need this code too? > > > > > Thank you very much. > > > > > > > > > > 2009/6/16 > > > So, I have to attach two files (componentType and composite) to my two > different bundles (TestService and Calculator) and model it as > "implementation.osgi". I have TestService in a bundle I will add these = two > file and I will design as "implementation.osgi" . > > But Calculator Service (this is in other bundle) has three components and > they are all "implementation.java" and it is working OK. How can I put a > reference to TestService?? Do I need change "implementation.osgi" in > CalculatorComponent instead "implementation.java"? and is it neccesary fo= r > AddServiceComponent and SubstractService?? > > I will try a example I will copy my files in the email. > > Thank you very much > > Un saludo. > Santiago Miguel Aranda Rojas > Telvent Interactiva > Extension: 35999 > Telefono: 955637418 > > > > "Raymond Feng" > > "Raymond Feng" > 15/06/2009 18:36 > Para: , > cc: > Asunto: Re: Fwd: Problem with "implementation.osgi" reference > > > > > > To access an OSGi service from the SCA component, you will have to provid= e > SCA configurations for the OSGi bundle so that it becomes an SCA componen= t > using implementation.osgi and the OSGi service becomes an SCA service so > that the Calculator component can wire to that TestService. > > There are two SCA files you to provide to model the OSGi bundle as an SCA > component. > * bundle.componentType to describe what OSGi services or references are > used > in the bundle (We potentially have better approach to introspect the OSGi > bundle to build this up) > * bundle.composite to configure the component, for example, setting the > bindings. > > These files can be in a separate OSGi bundle than the one that owns the > services/references. > > Thanks, > Raymond > > From: Santiago Miguel Aranda Rojas > Sent: Monday, June 15, 2009 4:01 AM > To: user@tuscany.apache.org > Subject: Fwd: Problem with "implementation.osgi" reference > > > > > > > Hi > > > I can not understand this sample because there are many new concepts for > me. > For example "bundle.componentType". There is not too much information abo= ut > that . I think I need something more simple. I have attached a picture wi= th > my idea. > > > ** When my SCA service was working I had a main component > "implementacion.java" with two references to another two components > (implementation.java). The main component could be invoked as Web Service= . > > > ** Now, I want another reference to a Service (TestService in the picture= ) > that was registered by another different bundle. But this is a OSGi bundl= e, > without SCA information, Composite file nor ComponentType file. I mean it > is > a bundle that is registering a service in the OSGi registry. I need have = a > instance wired to this OSGi service in the class of the main Component in > order to invoke their methods. > > > TestService testService; > > > //I need testService is not null in order to invoke their methods. > testService.sayHello(); > > > > > I hope you can understand my problem. You can ask me if you want. > > > Thank you very mucha > > > > > > > > > > > > > > > > > > 2009/6/10 Raymond Feng > > Please see: > > https://svn.apache.org/repos/asf/tuscany/java/sca/samples/dosgi-calculato= r/ > > https://svn.apache.org/repos/asf/tuscany/java/sca/samples/dosgi-calculato= r-operations/ > > > http://cwiki.apache.org/confluence/display/TUSCANYWIKI/OSGi+RFC+119+Imple= mentation > > Thanks, > Raymond > > > From: Santiago Miguel Aranda Rojas > Sent: Wednesday, June 10, 2009 12:07 AM > To: user@tuscany.apache.org > Subject: Re: Problem with "implementation.osgi" reference > > > Yes, you are right. I was doing some different tests and I copied you a > wrong composite. I wanted to see if the change of @target made an error i= n > tuscany. But Tuscany doesn4t recognize this error because I think it > supposes that will be a "remote Component". I can see this in the tuscany > trace > > > ADVERTENCIA: Component reference target not found, it might be a remote > service running elsewhere in the SCA Domain: Composite =3D > { > http://eclipse.org/SensorNetworkManagement/src/main/resources/SensorNetwo= rkManagement}SensorNetworkManagement > Service =3D PruebaComponent > > > > But it is Ok, because the component I want if an Osgi Service registered = in > the Osgi registry. > I have fixed the error in @target and it is not working yet. > > > Do you know any example when an component is used? > > > > > I have tried to change "xmlns" tag, but it doesn4t work. > > > > xmlns=3D"http://docs.oasis-open.org/ns/opencsa/sca/200903" > bundleSymbolicName=3D"RegistroService" > bundleVersion=3D"1.0.0"> > > > > > > > Thank you very much. > > > > 2009/6/10 Raymond Feng > > The @target is pointing to a wrong componentName/serviceName. It should b= e > "Prueba" instead of "PruebaComponent" as the component name is "Prueba". > > > From: Santiago Miguel Aranda Rojas > Sent: Tuesday, June 09, 2009 1:28 PM > To: user@tuscany.apache.org > Subject: Re: Problem with "implementation.osgi" reference > > > Tuscany 2.02M. The last version I think. April 2009 > ----- Original Message ----- From: Raymond Feng > To: user@tuscany.apache.org > Sent: Tuesday, June 09, 2009 7:12 PM > Subject: Re: Problem with "implementation.osgi" reference > > > Are you using Tuscany/SCA 2.x or 1.x? > > > From: santiago.aranda@telvent.com > Sent: Tuesday, June 09, 2009 9:15 AM > To: user@tuscany.apache.org > Subject: Problem with "implementation.osgi" reference > > > > Hello > > I want to use an osgi service as a SCA component. But I can not access to > their methods from other Component. I mean I have created a wired instan= ce > to the Osgi Service ($Proxy25). It is not "null" but I can not invoke to > one > method because an error is happening > > --->Unable to create SCA binding invoker for local target > SensorNetworkManagementComponent reference prueba (bindingURI=3Dnull > operation=3DsayHello) > > This is my composite file. I want to have to two components. The first ha= d > a > reference to the second and it is normal "implementation.java". The secon= d > is the SCA component that is representing to the Osgi Service that I want > to > recover. This Osgi Service was registered in the Osgi registry by Activat= or > class in "RegistroService" bundle. > > > > class=3D"es.amivital.sensornetworkmanagement.sca.SensorNetworkManagementS= erviceImpl"/> > > uri=3D"http://localhost:8085/SensorNetworkManagementComponent"/> > > > > > > > xmlns=3D"http://tuscany.apache.org/xmlns/sca/1.0" > bundleSymbolicName=3D"RegistroService" > bundleVersion=3D"1.0.0"> > > > > > > ***The Java code--> The first component. > > public class SensorNetworkManagementServiceImpl implements > SensorNetworkManagementService { > private Prueba prueba; > public Prueba getPrueba() { > return prueba; > } > @Reference > public void setPrueba(Prueba prueba) { > this.prueba =3D prueba; > } > } > > **Java code --> The second component. It is another bundle that is > registering one simple Osgi Service. The interface was > > public interface Prueba { > public abstract String sayHello(); > > } > > > > > > This instance (prueba) is not null when an outside client invoke to the > first component. But if I invoke to one method of this interface, for > example "prueba.sayHello" I obtained the previous error. > > I have read something about anottations like @AllowsPassByReference or > @Scope, but I don4t know if they are neccesary . > --001636c5bb1373be2d046c886299 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Ok.=A0
I have checked and I don=B4t need to write code in or= der to register SCA node.=A0

Tuscany is trying to = register the node with both options
* With "SCA-Composite: t= rue" in the manifest.mf
* Without SCA-Composite header but with a OSGI-INF/sca directory.

The second option has a problem using Eclipse. I have = seen the source code of NodeManager.java and "isSCABundle" method= .=A0bundle.findEntries("OSGI-INF/sca", "*", false) is n= ot working correctly in Eclipse because tries to find these files in /OSGI-= INF/sca but they are really in /src/main/resources/OSGI-INF/sca. When I pac= k the bundle into a jar I have the right structure. But it is not important= . I have copied this structure into the root of my Eclipse project.


I have a new error with both options. Tu= scany recognizes the bundle as SCA bundle but=A0

<= div>17-jun-2009 11:41:01 org.apache.tuscany.sca.node.osgi.impl.NodeFactoryI= mpl configureNode
INFO: Loading contribution: bundleentry://33/
Could not l= oad resource META-INF/maven/es.amivital.calculatorservice2/CalculatorServic= e3/pom.properties
17-jun-2009 11:41:01 org.apache.tuscany.sca= .node.osgi.impl.NodeManager bundleStarted
GRAVE: java.lang.NullPointerException
org.oasisopen.sca.Serv= iceRuntimeException: java.lang.NullPointerException
at org.apache.tuscany= .sca.node.osgi.impl.NodeFactoryImpl$NodeImpl.<init>(NodeFactoryImpl.j= ava:579)
at or= g.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl$NodeImpl.<init>(N= odeFactoryImpl.java:562)
at org.apache.tuscany.sca.node.osgi.impl.NodeFacto= ryImpl.createNode(NodeFactoryImpl.java:506)
at or= g.apache.tuscany.sca.node.osgi.impl.NodeManager.bundleStarted(NodeManager.j= ava:96)
= at org.apache.tuscany.sca.node.osgi.impl.NodeManager.bundleChanged(= NodeManager.java:119)
at or= g.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(Bund= leContextImpl.java:1210)
at org.eclipse.osgi.framework.eventmgr.EventManage= r.dispatchEvent(EventManager.java:195)
at or= g.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(Li= stenerQueue.java:141)
at org.eclipse.osgi.framework.internal.core.Framework= .publishBundleEventPrivileged(Framework.java:1558)
at or= g.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Framewo= rk.java:1509)
at org.eclipse.osgi.framework.internal.core.BundleHost.startW= orker(BundleHost.java:355)
at or= g.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBundle= .java:350)
at org.eclipse.osgi.framework.internal.core.Framework.resumeBund= le(Framework.java:1118)
at or= g.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(Star= tLevelManager.java:634)
at org.eclipse.osgi.framework.internal.core.StartLe= velManager.incFWSL(StartLevelManager.java:508)
at or= g.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLevel(St= artLevelManager.java:282)
at org.eclipse.osgi.framework.internal.core.Start= LevelManager.dispatchEvent(StartLevelManager.java:468)
at or= g.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.j= ava:195)
at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.ru= n(EventManager.java:297)
Caused by: java.lang.NullPointerException
at org.apache.tuscany.sca.wo= rkspace.processor.impl.ContributionContentProcessor.read(ContributionConten= tProcessor.java:131)
at or= g.apache.tuscany.sca.workspace.processor.impl.ContributionContentProcessor.= read(ContributionContentProcessor.java:1)
at org.apache.tuscany.sca.contrib= ution.processor.DefaultURLArtifactProcessorExtensionPoint$LazyURLArtifactPr= ocessor.read(DefaultURLArtifactProcessorExtensionPoint.java:337)
at or= g.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl.configureNode(NodeFacto= ryImpl.java:369)
at org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl.a= ccess$2(NodeFactoryImpl.java:351)
at or= g.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl$NodeImpl.<init>(N= odeFactoryImpl.java:574)
... 18 more

When I was using code in order to register the node it = was working Ok. I think I need something more. What is sca-contribution.xml= . Do I need this file? Where should it be ?=A0I don=B4t know why "Could not load r= esource META-INF/maven/es.amivital.calculatorservice2/CalculatorService3/po= m.properties"=A0if this file it is from maven and it is not fro= m Tuscany


Thank you very much for your help
<= div>-----------------------------------------------------------------------= -------------------------------------






2009= /6/16 Raymond Feng <enjoyjava@gmail.com>
You don't have to write the code to start the Node. The node-impl-osgi = bundle is watching the SCA enabled OSGi bundles and it will start the Node = when the bundle is started.


Thanks,
Raymond

From: Santiago Miguel Aranda Rojas
Sent: Tuesday, June 16, 2009 1:44 AM Subject: Re: Fwd: Problem with "implementation.osgi" reference



Sorry I forgot one question.


I am using this code in order to register CalculatorService as SCA service.=


try {

//Registrado el servicio SensorNetworkManagement en el dominio SCA
=A0 =A0 =A0 =A0 =A0NodeFactory factory =3D NodeFactory.newInstance();
=A0 =A0 =A0 =A0 =A0String url =3D ContributionLocationHelper.getContributi= onLocation(getClass());
=A0 =A0 =A0 =A0 =A0Contribution contrib =3D new Contribution("c1"= ;, url);
=A0 =A0 =A0 =A0 =A0node =3D factory.createNode("OSGI-INF/sca/bundle.c= omposite", contrib);
=A0 =A0 =A0 =A0 =A0node.start();
=A0 =A0 =A0} catch (Throwable e) {
=A0 =A0 =A0 =A0 =A0e.printStackTrace();
=A0 =A0 =A0}


Is it neccesary this??? Can I put composite and component type in "OSG= I-INF/sca" directory only? =A0I mean have I to write this code? Does T= uscany read these files automatically?




Does TestService need this code too?




Thank you very much.









2009/6/16 <santiago.aranda@telvent.com>


So, I have to attach two files (componentType and composite) to my two diff= erent bundles (TestService and Calculator) and model it as "implementa= tion.osgi". =A0 I have TestService in a bundle I will add these two fi= le and I will design as "implementation.osgi" .

But Calculator Service (this is in other bundle) has three components and t= hey are all "implementation.java" and it is working OK. How can I= put a reference to TestService?? Do I need change "implementation.osg= i" in CalculatorComponent instead "implementation.java"? and= is it neccesary for AddServiceComponent and SubstractService??

I will try a example I will copy my files in the email.

Thank you very much

Un saludo.
Santiago Miguel Aranda Rojas
Telvent Interactiva
Extension: 35999
Telefono: 955637418



"Raymond Feng" <enjoyjava@gmail.com>

"Raymond Feng"
15/06/2009 18:36
Para: <user= @tuscany.apache.org>, <santiago.aranda@telvent.com>
cc:
Asunto: Re: Fwd: Problem with "implementation.osgi" reference





To access an OSGi service from the SCA component, you will have to provide<= br> SCA configurations for the OSGi bundle so that it becomes an SCA component<= br> using implementation.osgi and the OSGi service becomes an SCA service so that the Calculator component can wire to that TestService.

There are two SCA files you to provide to model the OSGi bundle as an SCA component.
* bundle.componentType to describe what OSGi services or references are use= d
in the bundle (We potentially have better approach to introspect the OSGi bundle to build this up)
* bundle.composite to configure the component, for example, setting the
bindings.

These files can be in a separate OSGi bundle than the one that owns the
services/references.

Thanks,
Raymond

From: Santiago Miguel Aranda Rojas
Sent: Monday, June 15, 2009 4:01 AM
To: user@tusca= ny.apache.org
Subject: Fwd: Problem with "implementation.osgi" reference






Hi


I can not understand this sample because there are many new concepts for me= .
For example "bundle.componentType". There is not too much informa= tion about
that . I think I need something more simple. I have attached a picture with=
my idea.


** When my SCA service was working I had a main component
"implementacion.java" with two references to another two componen= ts
(implementation.java). The main component could be invoked as Web Service.<= br>

** Now, I want another reference to a Service (TestService in the picture)<= br> that was registered by another different bundle. But this is a OSGi bundle,=
without SCA information, Composite file nor ComponentType file. I mean it i= s
a bundle that is registering a service in the OSGi registry. I need have a<= br> instance wired to this OSGi service in the class of the main Component in order to invoke their methods.


TestService testService;


//I need testService is not null in order to invoke their methods.
testService.sayHello();




I hope you can understand my problem. You can ask me if you want.


Thank you very mucha

















2009/6/10 Raymond Feng <enjoyjava@gmail.com>

Please see:

https://svn.apache.org/repos/asf/tuscany/jav= a/sca/samples/dosgi-calculator/
https://svn.apache.org/repos/asf/= tuscany/java/sca/samples/dosgi-calculator-operations/

http://cwiki.apache.org/confluence/di= splay/TUSCANYWIKI/OSGi+RFC+119+Implementation

Thanks,
Raymond


From: Santiago Miguel Aranda Rojas
Sent: Wednesday, June 10, 2009 12:07 AM
To: user@tusca= ny.apache.org
Subject: Re: Problem with "implementation.osgi" reference


Yes, you are right. I was doing some different tests and I copied you a
wrong composite. I wanted to see if the change of @target made an error in<= br> tuscany. =A0But Tuscany doesn4t recognize this error because I think it
supposes that will be a "remote Component". I can see this in the= tuscany
trace


ADVERTENCIA: Component reference target not found, it might be a remote
service running elsewhere in the SCA Domain: Composite =3D
{http://= eclipse.org/SensorNetworkManagement/src/main/resources/SensorNetworkManagem= ent}SensorNetworkManagement
Service =3D PruebaComponent



But it is Ok, because the component I want if an Osgi Service registered in=
the Osgi registry.
I have fixed the error in @target and it is not working yet.


Do you know any example when an <implementation.osgi> component is us= ed?




I have tried to change =A0"xmlns" tag, but it doesn4t work.


<sca:component name=3D"PruebaComponent">
=A0 =A0 =A0<sca:implementation.osgi
xmlns=3D"http://docs.oasis-open.org/ns/opencsa/sca/200903"= ;
=A0 =A0 =A0 =A0 =A0 bundleSymbolicName=3D"RegistroService"
=A0 =A0 =A0 =A0 =A0 bundleVersion=3D"1.0.0">
=A0 =A0 =A0 =A0 =A0<sca:properties service=3D"prueba.PruebaImpl&qu= ot;>
=A0 =A0 =A0 =A0 =A0</sca:properties>
=A0 =A0 =A0</sca:implementation.osgi>
=A0 =A0</sca:component>


Thank you very much.



2009/6/10 Raymond Feng <enjoyjava@gmail.com>

The @target is pointing to a wrong componentName/serviceName. It should be<= br> "Prueba" instead of "PruebaComponent" as the component = name is "Prueba".


From: Santiago Miguel Aranda Rojas
Sent: Tuesday, June 09, 2009 1:28 PM
To: user@tusca= ny.apache.org
Subject: Re: Problem with "implementation.osgi" reference


Tuscany 2.02M. The last version I think. April 2009
----- Original Message ----- From: Raymond Feng
To: user@tusca= ny.apache.org
Sent: Tuesday, June 09, 2009 7:12 PM
Subject: Re: Problem with "implementation.osgi" reference


Are you using Tuscany/SCA 2.x or 1.x?


From: sant= iago.aranda@telvent.com
Sent: Tuesday, June 09, 2009 9:15 AM
To: user@tusca= ny.apache.org
Subject: Problem with "implementation.osgi" reference



Hello

I want to use an osgi service as a SCA component. But I can not access to their methods from other Component. =A0I mean I have created a wired instan= ce
to the Osgi Service ($Proxy25). It is not "null" but I can not in= voke to one
method because an error is happening

--->Unable to create SCA binding invoker for local target
SensorNetworkManagementComponent reference prueba (bindingURI=3Dnull
operation=3DsayHello)

This is my composite file. I want to have to two components. The first had = a
reference to the second and it is normal "implementation.java". T= he second
is the SCA component that is representing to the Osgi Service that I want t= o
recover. This Osgi Service was registered in the Osgi registry by Activator=
class in "RegistroService" bundle.

<sca:component name=3D"SensorNetworkManagementComponent"> =A0<sca:implementation.java
class=3D"es.amivital.sensornetworkmanagement.sca.SensorNetworkManageme= ntServiceImpl"/>
=A0<sca:service name=3D"SensorNetworkManagementService"> =A0 <sca:binding.ws=
uri=3D"http://localhost:8085/SensorNetworkManagementComponen= t"/>
=A0</sca:service>
<sca:reference name=3D"prueba" target=3D"PruebaComponent&= quot;/>
</sca:component>


<sca:component name=3D"Prueba">
=A0 =A0 =A0<sca:implementation.osgi
xmlns=3D"http://tuscany.apache.org/xmlns/sca/1.0"
=A0 =A0 =A0 =A0 =A0 bundleSymbolicName=3D"RegistroService"
=A0 =A0 =A0 =A0 =A0 bundleVersion=3D"1.0.0">
=A0 =A0 =A0 =A0 =A0<sca:properties service=3D"prueba.PruebaImpl&qu= ot;>
=A0 =A0 =A0 =A0 =A0</sca:properties>
=A0 =A0 =A0</sca:implementation.osgi>
</sca:component>

***The Java code--> The first component.

public class SensorNetworkManagementServiceImpl =A0implements
SensorNetworkManagementService {
private Prueba prueba;
public Prueba getPrueba() {
return prueba;
}
@Reference
public void setPrueba(Prueba prueba) {
this.prueba =3D prueba;
}
}

**Java code =A0 =A0 =A0 --> The second component. It is another bundle t= hat is
registering one simple Osgi Service. The interface was

public interface Prueba {
public abstract String sayHello();

}





This instance (prueba) is not null when an outside client invoke to the
first component. But if I invoke to one method of this interface, for
example "prueba.sayHello" I obtained the previous error.

I have read something about anottations like @AllowsPassByReference or
@Scope, but I don4t know if they are neccesary .

--001636c5bb1373be2d046c886299--