Return-Path: Delivered-To: apmail-tuscany-user-archive@www.apache.org Received: (qmail 81425 invoked from network); 17 Jun 2009 21:32:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Jun 2009 21:32:30 -0000 Received: (qmail 28371 invoked by uid 500); 17 Jun 2009 21:32:41 -0000 Delivered-To: apmail-tuscany-user-archive@tuscany.apache.org Received: (qmail 28329 invoked by uid 500); 17 Jun 2009 21:32:41 -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 28321 invoked by uid 99); 17 Jun 2009 21:32:40 -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 21:32:40 +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 enjoyjava@gmail.com designates 74.125.92.148 as permitted sender) Received: from [74.125.92.148] (HELO qw-out-1920.google.com) (74.125.92.148) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Jun 2009 21:32:29 +0000 Received: by qw-out-1920.google.com with SMTP id 4so317588qwk.20 for ; Wed, 17 Jun 2009 14:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to:references :in-reply-to:subject:date:mime-version:content-type:x-priority :x-msmail-priority:importance:x-mailer:x-mimeole; bh=Lyh9eBcCHQ5HVNv0RaNPqZCga6MlSOYJml4elULO5WM=; b=a8OCVP5xYwoJ25XTyRGujNEB6+qvT7nUt6qE/31XUsTBmPIDizjvqF9BNV9APerpUd aWlMyU8awPcGPn+CiwnvKJmRebByGDnfwIH/JoJdCFVaHGdWv1cZxcwKIb0t5saW1cxC a2DjoxWjZMOFLK1s1FxQ/WJSF6XIf7mNpMsEg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:references:in-reply-to:subject:date:mime-version :content-type:x-priority:x-msmail-priority:importance:x-mailer :x-mimeole; b=eJpH2nD2jMNRSRYsshobZayT/MrLIeFUn4ZG0IgDgIJp5XNQgYamYoGbsAitfEx9pl AcB6FOl7bKJD0XQUOuRUSsmWpQ5GXm8y8OxA3y4UD8U7vsYFWMxa8aDBY7ZcCwYc1+Vf jQHaNJEVBFt6Qn6OVeRRvUNkJeL2NT+u64aWc= Received: by 10.224.74.9 with SMTP id s9mr686935qaj.321.1245274328555; Wed, 17 Jun 2009 14:32:08 -0700 (PDT) Received: from rfengt61p (adsl-76-200-183-0.dsl.pltn13.sbcglobal.net [76.200.183.0]) by mx.google.com with ESMTPS id 26sm47265qwa.4.2009.06.17.14.32.05 (version=SSLv3 cipher=RC4-MD5); Wed, 17 Jun 2009 14:32:07 -0700 (PDT) Message-ID: From: "Raymond Feng" To: , References: <833c9480906160144h1373d254l13552e8f26135b7f@mail.gmail.com> <03DDAE4BBE284FCD866223B583D2F357@rfengt61p> <833c9480906170302t5d8786f0v4af523ab7eb6a8ec@mail.gmail.com> In-Reply-To: <833c9480906170302t5d8786f0v4af523ab7eb6a8ec@mail.gmail.com> Subject: Re: Fwd: Problem with "implementation.osgi" reference Date: Wed, 17 Jun 2009 14:32:02 -0700 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_09EE_01C9EF58.6131E470" X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 14.0.8064.206 X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8064.206 X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. ------=_NextPart_000_09EE_01C9EF58.6131E470 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Please see my comments inline. From: Santiago Miguel Aranda Rojas=20 Sent: Wednesday, June 17, 2009 3:02 AM To: user@tuscany.apache.org ; miguel.luna@telvent.com=20 Subject: Re: Fwd: Problem with "implementation.osgi" reference Ok.=20 I have checked and I don=B4t need to write code in order to register SCA = node.=20 Tuscany is trying to register the node with both options * With "SCA-Composite: true" in the manifest.mf=20 The value should be a path to the composite file within the = bundle * 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. Good catch. I have a new error with both options. Tuscany recognizes the bundle as = SCA bundle but=20 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.prop= erties This is really strange. 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.(Nod= eFactoryImpl.java:579) at = org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl$NodeImpl.(Nod= eFactoryImpl.java:562) at = org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl.createNode(NodeFact= oryImpl.java:506) at = org.apache.tuscany.sca.node.osgi.impl.NodeManager.bundleStarted(NodeManag= er.java:96) at = org.apache.tuscany.sca.node.osgi.impl.NodeManager.bundleChanged(NodeManag= er.java:119) at = org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(= BundleContextImpl.java:1210) at = org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManag= er.java:195) at = org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronou= s(ListenerQueue.java:141) at = org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPriv= ileged(Framework.java:1558) at = org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Fra= mework.java:1509) at = org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHos= t.java:355) at = org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBu= ndle.java:350) at = org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework= .java:1118) at = org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(= StartLevelManager.java:634) at = org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartL= evelManager.java:508) at = org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLeve= l(StartLevelManager.java:282) at = org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(= StartLevelManager.java:468) at = org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManag= er.java:195) at = org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventMan= ager.java:297) Caused by: java.lang.NullPointerException at = org.apache.tuscany.sca.workspace.processor.impl.ContributionContentProces= sor.read(ContributionContentProcessor.java:131) This line doesn't match the latest code in = ContributionContentProcessor.java. Can you post the lines = around? at = org.apache.tuscany.sca.workspace.processor.impl.ContributionContentProces= sor.read(ContributionContentProcessor.java:1) at = org.apache.tuscany.sca.contribution.processor.DefaultURLArtifactProcessor= ExtensionPoint$LazyURLArtifactProcessor.read(DefaultURLArtifactProcessorE= xtensionPoint.java:337) at = org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl.configureNode(NodeF= actoryImpl.java:369) at = org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl.access$2(NodeFactor= yImpl.java:351) at = org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl$NodeImpl.(Nod= eFactoryImpl.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.prop= erties" 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 = Node when the bundle is started.=20 Thanks, Raymond From: Santiago Miguel Aranda Rojas Sent: Tuesday, June 16, 2009 1:44 AM=20 To: user@tuscany.apache.org Subject: Re: Fwd: Problem with "implementation.osgi" reference=20 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 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 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" "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 = provide SCA configurations for the OSGi bundle so that it becomes an SCA = component 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 = 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 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 = bundle, 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 in 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/SensorNetw= orkManagement}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. Thank you very much. 2009/6/10 Raymond Feng The @target is pointing to a wrong componentName/serviceName. It = should be "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 = instance 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 = had a reference to the second and it is normal "implementation.java". The = second 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 = Activator class in "RegistroService" bundle. ***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 .=20 ------=_NextPart_000_09EE_01C9EF58.6131E470 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Please see my comments inline.

