You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by vi...@wipro.com on 2014/08/11 07:27:15 UTC

Data source xml change not taking effect in first karaf start post modification

I have an application that uses a postgresql database. I am using PGSimpleDataSource configured using a data source xml placed in $KARAF_HOME/deploy directory. Noticed an issue when the database xml file is modified.

When I shutdown karaf, modify the data source XML to point to a different database and start karaf, it is still taking the old database connection parameters. If I restart again it connecting to the database that is configured in XML file. Is Karaf caching connection parameters ?

regards
Vinu

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com

RE: Data source xml change not taking effect in first karaf start post modification

Posted by vi...@wipro.com.
Created KARAF-3174 for this .

-----Original Message-----
From: Jean-Baptiste Onofré [mailto:jb@nanthrax.net] 
Sent: Thursday, August 21, 2014 8:47 PM
To: user@karaf.apache.org
Subject: Re: Data source xml change not taking effect in first karaf start post modification

The fact to have felix.fileinstall.file property and use it is in ConfigAdmin. But the monitoring of the etc folder is in Karaf. If you take a look in etc/config.properties, you will see:

#
# Configuration FileMonitor properties
#
felix.fileinstall.enableConfigSave = true
felix.fileinstall.dir    = ${karaf.base}/etc
felix.fileinstall.filter = .*\\.cfg
felix.fileinstall.poll   = 1000
felix.fileinstall.noInitialDelay = true
felix.fileinstall.log.level = 3


That's the monitoring/polling on the etc folder.

More over, the creation of the cfg file when you use ConfigAdmin 
(config:* commands for instance) without felix.fileinstall.dir is 
directly in Karaf.

Regards
JB

On 08/21/2014 05:13 PM, Christian Schneider wrote:
> Hi JB,
>
> I always thought that this was already built into config admin.
> is the code that takes car of this part of the karaf config module?
>
> Christian
>
> Am 21.08.2014 15:01, schrieb Jean-Baptiste Onofré:
>> Hi Christian,
>>
>> actually, ConfigAdmin itself doesn't directly use FileInstall: the
>> monitoring of the etc folder is a Karaf feature, no a ConfigAdmin
>> feature.
>>
>> Regards
>> JB
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com

Re: Data source xml change not taking effect in first karaf start post modification

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
The fact to have felix.fileinstall.file property and use it is in 
ConfigAdmin. But the monitoring of the etc folder is in Karaf. If you 
take a look in etc/config.properties, you will see:

#
# Configuration FileMonitor properties
#
felix.fileinstall.enableConfigSave = true
felix.fileinstall.dir    = ${karaf.base}/etc
felix.fileinstall.filter = .*\\.cfg
felix.fileinstall.poll   = 1000
felix.fileinstall.noInitialDelay = true
felix.fileinstall.log.level = 3


That's the monitoring/polling on the etc folder.

More over, the creation of the cfg file when you use ConfigAdmin 
(config:* commands for instance) without felix.fileinstall.dir is 
directly in Karaf.

Regards
JB

On 08/21/2014 05:13 PM, Christian Schneider wrote:
> Hi JB,
>
> I always thought that this was already built into config admin.
> is the code that takes car of this part of the karaf config module?
>
> Christian
>
> Am 21.08.2014 15:01, schrieb Jean-Baptiste Onofré:
>> Hi Christian,
>>
>> actually, ConfigAdmin itself doesn't directly use FileInstall: the
>> monitoring of the etc folder is a Karaf feature, no a ConfigAdmin
>> feature.
>>
>> Regards
>> JB
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Data source xml change not taking effect in first karaf start post modification

Posted by Christian Schneider <ch...@die-schneider.net>.
Hi JB,

I always thought that this was already built into config admin.
is the code that takes car of this part of the karaf config module?

Christian

Am 21.08.2014 15:01, schrieb Jean-Baptiste Onofré:
> Hi Christian,
>
> actually, ConfigAdmin itself doesn't directly use FileInstall: the 
> monitoring of the etc folder is a Karaf feature, no a ConfigAdmin 
> feature.
>
> Regards
> JB

-- 
  
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: Data source xml change not taking effect in first karaf start post modification

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Christian,

actually, ConfigAdmin itself doesn't directly use FileInstall: the 
monitoring of the etc folder is a Karaf feature, no a ConfigAdmin feature.

Regards
JB

On 08/21/2014 01:06 PM, Christian Schneider wrote:
> That is an interesting observation. Config admin and the deploy folder
> both use fileinstall to monitor the directory. Still config admin seems
> to notice changes that occur while karaf is offline.
> So perhaps we are just not using some fileinstall feature config admin
> uses.
>
> Christian
>
> Am 21.08.2014 09:24, schrieb Achim Nierbeck:
>> Hi
>>
>> If this is inconsistent between the properties and the deployment of
>> files in the deploy folder, we might need to check how it differs.
>> Could you open an issue with a test case for reproduction?
>>
>> regards, Achim
>>
>>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Data source xml change not taking effect in first karaf start post modification

Posted by Achim Nierbeck <bc...@googlemail.com>.
Christian,



2014-08-21 13:06 GMT+02:00 Christian Schneider <ch...@die-schneider.net>:

> That is an interesting observation. Config admin and the deploy folder
> both use fileinstall to monitor the directory. Still config admin seems to
> notice changes that occur while karaf is offline.
> So perhaps we are just not using some fileinstall feature config admin
> uses.
>
>
config admin doesn't use fielinstall, fileinstall uses config admin to
update configurations.
BUT, it is rather strange that the default configuration handler does
behave differently then the one for blueprint.xml files.
So it has to be something in the canHandle method of this deployer. Cause
if this one says No, the file will never be looked at again till the next
restart
which is the case here.



> Christian
>
> Am 21.08.2014 09:24, schrieb Achim Nierbeck:
>
>  Hi
>>
>> If this is inconsistent between the properties and the deployment of
>> files in the deploy folder, we might need to check how it differs.
>> Could you open an issue with a test case for reproduction?
>>
>> regards, Achim
>>
>>
>>
> --
>  Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> Talend Application Integration Division http://www.talend.com
>
>


-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>

Software Architect / Project Manager / Scrum Master

Re: Data source xml change not taking effect in first karaf start post modification

Posted by Christian Schneider <ch...@die-schneider.net>.
That is an interesting observation. Config admin and the deploy folder 
both use fileinstall to monitor the directory. Still config admin seems 
to notice changes that occur while karaf is offline.
So perhaps we are just not using some fileinstall feature config admin uses.

Christian

Am 21.08.2014 09:24, schrieb Achim Nierbeck:
> Hi
>
> If this is inconsistent between the properties and the deployment of 
> files in the deploy folder, we might need to check how it differs.
> Could you open an issue with a test case for reproduction?
>
> regards, Achim
>
>

-- 
  
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: Data source xml change not taking effect in first karaf start post modification

Posted by Achim Nierbeck <bc...@googlemail.com>.
Hi

If this is inconsistent between the properties and the deployment of files
in the deploy folder, we might need to check how it differs.
Could you open an issue with a test case for reproduction?

regards, Achim



2014-08-21 7:21 GMT+02:00 <vi...@wipro.com>:

>  While this is not going to be a high impact issue in my environment, in
> my opinion this is an issue for two reasons
>
>
>
> 1.       Karaf is starting up with an obsolete configuration . I can
> understand Karaf not able to pick up change in file while it is down. But
> when it starts, it should be able to pick up the change in configuration
> rather than using a configuration that is no more valid.
>
> 2.       When I use property place holders with database credentials in a
> properties file, this issue doesn’t seem to occur. So the behavior no
> consistent.
>
>
>
> *From:* Achim Nierbeck [mailto:bcanhome@googlemail.com
> <bc...@googlemail.com>]
> *Sent:* Monday, August 11, 2014 3:11 PM
>
> *To:* user@karaf.apache.org
> *Subject:* Re: Data source xml change not taking effect in first karaf
> start post modification
>
>
>
> See my comments inline
>
>
> regards, Achim
>
> 2014-08-11 11:35 GMT+02:00 <vi...@wipro.com>:
>
> Database parameters are directly mentioned in the blueprint. If I cleanup
> data folder and start Karaf, latest configuration is considered. Like Achim
> mentioned, the issue happens when the XML is modified while Karaf is down.
>  Isn’t that a problem ?
>
>
>
> No I don't think it is really an issue, as the FileInstaller monitors the
> files it already installed.
>
> But if you change it  while Karaf is down it usually isn't capable of
> doing so.
>
> Another way would be to install the xml file via maven.
>
> Then either update it via osgi:update mvn-coordinates or a
>
> bundle:watch (used to be dev:watch in 2.x)
>
>
>
>
>
>
>
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s) and
> may contain proprietary, confidential or privileged information. If you are
> not the intended recipient, you should not disseminate, distribute or copy
> this e-mail. Please notify the sender immediately and destroy all copies of
> this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses.
> The company accepts no liability for any damage caused by any virus
> transmitted by this email.
>
> www.wipro.com
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>

Software Architect / Project Manager / Scrum Master

RE: Data source xml change not taking effect in first karaf start post modification

Posted by vi...@wipro.com.
While this is not going to be a high impact issue in my environment, in my opinion this is an issue for two reasons


1.       Karaf is starting up with an obsolete configuration . I can understand Karaf not able to pick up change in file while it is down. But when it starts, it should be able to pick up the change in configuration rather than using a configuration that is no more valid.

2.       When I use property place holders with database credentials in a properties file, this issue doesn’t seem to occur. So the behavior no consistent.

From: Achim Nierbeck [mailto:bcanhome@googlemail.com]
Sent: Monday, August 11, 2014 3:11 PM
To: user@karaf.apache.org<ma...@karaf.apache.org>
Subject: Re: Data source xml change not taking effect in first karaf start post modification

See my comments inline

regards, Achim
2014-08-11 11:35 GMT+02:00 <vi...@wipro.com>>:

Database parameters are directly mentioned in the blueprint. If I cleanup data folder and start Karaf, latest configuration is considered. Like Achim mentioned, the issue happens when the XML is modified while Karaf is down.  Isn’t that a problem ?

No I don't think it is really an issue, as the FileInstaller monitors the files it already installed.
But if you change it  while Karaf is down it usually isn't capable of doing so.
Another way would be to install the xml file via maven.
Then either update it via osgi:update mvn-coordinates or a
bundle:watch (used to be dev:watch in 2.x)




The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com

Re: Data source xml change not taking effect in first karaf start post modification

Posted by Achim Nierbeck <bc...@googlemail.com>.
See my comments inline

regards, Achim

2014-08-11 11:35 GMT+02:00 <vi...@wipro.com>:

>  Database parameters are directly mentioned in the blueprint. If I
> cleanup data folder and start Karaf, latest configuration is considered.
> Like Achim mentioned, the issue happens when the XML is modified while
> Karaf is down.  Isn’t that a problem ?
>

No I don't think it is really an issue, as the FileInstaller monitors the
files it already installed.
But if you change it  while Karaf is down it usually isn't capable of doing
so.
Another way would be to install the xml file via maven.
Then either update it via osgi:update mvn-coordinates or a
bundle:watch (used to be dev:watch in 2.x)



>
>
> When I store the database credentials in a properties file and use Apache
> Aries blueprint extension for property placeholder to import and use the
> values, the issue doesn’t seem to occur. Noticed this when I was trying to
> enable database credentials encryption using Aries blueprint extension and
> Jasypt as mentioned in fusesource security guide.
>
>
>
> *From:* Achim Nierbeck [mailto:bcanhome@googlemail.com]
> *Sent:* Monday, August 11, 2014 2:00 PM
> *To:* user@karaf.apache.org
> *Subject:* Re: Data source xml change not taking effect in first karaf
> start post modification
>
>
>
> I think the main problem seems to be, the xml file was altered while karaf
> wasn't able to realize it's been altered.
>
> After the startup it still used the old one as there has already been a
> bundle generated for it.
>
> My best guess right now, this is due to the fact that karaf/FileInstaller
> wasn't "seeing" the change it wasn't able to "re-load" the change,
>
> make sure you alter it while Karaf is running then it will be able to get
> it faster.
>
>
>
> regards, Achim
>
>
>
> 2014-08-11 9:22 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:
>
> It depends of the blueprint: if the parameters are directly in the
> blueprint (not in cm), ConfigAdmin is not used at all.
>
> Regards
> JB
>
>
>
> On 08/11/2014 09:20 AM, Bram Pouwelse wrote:
>
>  I think the issue is that config admin stores the configuration
> internally (that would be where karaf caches the connection parameters)
> and that the datasource is created before the xml file is processed again.
>
> Regards,
> Bram
>
>
> 2014-08-11 9:09 GMT+02:00 Jean-Baptiste Onofré <jb@nanthrax.net
>
> <ma...@nanthrax.net>>:
>
>
>
>     Can you cleanup the data folder ?
>
>     Regards
>     JB
>
>
>     On 08/11/2014 07:27 AM, vinuraj.maroli@wipro.com
>
>     <ma...@wipro.com> wrote:
>
>         I have an application that uses a postgresql database. I am using
>         PGSimpleDataSource configured using a data source xml placed in
>         $KARAF_HOME/deploy directory. Noticed an issue when the database
> xml
>         file is modified.
>
>         When I shutdown karaf, modify the data source XML to point to a
>         different database and start karaf, it is still taking the old
>         database
>         connection parameters. If I restart again it connecting to the
>         database
>         that is configured in XML file. Is Karaf caching connection
>         parameters ?
>
>         regards
>
>         Vinu
>
>         The information contained in this electronic message and any
>         attachments
>         to this message are intended for the exclusive use of the
>         addressee(s)
>         and may contain proprietary, confidential or privileged
>         information. If
>         you are not the intended recipient, you should not disseminate,
>         distribute or copy this e-mail. Please notify the sender
>         immediately and
>         destroy all copies of this message and any attachments.
>
>         WARNING: Computer viruses can be transmitted via email. The
>         recipient
>         should check this email and any attachments for the presence of
>         viruses.
>         The company accepts no liability for any damage caused by any virus
>         transmitted by this email.
>
>         www.wipro.com <http://www.wipro.com>
>
>
>     --
>     Jean-Baptiste Onofré
>     jbonofre@apache.org <ma...@apache.org>
>
>
>     http://blog.nanthrax.net
>     Talend - http://www.talend.com
>
>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>
>
>
>
>
> --
>
>
> Apache Member
>
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
> Project Lead
> blog <http://notizblog.nierbeck.de/>
>
>
>
> Software Architect / Project Manager / Scrum Master
>
>
>
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s) and
> may contain proprietary, confidential or privileged information. If you are
> not the intended recipient, you should not disseminate, distribute or copy
> this e-mail. Please notify the sender immediately and destroy all copies of
> this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses.
> The company accepts no liability for any damage caused by any virus
> transmitted by this email.
>
> www.wipro.com
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>

