Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-5506

OSGi's @Component parameter configurationPid is handled incorrectly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: scr ds annotations 1.2.8
    • Fix Version/s: scr ds annotations 1.2.10
    • Component/s: SCR Tooling
    • Labels:
      None

      Description

      Given the following class:

      package xxx;
      
      import org.osgi.service.component.annotations.Component;
      
      @Component(configurationPid = "GeneratorComponentPid")
      public class GeneratorComponent {
      }
      

      When running it through the SCR Generator, it produces the following XML:

      <?xml version="1.0" encoding="UTF-8"?><components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.2.0">
          <scr:component name="xxx.GeneratorComponent" configuration-pid="[Ljava.lang.String;@76954a33">
              <implementation class="xxx.GeneratorComponent"/>
          </scr:component>
      </components>
      

      I expected it to produce:

      <?xml version="1.0" encoding="UTF-8"?><components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.2.0">
          <scr:component name="xxx.GeneratorComponent" configuration-pid="GeneratorComponentPid">
              <implementation class="xxx.GeneratorComponent"/>
          </scr:component>
      </components>
      

      org.osgi.service.component.annotations.Component and org.apache.felix.scr.annotations.Component have different definitions for configurationPid, which might explain this behavior.

        Attachments

          Activity

            People

            • Assignee:
              cziegeler Carsten Ziegeler
              Reporter:
              islandsvinur Christian Luijten
            • Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: