yes, I can install the related 'client bundle' and call the service on the
server bundle:



        ServiceReference sr  =
context.getServiceReference(upnp.class.getName());
        if(sr != null)
        {
          upnp x = (upnp)context.getService(sr);
          if(x != null)
          {
                System.out.println("Vai chamar o serviço HelloToYou...");
                int n=x.GetNumber();
                System.out.println("Vai libertar serviço HelloToYou... "+n);
                context.ungetService(sr);

This code from related 'client' bundle works.

I also checked the export packages of the used server bundle and both
interface and bundle are marked for exportation

Alex



On Wed, Feb 13, 2013 at 1:49 PM, Richard S. Hall <[email protected]>wrote:

> Are you sure the server bundle is providing its service?
>
> -> richard
>
>
> On 2/13/13 08:36 , Imóveis Nacionais wrote:
>
>> Hi
>> I am trying to play with service events in a client bundle in order to be
>> notified when other bundles are registered.
>>
>> So, I created a simple maven osgi bundler just with an activator class.
>>
>> public class Activator implements BundleActivator, ServiceListener
>> {
>>
>>      public void start(BundleContext context) throws Exception
>>      {
>>              System.out.println("Client bundle initializing on start
>> method...");
>>
>>              context.addServiceListener(**this);
>>
>>
>>      public void stop(BundleContext context) throws Exception
>>      {
>>          context.removeServiceListener(**this);
>>      }
>>
>>      public void serviceChanged(ServiceEvent event)
>>      {
>>          System.out.println("**serviceChanged called");
>>      }
>>
>> Then, in the gogo shell of felix I installed this client bundle and
>> started
>> it. Then I installed other (server) bundle and started it but the
>> serviceChanged handler is never called. Why?
>>
>> Thanks a lot
>>
>> Alex
>>
>>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> users-unsubscribe@felix.**apache.org<[email protected]>
> For additional commands, e-mail: [email protected]
>
>

Reply via email to