karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Schneider (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (KARAF-4124) feature config installer adds property to config
Date Fri, 27 Jan 2017 09:56:24 GMT

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

Christian Schneider commented on KARAF-4124:

We can fix this is pax jdbc but indeed it is not a good idea to add attributes to configs.
I know felix fileinstall does it too but it causes lots of problems.

In pax-jdbc the problem is that all configs are fed into DataSourceFactory.create calls. Most
factories directly throw an exception if any unknown key is encountered. I think this is even
defined in the spec. As these factories are out of our control we can not easily fix this.

> feature config installer adds property to config
> ------------------------------------------------
>                 Key: KARAF-4124
>                 URL: https://issues.apache.org/jira/browse/KARAF-4124
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-feature
>    Affects Versions: 4.0.3
>            Reporter: Markus Rathgeb
>            Assignee: Jean-Baptiste Onofré
>             Fix For: 4.1.0, 4.0.9
> The <config/> element in a feature XML allows a feature to create and/or populate
a configuration (identified by a configuration PID).
> The "FeatureConfigInstaller" adds a custom property to the configuration.
> key = "org.apache.karaf.features.configKey"
> value = result of function call "createConfigurationKey(pid[0], pid[1])"
> There are bundles that cannot handle additional properties in the configuration.
> For example:
> * using Aries JPA + Hiberante + h2
> * the configuration is installed by a feature and a realted config entry
> * this will result in a non working setup
> {noformat}
> Caused by: org.h2.jdbc.JdbcSQLException: Unsupported connection setting "ORG.APACHE.KARAF.FEATURES.CONFIGKEY"
>         at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
>         at org.h2.message.DbException.get(DbException.java:169)
>         at org.h2.message.DbException.get(DbException.java:146)
>         at org.h2.engine.ConnectionInfo.readSettingsFromURL(ConnectionInfo.java:266)
>         at org.h2.engine.ConnectionInfo.<init>(ConnectionInfo.java:77)
>         at org.h2.jdbc.JdbcConnection.<init>(JdbcConnection.java:90)
>         at org.h2.Driver.connect(Driver.java:73)
>         at org.h2.jdbcx.JdbcDataSource.getJdbcConnection(JdbcDataSource.java:187)
>         at org.h2.jdbcx.JdbcDataSource.getXAConnection(JdbcDataSource.java:323)
>         at org.apache.commons.dbcp2.managed.DataSourceXAConnectionFactory.createConnection(DataSourceXAConnectionFactory.java:112)
>         at org.apache.commons.dbcp2.managed.PoolableManagedConnectionFactory.makeObject(PoolableManagedConnectionFactory.java:66)
>         at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:868)
>         at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:435)
>         at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363)
>         at org.apache.commons.dbcp2.managed.ManagedConnection.updateTransactionStatus(ManagedConnection.java:127)
>         ... 132 more
> {noformat}
> There is a conditional branch in the "findExistingConfiguration" function to filter (find)
the configuration using that property instead of the service.pid (this is another conditional
> Is there any reason for using that property?
> I changed the "FeatureConfigInstaller" to not append that property and the above example
is working now.

This message was sent by Atlassian JIRA

View raw message