tuscany-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raymond Feng" <enjoyj...@gmail.com>
Subject Re: Problem with "implementation.osgi" reference
Date Tue, 09 Jun 2009 17:12:04 GMT
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=null operation=sayHello) 

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. 

 <sca:component name="SensorNetworkManagementComponent"> 
    <sca:implementation.java class="es.amivital.sensornetworkmanagement.sca.SensorNetworkManagementServiceImpl"/>

    <sca:service name="SensorNetworkManagementService">       
     <sca:binding.ws uri="http://localhost:8085/SensorNetworkManagementComponent"/>

   </sca:service> 
  <sca:reference name="prueba" target="PruebaComponent"/> 
  </sca:component> 


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

***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 = 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 donĀ“t
know if they are neccesary . 

Mime
View raw message