Migrate from Karaf 3 to 4, Part 2
Geschrieben 2018. Versionen und Details können veraltet sein.
Migrating from karaf 3 to 4 another funny thing happened. All my jdbc datasources, configured in the deploy folder, were gone. In the first moment I was very hysterical because we wanted to migrate the productive environment the next days. But in the next moment I recognized that we did all the test cases without an impact.
Playing around and in the end a deeper look into karaf sources showed me the solution. The new commands provided by karaf are using a more complex query and filter to find jdbc datasources. The new command jdbc:ds-list needs a property 'dataSourceName' to be defined on the service to show the datasource in the list. The datasource itself was present like before but not shown.
First I reimplemented the old command jdbc:datasources and showed all the datasources present as they are, by implemented interface (mhus-osgi-tools). Then I changed all the blueprint xml files and appended the required property
<entry key="dataSourceName" value="${name}"/>
to be compatible with the new jdbc commands of karaf.
Playing around and in the end a deeper look into karaf sources showed me the solution. The new commands provided by karaf are using a more complex query and filter to find jdbc datasources. The new command jdbc:ds-list needs a property 'dataSourceName' to be defined on the service to show the datasource in the list. The datasource itself was present like before but not shown.
First I reimplemented the old command jdbc:datasources and showed all the datasources present as they are, by implemented interface (mhus-osgi-tools). Then I changed all the blueprint xml files and appended the required property
<entry key="dataSourceName" value="${name}"/>
to be compatible with the new jdbc commands of karaf.