Blueprint properties placeholder

Here is my blueprint:

<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
    xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 https://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd                            http://camel.apache.org/schema/blueprint https://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
    <bean class="ph.edu.dlsu.esb.CogMockProcessor" id="CogMockProcessor"/>
    
    <cm:property-placeholder id="cogmock.properties"
        persistent-id="custom.properties" update-strategy="reload">
        <cm:default-properties>
            <cm:property name="cogmock.host" value="//localhost"/>
            <cm:property name="cogmock.port" value="8989"/>
            <cm:property name="cogmock.path"
                value="/external/grade/updatestudentgrade"/>
            <cm:property name="cogmock.protocol" value="http"/>
            <cm:property name="cogmock.OpenId.Token"
                value="9GC1hnEeNIWVbehmxxjUwkj1Wcx2Y-P7SgOUZvVUzkM"/>

        </cm:default-properties>
    </cm:property-placeholder>
    
    <camelContext id="_mockcontext" xmlns="http://camel.apache.org/schema/blueprint">
        <route id="_route1">
            <from id="_from1" uri="restlet:http://localhost:{{cogmock.port}}/external/grade/updatestudentgrade?restletMethod=POST">
                <description>Mock the Camu Change of Grade API</description>
            </from>
            <process id="_process1" ref="CogMockProcessor"/>
            <log id="_log1" message="I'm here"/>
        </route>
    </camelContext>
</blueprint>

Here is my fuse-karaf/etc/custom.properties

#
# You can place any customized configuration here.
#
cogmock.protocol=http
cogmock.host=//localhost
cogmock.port=8989
cogmock.path=/external/grade/updatestudentgrade
cogmock.OpenId.Token=9GC1hnEeNIWVbehmxxjUwkj1Wcx2Y-P7SgOUZvVUzkM

It Builds successfully but when I bundle:install -s ... I get:

Unable to start container for blueprint bundle CogMock/1.0.0.SNAPSHOT

If I take out the {{cogmock.port}} everything works fine.

What am I missing?



Read more here: https://stackoverflow.com/questions/67014560/blueprint-properties-placeholder

Content Attribution

This content was originally published by Mike Oliver at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: