You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by ellirael <el...@mail.ru> on 2015/07/23 16:17:10 UTC

Karaf 4 jdbc commands changes and problems

Am I right that Karaf 4 jdbc feature requires now some external
DataSourceFactory libraries (unlike Karaf 3)?

I've installed these features:
jpa                 | 2.0.0            | x        | Started |
enterprise-4.0.0
openjpa             | 2.3.0            | x        | Started |
enterprise-4.0.0
jdbc                | 4.0.0            | x        | Started |
enterprise-4.0.0
pax-jdbc-config     | 0.6.0            | x        | Started |
org.ops4j.pax.jdbc-0.6.0
pax-jdbc-mysql      | 0.6.0            | x        | Started |
org.ops4j.pax.jdbc-0.6.0
pax-jdbc-pool-aries | 0.6.0            | x        | Started |
org.ops4j.pax.jdbc-0.6.0

Then I've created my MySQL datasource:
jdbc:ds-create -dn mysql-pool-xa -url jdbc:mysql://host/dbname -u root -p
admin dbname

ds-factories command output:
Name          | Class                         | Version
-------------------------------------------------------
mysql-pool-xa | com.mysql.jdbc.Driver-pool-xa |
mysql-pool    | com.mysql.jdbc.Driver-pool    |
mysql         | com.mysql.jdbc.Driver         |

Config file is created and it seems to be correct:
dataSourceName="dbname"
osgi.jdbc.driver.name="mysql-pool-xa"
password="admin"
service.factoryPid="org.ops4j.datasource"
service.pid="org.ops4j.datasource.094411fb-f8b6-4794-81d6-5077cc00643a"
url="jdbc:mysql://host/dbname"
user="root"

Then I see doubled datasource. And both of them miss password somehow...
ds-list command output:
Name   | Product | Version | URL | Status
-----------------------------------------------------------------------------------------------------
dbname |         |         |     | Error Access denied for user
''@'192.168.9.6' (using password: NO)
dbname |         |         |     | Error Access denied for user
''@'192.168.9.6' (using password: NO)

Am I right about jdbc commands changes? How to fix my problems with
datasources?



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-jdbc-commands-changes-and-problems-tp4041571.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 4 jdbc commands changes and problems

Posted by ellirael <el...@mail.ru>.
Tried to use dbcp2 instead of aries-pool. Dbcp2 works fine in my scenario.

ds-list command output:
Name   | Product | Version | URL                                   | Status
---------------------------------------------------------------------------
dbname | MySQL   | 5.1.36  | jdbc:mysql://host/dbname | OK




--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-jdbc-commands-changes-and-problems-tp4041571p4041572.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 4 jdbc commands changes and problems

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
By the way, can you check that pax-jdbc feature has been installed 
successfully ?

Regards
JB

On 07/23/2015 05:09 PM, ellirael wrote:
> JB, I didn't quite understand your answer.
> Am I right that I need external feature(s) to make jdbc commands work?
> What's wrong with aries pool and how to resolve my problem with lost
> password and DS doubling?
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-jdbc-commands-changes-and-problems-tp4041571p4041578.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: Karaf 4 jdbc commands changes and problems

Posted by ellirael <el...@mail.ru>.
JB, the info you asked is in my first message. Features installation went ok.



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-jdbc-commands-changes-and-problems-tp4041571p4041601.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 4 jdbc commands changes and problems

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

sorry if I wasn't clear.

The jdbc feature only installs the jdbc.core bundle (providing core JDBC 
service, commands and MBean).

Previously jdbc:create created a blueprint file for the datasource.
Now, jdbc:ds-create creates a ConfigAdmin config (org.ops4j.datasource*) 
relayed by pax-jdbc.

Can you provide the jdbc:ds-create command that you did and, if 
possible, the org.ops4j.datasource* configs ?

Thanks,
Regards
JB

On 07/23/2015 05:09 PM, ellirael wrote:
> JB, I didn't quite understand your answer.
> Am I right that I need external feature(s) to make jdbc commands work?
> What's wrong with aries pool and how to resolve my problem with lost
> password and DS doubling?
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-jdbc-commands-changes-and-problems-tp4041571p4041578.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: Karaf 4 jdbc commands changes and problems

Posted by ellirael <el...@mail.ru>.
JB, I didn't quite understand your answer.
Am I right that I need external feature(s) to make jdbc commands work?
What's wrong with aries pool and how to resolve my problem with lost
password and DS doubling?



--
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-jdbc-commands-changes-and-problems-tp4041571p4041578.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf 4 jdbc commands changes and problems

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
It's because they now use pax-jdbc wheras previously jdbc feature was 
"standalone".

Regards
JB

On 07/23/2015 04:17 PM, ellirael wrote:
> Am I right that Karaf 4 jdbc feature requires now some external
> DataSourceFactory libraries (unlike Karaf 3)?
>
> I've installed these features:
> jpa                 | 2.0.0            | x        | Started |
> enterprise-4.0.0
> openjpa             | 2.3.0            | x        | Started |
> enterprise-4.0.0
> jdbc                | 4.0.0            | x        | Started |
> enterprise-4.0.0
> pax-jdbc-config     | 0.6.0            | x        | Started |
> org.ops4j.pax.jdbc-0.6.0
> pax-jdbc-mysql      | 0.6.0            | x        | Started |
> org.ops4j.pax.jdbc-0.6.0
> pax-jdbc-pool-aries | 0.6.0            | x        | Started |
> org.ops4j.pax.jdbc-0.6.0
>
> Then I've created my MySQL datasource:
> jdbc:ds-create -dn mysql-pool-xa -url jdbc:mysql://host/dbname -u root -p
> admin dbname
>
> ds-factories command output:
> Name          | Class                         | Version
> -------------------------------------------------------
> mysql-pool-xa | com.mysql.jdbc.Driver-pool-xa |
> mysql-pool    | com.mysql.jdbc.Driver-pool    |
> mysql         | com.mysql.jdbc.Driver         |
>
> Config file is created and it seems to be correct:
> dataSourceName="dbname"
> osgi.jdbc.driver.name="mysql-pool-xa"
> password="admin"
> service.factoryPid="org.ops4j.datasource"
> service.pid="org.ops4j.datasource.094411fb-f8b6-4794-81d6-5077cc00643a"
> url="jdbc:mysql://host/dbname"
> user="root"
>
> Then I see doubled datasource. And both of them miss password somehow...
> ds-list command output:
> Name   | Product | Version | URL | Status
> -----------------------------------------------------------------------------------------------------
> dbname |         |         |     | Error Access denied for user
> ''@'192.168.9.6' (using password: NO)
> dbname |         |         |     | Error Access denied for user
> ''@'192.168.9.6' (using password: NO)
>
> Am I right about jdbc commands changes? How to fix my problems with
> datasources?
>
>
>
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-4-jdbc-commands-changes-and-problems-tp4041571.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