Hi, 

Most likely you run into a well-known issue when use JDBC driver in OSGi 
container, that said, you try to pass a JDBC driver class name 
com.ibm.db2.jcc.DB2Driver to the c3p0 connection pool, but c3p0 bundle can't 
see class com.ibm.db2.jcc.DB2Driver as it doesn't import this package, you can 
take a look at [1] to get more details and find the solution there.
The only weird thing is that I can't see the ClassNotFoundException from the 
stacktrace you posted here, did you omit it or possibly the c3p0 swallow it?

[1]http://freemanfang.blogspot.com/2012/03/how-to-use-jdbc-driver-in-osgi.html
-------------
Freeman Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: http://weibo.com/u/1473905042

On 2012-10-10, at 上午9:30, srini wrote:

> Hi Freeman, 
> 
> I have added the classpath in xbeans.xml of SA zip and the earlier error
> seems to be resolved. Many thanks for the help. 
> 
> SA has started without any issues but I am getting one of the below
> exceptions when querying DB2 8.x database:
> 
> 1. Caused by: java.sql.SQLException:
> com.mchange.v2.c3p0.ComboPooledDataSource [
> java.beans.IntrospectionException:
> java.lang.reflect.InvocationTargetException
> [numThreadsAwaitingCheckoutDefaultUser] ] has been closed() -- you can no
> longer use it.
>       at
> com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.assertCpds(AbstractPoolBackedDataSource.java:447)[c3p0-0.9.1.2.jar:0.9.1.2]
>       at
> com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getPoolManager(AbstractPoolBackedDataSource.java:459)[c3p0-0.9.1.2.jar:0.9.1.2]
>       at
> com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:128)[c3p0-0.9.1.2.jar:0.9.1.2]
>       at
> org.springframework.jdbc.datasource.DataSourceTransactionManager.doBegin(DataSourceTransactionManager.java:200)[spring-2.5.6.jar:2.5.6]
> 
> Below is my datasource bean definition:
> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
> destroy-method="close" lazy-init="default" autowire="default"
> dependency-check="default">
>            <property name="driverClass" value="com.ibm.db2.jcc.DB2Driver"/>
>        <property name="jdbcUrl" value="jdbc:db2://server:port/DB"/>
>        <property name="user" value="username"/>
>        <property name="password" value="password"/>
>        <property name="initialPoolSize" value="2"/>
>        <property name="minPoolSize" value="5"/>
>        <property name="maxPoolSize" value="10"/>
>        <property name="acquireIncrement" value="1"/>
>        <property name="acquireRetryDelay" value="60000"/>
>        <property name="debugUnreturnedConnectionStackTraces" value="true"/>
>        <property name="maxIdleTime" value="30"/>
>        <property name="unreturnedConnectionTimeout" value="300000"/>
>        <property name="checkoutTimeout" value="300000"/>
>        <property name="idleConnectionTestPeriod" value="600000"/>
>       <property name="numThreadsAwaitingCheckoutDefaultUser" value="10"/>
>    </bean>
> 
> 2. 
> 21:24:41,112 | ERROR | rovider-thread-3 | DefaultComponent                 |
> 172 - servicemix-common - 2011.02.0 | Error processing exchange
> org.apache.servicemix.jbi.runtime.impl.InOnlyImpl@168cd47
> java.lang.Error: SQLWarning chain holds value that is not a SQLWarning
>       at java.sql.SQLWarning.getNextWarning(SQLWarning.java:184)[:1.6.0_34]
>       at
> org.springframework.jdbc.core.JdbcTemplate.handleWarnings(JdbcTemplate.java:1220)
>       at
> org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:592)
>       at 
> org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:641)
>       at 
> org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:670)
>       at 
> org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:678)
>       at
> org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:721)
>       at
> org.springframework.jdbc.core.JdbcTemplate.queryForObject(JdbcTemplate.java:732)
>       at
> org.springframework.jdbc.core.JdbcTemplate.queryForInt(JdbcTemplate.java:759)
> 
> I am getting different error when i delete the data folder and restart smx4.
> 
> I think it is not even getting the db connection. Could you please suggest?
> 
> 
> 
> --
> View this message in context: 
> http://servicemix.396122.n5.nabble.com/Failed-to-convert-property-value-to-required-type-org-aopalliance-aop-Advice-for-property-advice-tp5714672p5714685.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to