Software Architect / Project Manager / Scrum Master

RE: Data source xml change not taking effect in first karaf start post modification

Posted by vi...@wipro.com.
Database parameters are directly mentioned in the blueprint. If I cleanup data folder and start Karaf, latest configuration is considered. Like Achim mentioned, the issue happens when the XML is modified while Karaf is down.  Isn’t that a problem ?



When I store the database credentials in a properties file and use Apache Aries blueprint extension for property placeholder to import and use the values, the issue doesn’t seem to occur. Noticed this when I was trying to enable database credentials encryption using Aries blueprint extension and Jasypt as mentioned in fusesource security guide.

From: Achim Nierbeck [mailto:bcanhome@googlemail.com]
Sent: Monday, August 11, 2014 2:00 PM
To: user@karaf.apache.org
Subject: Re: Data source xml change not taking effect in first karaf start post modification

I think the main problem seems to be, the xml file was altered while karaf wasn't able to realize it's been altered.
After the startup it still used the old one as there has already been a bundle generated for it.
My best guess right now, this is due to the fact that karaf/FileInstaller wasn't "seeing" the change it wasn't able to "re-load" the change,
make sure you alter it while Karaf is running then it will be able to get it faster.

regards, Achim

2014-08-11 9:22 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>>:
It depends of the blueprint: if the parameters are directly in the blueprint (not in cm), ConfigAdmin is not used at all.

Regards
JB


On 08/11/2014 09:20 AM, Bram Pouwelse wrote:
I think the issue is that config admin stores the configuration
internally (that would be where karaf caches the connection parameters)
and that the datasource is created before the xml file is processed again.

Regards,
Bram


2014-08-11 9:09 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>
<ma...@nanthrax.net>>>:


    Can you cleanup the data folder ?

    Regards
    JB


    On 08/11/2014 07:27 AM, vinuraj.maroli@wipro.com<ma...@wipro.com>
    <ma...@wipro.com>> wrote:

        I have an application that uses a postgresql database. I am using
        PGSimpleDataSource configured using a data source xml placed in
        $KARAF_HOME/deploy directory. Noticed an issue when the database xml
        file is modified.

        When I shutdown karaf, modify the data source XML to point to a
        different database and start karaf, it is still taking the old
        database
        connection parameters. If I restart again it connecting to the
        database
        that is configured in XML file. Is Karaf caching connection
        parameters ?

        regards

        Vinu

        The information contained in this electronic message and any
        attachments
        to this message are intended for the exclusive use of the
        addressee(s)
        and may contain proprietary, confidential or privileged
        information. If
        you are not the intended recipient, you should not disseminate,
        distribute or copy this e-mail. Please notify the sender
        immediately and
        destroy all copies of this message and any attachments.

        WARNING: Computer viruses can be transmitted via email. The
        recipient
        should check this email and any attachments for the presence of
        viruses.
        The company accepts no liability for any damage caused by any virus
        transmitted by this email.
        www.wipro.com<http://www.wipro.com> <http://www.wipro.com>


    --
    Jean-Baptiste Onofré
    jbonofre@apache.org<ma...@apache.org> <ma...@apache.org>>

    http://blog.nanthrax.net
    Talend - http://www.talend.com


