6 Replies Latest reply on Oct 30, 2012 4:36 PM by Yogesh Upadhyay

    Configuration Binding issues

    efish11 Level 1

      Hi All,

       

       

      I am creating a service, and supplying some default values for the configuration via properties. but when i am deploying the code - the configuration itself indicates unbound, until i save it and any changes i create a lost when i redeploy the bundle.

       

      @Component(name = MyService.PROCESS_PID, description = "Custom Service", label = "Custom Service", metatype = true, configurationFactory = false, immediate = true)

      @Service

      @Properties({

                          @Property(name = "service.pid", value = MyService.PROCESS_PID),

                          @Property(name = "service.description", value = "Custom Service"),

                          @Property(name = MyService.PATHS, description = "Please add paths", label = "paths", value = "/content,/etc", cardinality = 10),

                          @Property(name = "service.vendor", value = "Adobe") })

       

       

      public void activate(ComponentContext componentContext) {

                          log.info("Entering activate method.");

                          @SuppressWarnings("rawtypes")

                          Dictionary properties = componentContext.getProperties();

       

                          this.paths = MyUtil.convertToStringArray(properties

                                              .get(MyService.PATHS));

       

       

                          log.info("Exiting activate method.");

       

                }

       

      I also see the activate method getting called, but i still see this issue

       

      What am i missing here, Thanks in Advance