Blueprint property-placeholder sometimes does not resolve a value on container start-up

Solution Verified - Updated -

Issue

Consider the following use of a property placeholder in a Blueprint XML file in an OSGi bundle on Karaf:

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" … >
    <cm:property-placeholder persistent-id="foo"/>
    <bean id="bar" class="java.lang.Integer">
      <argument type="java.lang.String" value="${something}" />
    </bean>
  </blueprint>

The configuration PID foo is used by multiple OSGi bundles.

Sometimes, when the container starts up, one or more OSGi bundles receives an incorrect (usually empty) value for the configuration placeholder. The impact of this failure depends entirely on how the value is used by the application, and might range from a catastrophic failure, to no effect at all.

The problem can be demonstrated both in Fabric8 and standalone Fuse configurations.

Environment

  • Red Hat JBoss Fuse (on Karaf)
    • 6.3 R2, R3, R4
    • Possibly some 6.2.1 releases are also affected
    • 6.3 GA seems not to be affected
    • Fuse on EAP is probably not affected, as it does not support OSGi bundles

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.