--
Jean-Baptiste Onofré
jbonofre@apache.org<ma...@apache.org>
http://blog.nanthrax.net
Talend - http://www.talend.com



--

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer & Project Lead
blog <http://notizblog.nierbeck.de/>

Software Architect / Project Manager / Scrum Master


The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

www.wipro.com

Re: Data source xml change not taking effect in first karaf start post modification

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Christian,

honestly, I don't think so as it's the expected behavior IMHO.

Regards
JB

On 08/11/2014 11:25 AM, Christian Schneider wrote:
> I also think this is the issue.
>
> Do you think this should be filed as a bug in felix fileinstall?
>
> Christian
>
> Am 11.08.2014 10:29, schrieb Achim Nierbeck:
>> I think the main problem seems to be, the xml file was altered while
>> karaf wasn't able to realize it's been altered.
>> After the startup it still used the old one as there has already been
>> a bundle generated for it.
>> My best guess right now, this is due to the fact that
>> karaf/FileInstaller wasn't "seeing" the change it wasn't able to
>> "re-load" the change,
>> make sure you alter it while Karaf is running then it will be able to
>> get it faster.
>>
>> regards, Achim
>>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Data source xml change not taking effect in first karaf start post modification

Posted by asookazian2 <as...@gmail.com>.
This is an issue.  We have users who will not know this unless it is
explicitly documented.  

You should be able to modify the datasource-xxx.xml file when karaf is not
running and karaf should always check for any changes to the xml files in
deploy dir vs. the already deployed xml bundles.  Then this wouldn't be a
problem.  So a bug/enhancement request is in order I believe...


Achim Nierbeck wrote
> No Issue, just not the right usage?
> If Karaf is running, the change is detected.
> It is even detected when the Karaf Instance is shut down.
> So it works as designed, AFAIC.
> 
> regards, Achim
> 
> 
> 
> 2014-08-11 11:25 GMT+02:00 Christian Schneider &lt;

> chris@

> &gt;:
> 
>> I also think this is the issue.
>>
>> Do you think this should be filed as a bug in felix fileinstall?
>>
>> Christian
>>
>> Am 11.08.2014 10:29, schrieb Achim Nierbeck:
>>
>>  I think the main problem seems to be, the xml file was altered while
>>> karaf wasn't able to realize it's been altered.
>>> After the startup it still used the old one as there has already been a
>>> bundle generated for it.
>>> My best guess right now, this is due to the fact that
>>> karaf/FileInstaller
>>> wasn't "seeing" the change it wasn't able to "re-load" the change,
>>> make sure you alter it while Karaf is running then it will be able to
>>> get
>>> it faster.
>>>
>>> regards, Achim
>>>
>>>
>> --
>>  Christian Schneider
>> http://www.liquid-reality.de
>>
>> Open Source Architect
>> Talend Application Integration Division http://www.talend.com
>>
>>
> 
> 
> -- 
> 
> Apache Member
> Apache Karaf &lt;http://karaf.apache.org/&gt; Committer & PMC
> OPS4J Pax Web &lt;http://wiki.ops4j.org/display/paxweb/Pax+Web/&gt;
> Committer &
> Project Lead
> blog &lt;http://notizblog.nierbeck.de/&gt;
> 
> Software Architect / Project Manager / Scrum Master





--
View this message in context: http://karaf.922171.n3.nabble.com/Data-source-xml-change-not-taking-effect-in-first-karaf-start-post-modification-tp4034670p4034782.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Data source xml change not taking effect in first karaf start post modification

Posted by Achim Nierbeck <bc...@googlemail.com>.
No Issue, just not the right usage?
If Karaf is running, the change is detected.
It is even detected when the Karaf Instance is shut down.
So it works as designed, AFAIC.

regards, Achim



2014-08-11 11:25 GMT+02:00 Christian Schneider <ch...@die-schneider.net>:

