<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: updating config file from bundle in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/updating-config-file-from-bundle/m-p/2303678#M75529</link>
    <description>I do not get any error trace. There is a non null configadmin reference and when i try to get configadmin service from its reference the bundle restarts.</description>
    <pubDate>Fri, 30 Aug 2013 12:06:15 GMT</pubDate>
    <dc:creator>_AnonymousUser</dc:creator>
    <dc:date>2013-08-30T12:06:15Z</dc:date>
    <item>
      <title>updating config file from bundle</title>
      <link>https://community.qlik.com/t5/Talend-Studio/updating-config-file-from-bundle/m-p/2303674#M75525</link>
      <description>I'm trying to update a cfg file using config admin from one bundle and listen to that config file from other bundle. When I deploy code I get java.lang.ClassNotFoundException: org.osgi.service.cm.ManagedService. Pleasse point to any Talend example where a config file is programmatically updated. 
&lt;BR /&gt;Thanks, 
&lt;BR /&gt;tBeginner</description>
      <pubDate>Sat, 16 Nov 2024 11:55:27 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/updating-config-file-from-bundle/m-p/2303674#M75525</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2024-11-16T11:55:27Z</dc:date>
    </item>
    <item>
      <title>Re: updating config file from bundle</title>
      <link>https://community.qlik.com/t5/Talend-Studio/updating-config-file-from-bundle/m-p/2303675#M75526</link>
      <description>My karaf tutorial about config admin service might help you. See:
&lt;BR /&gt;
&lt;A href="http://liquid-reality.de/display/liquid/2011/09/23/Karaf+Tutorial+Part+2+-+Using+the+Configuration+Admin+Service" rel="nofollow noopener noreferrer"&gt;http://liquid-reality.de/display/liquid/2011/09/23/Karaf+Tutorial+Part+2+-+Using+the+Configuration+Admin+Service&lt;/A&gt;
&lt;BR /&gt;The ClassNotFoundException means that you need to import the package "org.osgi.service.cm" in your Manifest. The simplest way to do this is to use the maven bundle plugin like shown in the examples.
&lt;BR /&gt;Unfortunately I do not have an example about changing the config. It is quite simple though. You get the config admin service using a blueprint service reference. Then with the config admin service you retrieve the configuration by pid and set new properties. There is an example at the felix website:
&lt;BR /&gt;
&lt;A href="http://felix.apache.org/documentation/subprojects/apache-felix-config-admin.html" rel="nofollow noopener noreferrer"&gt;http://felix.apache.org/documentation/subprojects/apache-felix-config-admin.html&lt;/A&gt;
&lt;BR /&gt;
&lt;BR /&gt;Christian</description>
      <pubDate>Wed, 28 Aug 2013 15:10:49 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/updating-config-file-from-bundle/m-p/2303675#M75526</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-28T15:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: updating config file from bundle</title>
      <link>https://community.qlik.com/t5/Talend-Studio/updating-config-file-from-bundle/m-p/2303676#M75527</link>
      <description>Hi Christian 
&lt;BR /&gt;Problem with felix example is it goes into infinite loop when I deploy. The following sample code prints on console "ConfigAdminRef {org.osgi.service.cm.ConfigurationAdmin}={service.vendor=Apache Software Foundation, service.pid=org.apache.felix.cm.ConfigurationAdmin, service.description=Configuration Admin Service Specification 1.2 Implementation, service.id=33}" 
&lt;BR /&gt;public void start(BundleContext bc) 
&lt;BR /&gt; throws Exception { 
&lt;BR /&gt; 
&lt;BR /&gt; ServiceReference configurationAdminReference = bc.getServiceReference("org.osgi.service.cm.ConfigurationAdmin"); 
&lt;BR /&gt; System.out.println("ConfigAdminRef "+ configurationAdminReference); 
&lt;BR /&gt; ConfigurationAdmin confAdmin = (ConfigurationAdmin) bc.getService(configurationAdminReference); 
&lt;BR /&gt; Configuration config = confAdmin.getConfiguration("demo.service.internal.MyConfigurator"); 
&lt;BR /&gt; 
&lt;BR /&gt; Dictionary props = config.getProperties(); 
&lt;BR /&gt; // if null, the configuration is new 
&lt;BR /&gt; if (props == null) { 
&lt;BR /&gt; props = new Hashtable(); 
&lt;BR /&gt; } 
&lt;BR /&gt; // set some properties 
&lt;BR /&gt; props.put("port","1234"); 
&lt;BR /&gt; // update the configuration 
&lt;BR /&gt; config.update(props); 
&lt;BR /&gt; }</description>
      <pubDate>Fri, 30 Aug 2013 10:55:14 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/updating-config-file-from-bundle/m-p/2303676#M75527</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2013-08-30T10:55:14Z</dc:date>
    </item>
    <item>
      <title>Re: updating config file from bundle</title>
      <link>https://community.qlik.com/t5/Talend-Studio/updating-config-file-from-bundle/m-p/2303677#M75528</link>
      <description>Often in these cases an exception happens in the start method and OSGi swallows this exception. So you may try to surround the whole start method with a try catch and print the exception so you see if this is the case.</description>
      <pubDate>Fri, 30 Aug 2013 11:28:38 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/updating-config-file-from-bundle/m-p/2303677#M75528</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-30T11:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: updating config file from bundle</title>
      <link>https://community.qlik.com/t5/Talend-Studio/updating-config-file-from-bundle/m-p/2303678#M75529</link>
      <description>I do not get any error trace. There is a non null configadmin reference and when i try to get configadmin service from its reference the bundle restarts.</description>
      <pubDate>Fri, 30 Aug 2013 12:06:15 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/updating-config-file-from-bundle/m-p/2303678#M75529</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2013-08-30T12:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: updating config file from bundle</title>
      <link>https://community.qlik.com/t5/Talend-Studio/updating-config-file-from-bundle/m-p/2303679#M75530</link>
      <description>I'm using TESB_SE v5.3.1</description>
      <pubDate>Fri, 30 Aug 2013 12:11:22 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/updating-config-file-from-bundle/m-p/2303679#M75530</guid>
      <dc:creator>_AnonymousUser</dc:creator>
      <dc:date>2013-08-30T12:11:22Z</dc:date>
    </item>
  </channel>
</rss>

