You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Manfred Dohmen <ma...@gmail.com> on 2016/03/23 10:14:55 UTC

Deploy datasource config with feature.xml

Hello,

I'm trying to deploy a datasource configuration file with a feature 
defined in a feature.xml like this:

    <feature name="xxx" version="1.0.0-SNAPSHOT">
        <details>xxx</details>
        <config name="org.ops4j.datasource-myds">
            osgi.jdbc.driver.name=oracle-pool-xa
            url=jdbc:oracle:thin:@192.168.1.2:1521:orcl
            user=test
            password=test
            dataSourceName=test
        </config>
    </feature>

When I issue a feature:install in the shell, the feature gets installed 
and a config file "etc/org.ops4j.datasource.cfg" is created, note the 
missing instance suffix "myds". In effect the DS is not active.

KARAF-4124 looks like others are trying to use the same method.

Any advise? Thanks.



Re: Deploy datasource config with feature.xml

Posted by ellirael <el...@mail.ru>.
Could it be related somehow to:
http://karaf.922171.n3.nabble.com/Factory-config-in-feature-xml-td4045530.html



--
View this message in context: http://karaf.922171.n3.nabble.com/Deploy-datasource-config-with-feature-xml-tp4045941p4046177.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Deploy datasource config with feature.xml

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Yes, I assigned to me.

Thanks !
Regards
JB

On 03/23/2016 05:49 PM, mdo wrote:
> https://issues.apache.org/jira/browse/KARAF-4441
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Deploy-datasource-config-with-feature-xml-tp4045941p4045953.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

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

Re: Deploy datasource config with feature.xml

Posted by mdo <ma...@gmail.com>.
https://issues.apache.org/jira/browse/KARAF-4441



--
View this message in context: http://karaf.922171.n3.nabble.com/Deploy-datasource-config-with-feature-xml-tp4045941p4045953.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Deploy datasource config with feature.xml

Posted by mdo <ma...@gmail.com>.
OK, thanks. I'll log that into JIRA.




--
View this message in context: http://karaf.922171.n3.nabble.com/Deploy-datasource-config-with-feature-xml-tp4045941p4045951.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Deploy datasource config with feature.xml

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
OK, my bad,

Can you create a Jira about that ?

The workaround is to use <configfile/> instead of <config/> (or 
provision the cfg file).

Sorry about that. It will be fixed for 4.0.5.

Regards
JB

On 03/23/2016 05:20 PM, mdo wrote:
> config:list shows:
>
> ----------------------------------------------------------------
> Pid:            org.ops4j.datasource
> BundleLocation: null
> Properties:
>     dataSourceName = test
>     felix.fileinstall.filename =
> file:/tmp/apache-karaf-4.0.4/etc/org.ops4j.datasource.cfg
>     osgi.jdbc.driver.name = oracle-pool-xa
>     password = test
>     service.pid = org.ops4j.datasource
>     url = jdbc:oracle:thin:@192.168.1.2:1521:orcl
>     user = test
> ----------------------------------------------------------------
> Pid:            org.ops4j.datasource.c04fc6b7-7b4f-49f7-9181-334487539adc
> FactoryPid:     org.ops4j.datasource
> BundleLocation: null
> Properties:
>     dataSourceName = test
>     org.apache.karaf.features.configKey = org.ops4j.datasource-myds
>     osgi.jdbc.driver.name = oracle-pool-xa
>     password = test
>     service.factoryPid = org.ops4j.datasource
>     service.pid = org.ops4j.datasource.c04fc6b7-7b4f-49f7-9181-334487539adc
>     url = jdbc:oracle:thin:@192.168.1.2:1521:orcl
>     user = test
> ----------------------------------------------------------------
>
>
> The values are in the config file:
>
> mdo:/tmp/apache-karaf-4.0.4$ cat etc/org.ops4j.datasource.cfg
> user = test
> password = test
> url = jdbc:oracle:thin:@192.168.1.2:1521:orcl
> dataSourceName = test
> osgi.jdbc.driver.name = oracle-pool-xa
>
>
>
>
> Regards,
> mdo
>
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Deploy-datasource-config-with-feature-xml-tp4045941p4045948.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

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

Re: Deploy datasource config with feature.xml

Posted by mdo <ma...@gmail.com>.
config:list shows:

----------------------------------------------------------------
Pid:            org.ops4j.datasource
BundleLocation: null
Properties:
   dataSourceName = test
   felix.fileinstall.filename =
file:/tmp/apache-karaf-4.0.4/etc/org.ops4j.datasource.cfg
   osgi.jdbc.driver.name = oracle-pool-xa
   password = test
   service.pid = org.ops4j.datasource
   url = jdbc:oracle:thin:@192.168.1.2:1521:orcl
   user = test