> I also think this is the issue.
>
> Do you think this should be filed as a bug in felix fileinstall?
>
> Christian
>
> Am 11.08.2014 10:29, schrieb Achim Nierbeck:
>
>  I think the main problem seems to be, the xml file was altered while
>> karaf wasn't able to realize it's been altered.
>> After the startup it still used the old one as there has already been a
>> bundle generated for it.
>> My best guess right now, this is due to the fact that karaf/FileInstaller
>> wasn't "seeing" the change it wasn't able to "re-load" the change,
>> make sure you alter it while Karaf is running then it will be able to get
>> it faster.
>>
>> regards, Achim
>>
>>
> --
>  Christian Schneider
> http://www.liquid-reality.de
>
> Open Source Architect
> Talend Application Integration Division http://www.talend.com
>
>


-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>

Software Architect / Project Manager / Scrum Master

Re: Data source xml change not taking effect in first karaf start post modification

Posted by Christian Schneider <ch...@die-schneider.net>.
I also think this is the issue.

Do you think this should be filed as a bug in felix fileinstall?

Christian

Am 11.08.2014 10:29, schrieb Achim Nierbeck:
> I think the main problem seems to be, the xml file was altered while 
> karaf wasn't able to realize it's been altered.
> After the startup it still used the old one as there has already been 
> a bundle generated for it.
> My best guess right now, this is due to the fact that 
> karaf/FileInstaller wasn't "seeing" the change it wasn't able to 
> "re-load" the change,
> make sure you alter it while Karaf is running then it will be able to 
> get it faster.
>
> regards, Achim
>

-- 
  
Christian Schneider
http://www.liquid-reality.de

Open Source Architect
Talend Application Integration Division http://www.talend.com


Re: Data source xml change not taking effect in first karaf start post modification

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
I agree, and it's what I said by purging the data folder.

Regards
JB

On 08/11/2014 10:29 AM, Achim Nierbeck wrote:
> I think the main problem seems to be, the xml file was altered while
> karaf wasn't able to realize it's been altered.
> After the startup it still used the old one as there has already been a
> bundle generated for it.
> My best guess right now, this is due to the fact that
> karaf/FileInstaller wasn't "seeing" the change it wasn't able to
> "re-load" the change,
> make sure you alter it while Karaf is running then it will be able to
> get it faster.
>
> regards, Achim
>
>
> 2014-08-11 9:22 GMT+02:00 Jean-Baptiste Onofré <jb@nanthrax.net
> <ma...@nanthrax.net>>:
>
>     It depends of the blueprint: if the parameters are directly in the
>     blueprint (not in cm), ConfigAdmin is not used at all.
>
>     Regards
>     JB
>
>
>     On 08/11/2014 09:20 AM, Bram Pouwelse wrote:
>
>         I think the issue is that config admin stores the configuration
>         internally (that would be where karaf caches the connection
>         parameters)
>         and that the datasource is created before the xml file is
>         processed again.
>
>         Regards,
>         Bram
>
>
>         2014-08-11 9:09 GMT+02:00 Jean-Baptiste Onofré <jb@nanthrax.net
>         <ma...@nanthrax.net>
>         <mailto:jb@nanthrax.net <ma...@nanthrax.net>>>:
>
>
>              Can you cleanup the data folder ?
>
>              Regards
>              JB
>
>
>              On 08/11/2014 07:27 AM, vinuraj.maroli@wipro.com
>         <ma...@wipro.com>
>              <mailto:vinuraj.maroli@wipro.__com
>         <ma...@wipro.com>> wrote:
>
>                  I have an application that uses a postgresql database.
>         I am using
>                  PGSimpleDataSource configured using a data source xml
>         placed in
>                  $KARAF_HOME/deploy directory. Noticed an issue when the
>         database xml
>                  file is modified.
>
>                  When I shutdown karaf, modify the data source XML to
>         point to a
>                  different database and start karaf, it is still taking
>         the old
>                  database
>                  connection parameters. If I restart again it connecting
>         to the
>                  database
>                  that is configured in XML file. Is Karaf caching connection
>                  parameters ?
>
>                  regards
>
>                  Vinu
>
>                  The information contained in this electronic message
>         and any
>                  attachments
>                  to this message are intended for the exclusive use of the
>                  addressee(s)
>                  and may contain proprietary, confidential or privileged
>                  information. If
>                  you are not the intended recipient, you should not
>         disseminate,
>                  distribute or copy this e-mail. Please notify the sender
>                  immediately and
>                  destroy all copies of this message and any attachments.
>
>                  WARNING: Computer viruses can be transmitted via email. The
>                  recipient
>                  should check this email and any attachments for the
>         presence of
>                  viruses.
>                  The company accepts no liability for any damage caused
>         by any virus
>                  transmitted by this email.
>
>         www.wipro.com <http://www.wipro.com> <http://www.wipro.com>
>
>
>              --
>              Jean-Baptiste Onofré
>         jbonofre@apache.org <ma...@apache.org>
>         <mailto:jbonofre@apache.org <ma...@apache.org>>
>
>         http://blog.nanthrax.net
>              Talend - http://www.talend.com
>
>
>
>     --
>     Jean-Baptiste Onofré
>     jbonofre@apache.org <ma...@apache.org>
>     http://blog.nanthrax.net
>     Talend - http://www.talend.com
>
>
>
>
> --
>
> Apache Member
> Apache Karaf <http://karaf.apache.org/> Committer & PMC
> OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer
> & Project Lead
> blog <http://notizblog.nierbeck.de/>
>
> Software Architect / Project Manager / Scrum Master
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Data source xml change not taking effect in first karaf start post modification

