muledataweavemulesoftmule-studiomule4

unable to use password from property file in mule 4


I am not able to use the below mentioned password from property file in mule4. I am trying like ${db.password} and database connectivity is failing but hardcoded value is working fine. Is it because password contain colon and semicolon?

app.properties

db.host=test
db.port=1443
db.database=test_db
db.password=DAwrtkcz%35:\zC;

xml config not working:

    <db:config name="Database_Config" doc:name="Database Config" doc:id="af868fbb-3dc2-4392-9e8d-4195343e26d9" >
            <db:mssql-connection host="${db.host}" port="${db.port}" user="${db.user}" password="${db.password}" databaseName="${db.dbname}" />
    </db:config>

xml config working:

    <db:config name="Database_Config" doc:name="Database Config" doc:id="af868fbb-3dc2-4392-9e8d-4195343e26d9" >
            <db:mssql-connection host="${db.host}" port="${db.port}" user="${db.user}" password="DAwrtkcz%35:\zC;" databaseName="${db.dbname}" />
    </db:config>

gobal.xml

   <configuration-properties doc:name="Configuration properties" doc:id="edb2306f-8ead-4bfc-8263-d78300b26ce7" file="properties\app.properties" />

Solution

  • Maybe string password need to have a escape char to escape “\”. It would be like:

    DAwrtkcz%35:\\zC;