Hi JB - each datasource has a separate name
Name | Product | Version | URL
| Status
---------------------------------------------------------------------------------------------------------
jdbc/wpmsuiteNonCache, 1148 | MySQL | 5.6.21 |
jdbc:mysql://server:3306/wpmsuiteNonCache | OK
jdbc/wpmsuiteNonCache, 1150 | MySQL | 5.6.21 |
jdbc:mysql://server:3306/wpmsuiteNonCache | OK
jdbc/dart, 1161 | MySQL | 5.6.21 | jdbc:mysql://test:3306/dart
| OK
jdbc/dart, 1163 | MySQL | 5.6.21 | jdbc:mysql://test:3306/dart
| OK
karaf generated blueprints are attached
Kind regards,
Jason
-----Original Message-----
From: Jean-Baptiste Onofré [mailto:[email protected]]
Sent: Friday, June 19, 2015 9:07 AM
To: [email protected]
Subject: Re: jdbc datasource being created twice
Hi Jason,
the two datasources have the same name ?
Can you share your blueprint XML ?
Regards
JB
On 06/19/2015 06:04 PM, Pratt, Jason wrote:
> Hello - I am running into a situation where I have defined 2 jdbc
> datasource via the CLI and they are created properly along with the
> xml file in the /deploy directory. However, when I run
> jdbc:datasources each connection is listed twice (2x) and it is
> causing problems with jpa and camel.
>
> What have I done wrong and how can I correct this?
>
> Kind regards,
>
> Jason
>
--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version
2.0 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 Unless required by
applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for
the specific language governing permissions and limitations under the
License.
-->
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<bean id="dataSource" class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource">
<property name="url" value="jdbc:mysql://test:3306/dart"/>
<property name="user" value="user"/>
<property name="password" value="pass"/>
</bean>
<service interface="javax.sql.DataSource" ref="dataSource">
<service-properties>
<entry key="osgi.jndi.service.name" value="jdbc/dart"/>
</service-properties>
</service>
</blueprint>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version
2.0 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0 Unless required by
applicable law or agreed to in writing, software distributed under the
License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for
the specific language governing permissions and limitations under the
License.
-->
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0">
<bean id="dataSource" class="com.mysql.jdbc.jdbc2.optional.MysqlDataSource">
<property name="url" value="jdbc:mysql://server:3306/wpmsuiteNonCache"/>
<property name="user" value="user"/>
<property name="password" value="pass"/>
</bean>
<service interface="javax.sql.DataSource" ref="dataSource">
<service-properties>
<entry key="osgi.jndi.service.name" value="jdbc/wpmsuiteNonCache"/>
</service-properties>
</service>
</blueprint>