Posted by Achim Nierbeck <bc...@googlemail.com>.
I think the main problem seems to be, the xml file was altered while karaf
wasn't able to realize it's been altered.
After the startup it still used the old one as there has already been a
bundle generated for it.
My best guess right now, this is due to the fact that karaf/FileInstaller
wasn't "seeing" the change it wasn't able to "re-load" the change,
make sure you alter it while Karaf is running then it will be able to get
it faster.

regards, Achim


2014-08-11 9:22 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:

> It depends of the blueprint: if the parameters are directly in the
> blueprint (not in cm), ConfigAdmin is not used at all.
>
> Regards
> JB
>
>
> On 08/11/2014 09:20 AM, Bram Pouwelse wrote:
>
>> I think the issue is that config admin stores the configuration
>> internally (that would be where karaf caches the connection parameters)
>> and that the datasource is created before the xml file is processed again.
>>
>> Regards,
>> Bram
>>
>>
>> 2014-08-11 9:09 GMT+02:00 Jean-Baptiste Onofré <jb@nanthrax.net
>> <ma...@nanthrax.net>>:
>>
>>
>>     Can you cleanup the data folder ?
>>
>>     Regards
>>     JB
>>
>>
>>     On 08/11/2014 07:27 AM, vinuraj.maroli@wipro.com
>>     <ma...@wipro.com> wrote:
>>
>>         I have an application that uses a postgresql database. I am using
>>         PGSimpleDataSource configured using a data source xml placed in
>>         $KARAF_HOME/deploy directory. Noticed an issue when the database
>> xml
>>         file is modified.
>>
>>         When I shutdown karaf, modify the data source XML to point to a
>>         different database and start karaf, it is still taking the old
>>         database
>>         connection parameters. If I restart again it connecting to the
>>         database
>>         that is configured in XML file. Is Karaf caching connection
>>         parameters ?
>>
>>         regards
>>
>>         Vinu
>>
>>         The information contained in this electronic message and any
>>         attachments
>>         to this message are intended for the exclusive use of the
>>         addressee(s)
>>         and may contain proprietary, confidential or privileged
>>         information. If
>>         you are not the intended recipient, you should not disseminate,
>>         distribute or copy this e-mail. Please notify the sender
>>         immediately and
>>         destroy all copies of this message and any attachments.
>>
>>         WARNING: Computer viruses can be transmitted via email. The
>>         recipient
>>         should check this email and any attachments for the presence of
>>         viruses.
>>         The company accepts no liability for any damage caused by any
>> virus
>>         transmitted by this email.
>>
>>         www.wipro.com <http://www.wipro.com>
>>
>>
>>     --
>>     Jean-Baptiste Onofré
>>     jbonofre@apache.org <ma...@apache.org>
>>
>>     http://blog.nanthrax.net
>>     Talend - http://www.talend.com
>>
>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>



-- 

Apache Member
Apache Karaf <http://karaf.apache.org/> Committer & PMC
OPS4J Pax Web <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
Project Lead
blog <http://notizblog.nierbeck.de/>

Software Architect / Project Manager / Scrum Master

Re: Data source xml change not taking effect in first karaf start post modification

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
It depends of the blueprint: if the parameters are directly in the 
blueprint (not in cm), ConfigAdmin is not used at all.

Regards
JB

