Hello again,

Problem is solved. The solution was to use the commons-dbcp bundle of
servicemix instead of the original one. This have to be done because the
original one doesn't have DynamicImport set, but this have to be set
because the jdbc driver has to be loaded dynamically.

Kind regards,
Felix

On 2011-06-08 17:47, Felix Mayerhuber wrote:
> Hello everyone!
>
> The whole interaction between this technologies works perfectly but now
> I have encountered a problem that I simply don't understand:
> I have two bundles: Bundle A defines a datasource and exports it like in
> the blog example. Bundle B uses this datasource as jta-data-source.
> Corresponding code blocks look like this:
>
> --- JPA DATASOURCE XML ---
>
> <bean id="dataSource" class="org.h2.jdbcx.JdbcDataSource">
> <property name="URL" value="jdbc:h2:EDB"/>
> </bean>
>
> <bean id="xdataSource" class="org.apache.commons.dbcp.BasicDataSource"
> destroy-method="close" init-method="createDataSource">
> <property name="driverClassName" value="org.h2.jdbcx.JdbcDataSource" />
> <property name="url" value="jdbc:h2:EDB" />
> <property name="username" value="" />
> <property name="password" value="" />
> </bean>
>
> <service id="xaDataSource" ref="xdataSource"
> interface="javax.sql.DataSource">
> <service-properties>
> <entry key="osgi.jndi.service.name" value="jdbc/openengsb"/>
> </service-properties>
> </service>
>
> --- END JPA DATASOURCE XML ---
>
> --- EDB PERSISTENCE XML ---
>
> <jta-data-source>osgi:service/javax.sql.DataSource/(osgi.jndi.service.name=jdbc/openengsb)</jta-data-source>
>
> --- END EDB PERSISTENCE XML ---
>
> If I now use the dataSource in the xaDataSource service everything works
> like a charm, but if I want to use the xdataSource suddenly the
> exception that I sent as attachment is thrown and I have no idea why
> this is happening.
>
> Does someone have an idea?
>
> Kind regards
> Felix
>
>

Reply via email to