2 Replies Latest reply on Aug 10, 2011 5:08 AM by dhill_david

    blueprint - multiple property-placeholders

    dhill_david

      I have an blueprint.xml file where I am trying to do the following:

       

      <cm:property-placeholder id="someId" persistent-id="com.xyz.a"/>

      <cm:property-placeholder id="otherId" persistent-id="com.xyz.b"/>

       

      The property files contain completely different properties. However, when I deploy my bundle I get the follow error:

       

      org.osgi.service.blueprint.container.ComponentDefinitionException: Multiple placeholders with the same prefix and suffix are not allowed

       

      If I combine all of the properties into a single properties file then everything works fine. However, I read in the fusesource docs that there can be multiple declarations. Can someone point out what I am doing wrong?

        • 1. Re: blueprint - multiple property-placeholders
          gertv

          L.S.,

           

           

          In this case, you need to disambiguate between the two property-placeholder definitions by assigning a unique placeholder prefix/suffix to them.  The default values are "${" for the prefix and "}" for the suffix, so something like this should work:

           

          <cm:property-placeholder id="someId" persistent-id="com.xyz.a"/>
          <cm:property-placeholder id="otherId" persistent-id="com.xyz.b"
                                              placeholder-prefix="$(" placeholder-suffix=")"></cm:property-placeholder>
          

           

          This way, properties from PID com.xyz.a are available as $ and properties from com.xyz.b are available as $(propertyName)

           

          Regards,

           

          Gert Vanthiene

          • 2. Re: blueprint - multiple property-placeholders
            dhill_david

            Perfect, thank you.