On 08/11/2014 09:20 AM, Bram Pouwelse wrote:
> I think the issue is that config admin stores the configuration
> internally (that would be where karaf caches the connection parameters)
> and that the datasource is created before the xml file is processed again.
>
> Regards,
> Bram
>
>
> 2014-08-11 9:09 GMT+02:00 Jean-Baptiste Onofré <jb@nanthrax.net
> <ma...@nanthrax.net>>:
>
>     Can you cleanup the data folder ?
>
>     Regards
>     JB
>
>
>     On 08/11/2014 07:27 AM, vinuraj.maroli@wipro.com
>     <ma...@wipro.com> wrote:
>
>         I have an application that uses a postgresql database. I am using
>         PGSimpleDataSource configured using a data source xml placed in
>         $KARAF_HOME/deploy directory. Noticed an issue when the database xml
>         file is modified.
>
>         When I shutdown karaf, modify the data source XML to point to a
>         different database and start karaf, it is still taking the old
>         database
>         connection parameters. If I restart again it connecting to the
>         database
>         that is configured in XML file. Is Karaf caching connection
>         parameters ?
>
>         regards
>
>         Vinu
>
>         The information contained in this electronic message and any
>         attachments
>         to this message are intended for the exclusive use of the
>         addressee(s)
>         and may contain proprietary, confidential or privileged
>         information. If
>         you are not the intended recipient, you should not disseminate,
>         distribute or copy this e-mail. Please notify the sender
>         immediately and
>         destroy all copies of this message and any attachments.
>
>         WARNING: Computer viruses can be transmitted via email. The
>         recipient
>         should check this email and any attachments for the presence of
>         viruses.
>         The company accepts no liability for any damage caused by any virus
>         transmitted by this email.
>
>         www.wipro.com <http://www.wipro.com>
>
>
>     --
>     Jean-Baptiste Onofré
>     jbonofre@apache.org <ma...@apache.org>
>     http://blog.nanthrax.net
>     Talend - http://www.talend.com
>
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com

Re: Data source xml change not taking effect in first karaf start post modification

Posted by Bram Pouwelse <br...@pouwelse.com>.
I think the issue is that config admin stores the configuration internally
(that would be where karaf caches the connection parameters) and that the
datasource is created before the xml file is processed again.

Regards,
Bram


2014-08-11 9:09 GMT+02:00 Jean-Baptiste Onofré <jb...@nanthrax.net>:

> Can you cleanup the data folder ?
>
> Regards
> JB
>
>
> On 08/11/2014 07:27 AM, vinuraj.maroli@wipro.com wrote:
>
>> I have an application that uses a postgresql database. I am using
>> PGSimpleDataSource configured using a data source xml placed in
>> $KARAF_HOME/deploy directory. Noticed an issue when the database xml
>> file is modified.
>>
>> When I shutdown karaf, modify the data source XML to point to a
>> different database and start karaf, it is still taking the old database
>> connection parameters. If I restart again it connecting to the database
>> that is configured in XML file. Is Karaf caching connection parameters ?
>>
>> regards
>>
>> Vinu
>>
>> The information contained in this electronic message and any attachments
>> to this message are intended for the exclusive use of the addressee(s)
>> and may contain proprietary, confidential or privileged information. If
>> you are not the intended recipient, you should not disseminate,
>> distribute or copy this e-mail. Please notify the sender immediately and
>> destroy all copies of this message and any attachments.
>>
>> WARNING: Computer viruses can be transmitted via email. The recipient
>> should check this email and any attachments for the presence of viruses.
>> The company accepts no liability for any damage caused by any virus
>> transmitted by this email.
>>
>> www.wipro.com
>>
>>
> --
> Jean-Baptiste Onofré
> jbonofre@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com
>

Re: Data source xml change not taking effect in first karaf start post modification

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Can you cleanup the data folder ?

Regards
JB

On 08/11/2014 07:27 AM, vinuraj.maroli@wipro.com wrote:
> I have an application that uses a postgresql database. I am using
> PGSimpleDataSource configured using a data source xml placed in
> $KARAF_HOME/deploy directory. Noticed an issue when the database xml
> file is modified.
>
> When I shutdown karaf, modify the data source XML to point to a
> different database and start karaf, it is still taking the old database
> connection parameters. If I restart again it connecting to the database
> that is configured in XML file. Is Karaf caching connection parameters ?
>
> regards
>
> Vinu
>
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s)
> and may contain proprietary, confidential or privileged information. If
> you are not the intended recipient, you should not disseminate,
> distribute or copy this e-mail. Please notify the sender immediately and
> destroy all copies of this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses.
> The company accepts no liability for any damage caused by any virus
> transmitted by this email.
>
> www.wipro.com
>

-- 
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com