From: Santiago Miguel Aranda = Rojas=20
Sent: Wednesday, June 17, 2009 3:02 AM
Subject: Re: Fwd: Problem with "implementation.osgi"=20 reference

Ok. 
I have checked and I don=B4t need to write code in order to = register SCA=20 node. 

Tuscany is trying to register the node with both options
* With "SCA-Composite: true" in the manifest.mf
 
<rfeng>The value should be a path to the composite file = within the=20 bundle</rfeng>
 
* 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=20 of NodeManager.java and "isSCABundle"=20 method. bundle.findEntries("OSGI-INF/sca", "*", false) is not = working=20 correctly in Eclipse because tries to find these files in /OSGI-INF/sca = but they=20 are really in /src/main/resources/OSGI-INF/sca. When I pack the bundle = into a=20 jar I have the right structure. But it is not important. I have copied = this=20 structure into the root of my Eclipse project.
 
<rfeng>Good = catch.</rfeng>


I have a new error with both options. Tuscany recognizes the bundle = as SCA=20 bundle but 

17-jun-2009 11:41:01 = org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl=20 configureNode
INFO: Loading contribution: bundleentry://33/
Could not load resource=20 META-INF/maven/es.amivital.calculatorservice2/CalculatorService3/pom.prop= erties
 
<rfeng>This is really strange.</rfeng>
 