----------------------------------------------------------------
Pid:            org.ops4j.datasource.c04fc6b7-7b4f-49f7-9181-334487539adc
FactoryPid:     org.ops4j.datasource
BundleLocation: null
Properties:
   dataSourceName = test
   org.apache.karaf.features.configKey = org.ops4j.datasource-myds
   osgi.jdbc.driver.name = oracle-pool-xa
   password = test
   service.factoryPid = org.ops4j.datasource
   service.pid = org.ops4j.datasource.c04fc6b7-7b4f-49f7-9181-334487539adc
   url = jdbc:oracle:thin:@192.168.1.2:1521:orcl
   user = test
----------------------------------------------------------------


The values are in the config file:

mdo:/tmp/apache-karaf-4.0.4$ cat etc/org.ops4j.datasource.cfg 
user = test
password = test
url = jdbc:oracle:thin:@192.168.1.2:1521:orcl
dataSourceName = test
osgi.jdbc.driver.name = oracle-pool-xa




Regards,
mdo






--
View this message in context: http://karaf.922171.n3.nabble.com/Deploy-datasource-config-with-feature-xml-tp4045941p4045948.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Deploy datasource config with feature.xml

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

it sounds like an issue to deal with config factory (as the format is 
xx-xx).

However, don't you have the config in ConfigAdmin (using config:list 
should be able to see it).

Does org.ops4j.datasource.cfg contain your keys/values ?

Regards
JB

On 03/23/2016 04:44 PM, mdo wrote:
> jbonofre wrote
>> what's your Karaf version ?
>>
>> Depending of the Karaf version, the cfg file is not created, you have to
>> check with config:list.
>
> I'm using 4.0.4.
>
> This is the log output when installing the feature:
>
>
> 2016-03-23 16:41:48,274 | INFO  | nsole user karaf | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.0.4 | Adding features:
> xxx/[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]
> 2016-03-23 16:41:48,366 | INFO  | pool-41-thread-1 | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.0.4 | No deployment change.
> 2016-03-23 16:41:48,372 | INFO  | pool-41-thread-1 | FeaturesServiceImpl
> | 9 - org.apache.karaf.features.core - 4.0.4 | Done.
> 2016-03-23 16:41:49,430 | INFO  | -karaf-4.0.4/etc | fileinstall
> | 8 - org.apache.felix.fileinstall - 3.5.0 | Creating configuration from
> org.ops4j.datasource.cfg
>
>
>
> I then have a "org.ops4j.datasource.cfg" but I think there should instead be
> a file named "org.ops4j.datasource-myds.cfg".
>
>
> Regards,
> mdo
>
>
>
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Deploy-datasource-config-with-feature-xml-tp4045941p4045945.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>

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

Re: Deploy datasource config with feature.xml

Posted by mdo <ma...@gmail.com>.
jbonofre wrote
> what's your Karaf version ?
> 
> Depending of the Karaf version, the cfg file is not created, you have to 
> check with config:list.

I'm using 4.0.4.

This is the log output when installing the feature:


2016-03-23 16:41:48,274 | INFO  | nsole user karaf | FeaturesServiceImpl             
| 9 - org.apache.karaf.features.core - 4.0.4 | Adding features:
xxx/[1.0.0.SNAPSHOT,1.0.0.SNAPSHOT]
2016-03-23 16:41:48,366 | INFO  | pool-41-thread-1 | FeaturesServiceImpl             
| 9 - org.apache.karaf.features.core - 4.0.4 | No deployment change.
2016-03-23 16:41:48,372 | INFO  | pool-41-thread-1 | FeaturesServiceImpl             
| 9 - org.apache.karaf.features.core - 4.0.4 | Done.
2016-03-23 16:41:49,430 | INFO  | -karaf-4.0.4/etc | fileinstall                     
| 8 - org.apache.felix.fileinstall - 3.5.0 | Creating configuration from
org.ops4j.datasource.cfg



I then have a "org.ops4j.datasource.cfg" but I think there should instead be
a file named "org.ops4j.datasource-myds.cfg".


Regards,
mdo






--
View this message in context: http://karaf.922171.n3.nabble.com/Deploy-datasource-config-with-feature-xml-tp4045941p4045945.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Deploy datasource config with feature.xml

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

what's your Karaf version ?

Depending of the Karaf version, the cfg file is not created, you have to 
check with config:list.

Regards
JB

On 03/23/2016 10:14 AM, Manfred Dohmen wrote:
> Hello,
>
> I'm trying to deploy a datasource configuration file with a feature
> defined in a feature.xml like this:
>
>      <feature name="xxx" version="1.0.0-SNAPSHOT">
>          <details>xxx</details>
>          <config name="org.ops4j.datasource-myds">
>              osgi.jdbc.driver.name=oracle-pool-xa
>              url=jdbc:oracle:thin:@192.168.1.2:1521:orcl
>              user=test
>              password=test
>              dataSourceName=test
>          </config>
>      </feature>
>
> When I issue a feature:install in the shell, the feature gets installed
> and a config file "etc/org.ops4j.datasource.cfg" is created, note the
> missing instance suffix "myds". In effect the DS is not active.
>
> KARAF-4124 looks like others are trying to use the same method.
>
> Any advise? Thanks.
>
>

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