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

Reply via email to