[ 
https://issues.apache.org/jira/browse/KARAF-3174?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14106545#comment-14106545
 ] 

Vinuraj M commented on KARAF-3174:
----------------------------------

Above mentioned scenario works fine when using a data source configuration as 
following, which is using properties file placed in KARAF_HOME/etc directory.

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0";
        xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0";
        xmlns:enc="http://karaf.apache.org/xmlns/jasypt/v1.0.0";>

  <ext:property-placeholder>
    <ext:default-properties>
                <ext:property name="url" value="" />
                <ext:property name="user" value="" />
                <ext:property name="password" value="" />
        </ext:default-properties>
    <ext:location>file:etc/db1.properties</ext:location>
  </ext:property-placeholder>

   <bean id="ds1" class="org.postgresql.ds.PGSimpleDataSource" >
      <property name="serverName" value="${url}"/>
      <property name="user" value="${user}"/>
      <property name="password" value="${password}"/>
  </bean>

  <service interface="javax.sql.DataSource" ref="ds1">
    <service-properties>
            <entry key="osgi.jndi.service.name" value="jdbc/ds1"/>
    </service-properties>
  </service>
</blueprint>

Properties file in KARAF_HOME/etc as follows

##Database properties
url=localhost:5432/db1
user=userid
password=password

> Data source xml change not taking effect in first karaf start post 
> modification
> -------------------------------------------------------------------------------
>
>                 Key: KARAF-3174
>                 URL: https://issues.apache.org/jira/browse/KARAF-3174
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-config
>    Affects Versions: 3.0.1
>         Environment: RHEL 5.5 x86_64
>            Reporter: Vinuraj M
>            Priority: Minor
>              Labels: datasource, deploy, propertyplaceholder,
>
> Modification of datasource XML placed in KARAF_HOME/deploy folder done while 
> the Karaf instance is down is not detected on the first start of Karaf 
> instance post modification. Karaf instance is taking the old database 
> properties rather than the updated one. This is when the database properties 
> are hard coded into the XML file. Behaviour defers when the database 
> properties are configured using property place holders which is sourced from 
> a properties file placed in KARAF_HOME/etc. While using properties place 
> holders, Karaf is able to pick up the updated configuration.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to