You showed how you get the DataSource from jndi but not how you created it.
Do you use a pax-jdbc config for this?

Christian

Am Mi., 16. Jan. 2019 um 14:44 Uhr schrieb fred <[email protected]>:

>
> You can create just one DataSource and expose it as an OSGi service. There
> are several ways to do that, like pax-jdbc.
>
> After that, you can just reference the dataSource at your bundle and
> connect
> to the OracleAQ.
>
> --
>
> I think that's what I tried to do, but it did not work:
> javax.sql.DataSource dataSource = (javax.sql.DataSource) ((new
> javax.naming.InitialContext()).lookup("osgi:service/jdbc/av-ds"));
> jmsConnectionFactory =
> oracle.jms.AQjmsFactory.getQueueConnectionFactory(dataSource);
>
> Errormessage when accessing JMS:
> Error creating the db_connection; nested exception is
> java.lang.ClassCastException:
> org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper cannot
> be cast to oracle.jdbc.internal.OracleConnection
>
> To me, it seems that by getting the datasource as an OSGi service, it is
> weirdly wrapped or proxied in a way that the Oracle QueueConnectionFactory
> cannot work with (and I don't know how to get around this).
>
>
>
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html
>


-- 
-- 
Christian Schneider
http://www.liquid-reality.de

Computer Scientist
http://www.adobe.com

Reply via email to