Oops .. my bad. When I used jdbc:ds-factories it worked.
You should also do "feature:install transaction" to get a xa ready
DataSourceFactory.
Christian
On 23.09.2015 10:01, Christian Schneider wrote:
The model to create datasources has changed in karaf 4.
We now use pax-jdbc to setup the DataSource.
Unfortunately I found a problem in the jdbc commands when testing the
below steps.
The jdbc:ds-list command did not work for me. I will look into it.
Try the steps below. It should be possible to create a DataSource from
config even without the commands.
1. Install your wrapped oracle driver
2. Install pax-jdbc and the karaf jdbc commands
feature:repo-add pax-jdbc 0.7.0
feature:install jdbc pax-jdbc-config pax-jdbc-pool-dbcp2 pax-jdbc-oracle
3. Check that a DataSourceFactory exists
service:list DataSourceFactory
This should show you Oracle DSF.
3. Install the data source config
Normally you should be able to do this using the jdbc commands.
As they just create a config in etc you can also follow the docs below.
https://ops4j1.jira.com/wiki/display/PAXJDBC/Create+DataSource+from+config
https://ops4j1.jira.com/wiki/display/PAXJDBC/Pooling+and+XA+support+for+DataSourceFactory
On 23.09.2015 04:50, xlogger wrote:
I was trying to follow the instruction from this blog to create a
datasource-oracle.xml file and put into deploy folder
http://www.sachinhandiekar.com/2013/08/oracle-datasource-in-fuse-esb-apache.html
when I use "bundle:list" I can see the datasource-oracle.xml bundle
installed
136 | Active | 80 | 0 | wrap_mvn_com.oracle_ojdbc6_11.2.0
140 | Active | 80 | 0.0.0 | datasource-oracle.xml
Then I tried to "feature:install jdbc" and then "jdbc:ds-list", there
is no
datasource found in the list.
Is there any config I've missed to make the datasource recognizable
by the
jdbc feature?
Also, I tried to check the karaf jdbc documentation but seems the
commands
are different from what I have... e.g. I have jdbc:ds-list and
jdbc:ds-create commands, but the documentation is showing
jdbc:datasources
and jdbc:create, the options for those commands are different from
what I
have too... wondering if I have installed a wrong jdbc feature...
http://karaf.apache.org/manual/latest/users-guide/jdbc.html
karaf@root()> feature:list |grep jdbc
jdbc | 4.0.1 | x |
Started | enterprise-4.0.1 | JDBC service and
commands
karaf@root()> jdbc --help
SUBSHELL
jdbc
COMMANDS
jdbc:ds-create Create a JDBC datasource config for
pax-jdbc-config
from a DataSourceFactory
jdbc:ds-delete Delete a JDBC datasource
jdbc:ds-factories List the JDBC DataSourceFactories
jdbc:ds-info Display details about a JDBC datasource
jdbc:ds-list List the JDBC datasources
jdbc:execute Execute a SQL command on a given JDBC datasource
jdbc:query Execute a SQL query on a JDBC datasource
jdbc:tables List the tables on a given JDBC datasource
--
View this message in context:
http://karaf.922171.n3.nabble.com/Karaf-4-0-1-create-Pooled-Oracle-datasource-tp4042724.html
Sent from the Karaf - User mailing list archive at Nabble.com.
--
Christian Schneider
http://www.liquid-reality.de
Open Source Architect
http://www.talend.com