17-jun-2009 11:41:01 = org.apache.tuscany.sca.node.osgi.impl.NodeManager=20 bundleStarted
GRAVE: java.lang.NullPointerException
org.oasisopen.sca.ServiceRuntimeException:=20 java.lang.NullPointerException
at=20 org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl$NodeImpl.<init&g= t;(NodeFactoryImpl.java:579)
at=20 org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl$NodeImpl.<init&g= t;(NodeFactoryImpl.java:562)
at=20 org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl.createNode(NodeFact= oryImpl.java:506)
at=20 org.apache.tuscany.sca.node.osgi.impl.NodeManager.bundleStarted(NodeManag= er.java:96)
at=20 org.apache.tuscany.sca.node.osgi.impl.NodeManager.bundleChanged(NodeManag= er.java:119)
at=20 org.eclipse.osgi.framework.internal.core.BundleContextImpl.dispatchEvent(= BundleContextImpl.java:1210)
at=20 org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManag= er.java:195)
at=20 org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronou= s(ListenerQueue.java:141)
at=20 org.eclipse.osgi.framework.internal.core.Framework.publishBundleEventPriv= ileged(Framework.java:1558)
at=20 org.eclipse.osgi.framework.internal.core.Framework.publishBundleEvent(Fra= mework.java:1509)
at=20 org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHos= t.java:355)
at=20 org.eclipse.osgi.framework.internal.core.AbstractBundle.resume(AbstractBu= ndle.java:350)
at=20 org.eclipse.osgi.framework.internal.core.Framework.resumeBundle(Framework= .java:1118)
at=20 org.eclipse.osgi.framework.internal.core.StartLevelManager.resumeBundles(= StartLevelManager.java:634)
at=20 org.eclipse.osgi.framework.internal.core.StartLevelManager.incFWSL(StartL= evelManager.java:508)
at=20 org.eclipse.osgi.framework.internal.core.StartLevelManager.doSetStartLeve= l(StartLevelManager.java:282)
at=20 org.eclipse.osgi.framework.internal.core.StartLevelManager.dispatchEvent(= StartLevelManager.java:468)
at=20 org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManag= er.java:195)
at=20 org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventMan= ager.java:297)
Caused by: java.lang.NullPointerException
at=20 org.apache.tuscany.sca.workspace.processor.impl.ContributionContentProces= sor.read(ContributionContentProcessor.java:131)
 
<rfeng>This line doesn't match the = latest code in=20 ContributionContentProcessor.java. Can you post the lines=20 around?</rfeng>
 
at=20 org.apache.tuscany.sca.workspace.processor.impl.ContributionContentProces= sor.read(ContributionContentProcessor.java:1)
at=20 org.apache.tuscany.sca.contribution.processor.DefaultURLArtifactProcessor= ExtensionPoint$LazyURLArtifactProcessor.read(DefaultURLArtifactProcessorE= xtensionPoint.java:337)
at=20 org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl.configureNode(NodeF= actoryImpl.java:369)
at=20 org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl.access$2(NodeFactor= yImpl.java:351)
at=20 org.apache.tuscany.sca.node.osgi.impl.NodeFactoryImpl$NodeImpl.<init&g= t;(NodeFactoryImpl.java:574)
... = 18=20 more

When I was using code in order to register the node it was working = Ok. I=20 think I need something more. What is sca-contribution.xml. Do I need = this file?=20 Where should it be ? I don=B4t know why "Could not load resource=20 META-INF/maven/es.amivital.calculatorservice2/CalculatorService3/pom.prop= erties" if=20 this file it is from maven and it is not from Tuscany


Thank you very much for your help
--------------------------------------------------------------------= ----------------------------------------






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


Thanks,
Raymond

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



Sorry I forgot one question.


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


try {

//Registrado el servicio=20 SensorNetworkManagement en el dominio SCA
      =  =20  NodeFactory factory =3D NodeFactory.newInstance();
  =    =20    String url =3D=20 = ContributionLocationHelper.getContributionLocation(getClass());
 = =20        Contribution contrib =3D new = Contribution("c1",=20 url);
         node =3D=20 factory.createNode("OSGI-INF/sca/bundle.composite", = contrib);
   =20      node.start();
     } catch = (Throwable e)=20 {
         e.printStackTrace();
  =  =20  }


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




Does=20 TestService need this code too?




Thank you very=20 much.









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


So, I = have to=20 attach two files (componentType and composite) to my two different = bundles=20 (TestService and Calculator) and model it as "implementation.osgi". =   I=20 have TestService in a bundle I will add these two file and I will = design as=20 "implementation.osgi" .

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

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

Thank you = very=20 much

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



"Raymond=20 Feng" <enjoyjava@gmail.com>

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





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

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

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

Thanks,
Raymond

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






Hi


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


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


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


TestService testService;


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




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


Thank = you very=20 = mucha
















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

Please = see:

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

http://cwiki.apache.org/confluence/display/TUSCANYWIKI/OS= Gi+RFC+119+Implementation

Thanks,
Raymond


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


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


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



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


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




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


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


Thank you very=20 much.



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

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


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


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


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


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



Hello

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

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

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

<sca:component=20 = name=3D"SensorNetworkManagementComponent">
 <sca:implementa= tion.java
class=3D"es.amivital.sensornetworkmanagement.sca.SensorNetwo= rkManagementServiceImpl"/>
 <sca:service=20 name=3D"SensorNetworkManagementService">
  <sca:binding.ws
uri=3D"http://localhost:8085/SensorNetworkManagementComponent"/>
 </sca:service>
<sca:reference=20 name=3D"prueba"=20 = target=3D"PruebaComponent"/>
</sca:component>


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

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

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

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

public interface Prueba=20 {
public abstract String = sayHello();

}





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

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

------=_NextPart_000_09EE_01C9EF58.6131E470--