Uploaded image for project: 'CXF Distributed OSGi (Retired)'
  1. CXF Distributed OSGi (Retired)
  2. DOSGI-145

Multiple services using HTTP Service and published from the same bundle do not work

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.4.0
    • common
    • None
    • Unknown

    Description

      This issue was reported at the CXF users list and now is reproducible on the trunk.

      Consider the following activator code:

      public class Activator implements BundleActivator {
          private ServiceRegistration registration;
          private ServiceRegistration registration2;
      
          public void start(BundleContext bc) throws Exception {
              Dictionary props = getProperties("/greeter");
              registration = bc.registerService(GreeterService.class.getName(), 
                                                new GreeterServiceImpl(), props);
              
              props = getProperties("/greeter2");
              registration2 = bc.registerService(GreeterService2.class.getName(), 
                                                new GreeterServiceImpl2(), props);
              
          }
      
          private Dictionary getProperties(String address) { 
          	Dictionary props = new Hashtable();
      
              props.put("service.exported.interfaces", "*");
              props.put("service.exported.configs", "org.apache.cxf.rs");
              props.put("service.exported.intents", "HTTP");
              props.put("org.apache.cxf.rs.httpservice.context", address);
              return props;
          }
          
          public void stop(BundleContext bc) throws Exception {
              registration.unregister();
              registration2.unregister();
          }
      }
      
      

      This is RS activator code but the issue will show itself for WS endpoints too.

      After the deployment, requesting a service at "/greeter" will make "/greeter2" endpoint not accessible and the other way around.

      Attachments

        Activity

          People

            cschneider Christian Schneider
            sergey_beryozkin Sergey Beryozkin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment