配置文件:<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
<property name="driverClass" value="oracle.jdbc.driver.OracleDriver"></property>
<property name="jdbcUrl" value="jdbc:oracle:thin:@192.168.1.53:1521:ORCL"></property>
<property name="user" value="webtrack"></property>
<property name="password" value="webtrack"></property>
<!-- 这段注释掉的内容不管有或没有,都会出现下面的异常。
<property name="maxPoolSize" value="40"></property>
<property name="minPoolSize" value="3"></property>
<property name="initialPoolSize" value="3"></property>
<property name="acquireIncrement" value="3"></property>
<property name="maxIdleTime" value="20"></property>
<property name="maxStatements" value="40"></property>
<property name="idleConnectionTestPeriod" value="3"></property>
 -->
</bean>
完整的debug堆栈信息:
BasicResourcePool - com.mchange.v2.resourcepool.BasicResourcePool@114a947 config: [start -> 3; min -
> 3; max -> 15; inc -> 3; num_acq_attempts -> 30; acq_attempt_delay -> 1000; check_idle_resources_de
lay -> 0; mox_resource_age -> 0; max_idle_time -> 0; excess_max_idle_time -> 0; destroy_unreturned_r
esc_time -> 0; expiration_enforcement_delay -> 0; break_on_acquisition_failure -> false; debug_store
_checkout_exceptions -> false]
AbstractPoolBackedDataSource - Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [
 acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> 
false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connecti
onCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnecti
onTester, dataSourceName -> 1hge14i851u60ajjm4z4gj|79801c, debugUnreturnedConnectionStackTraces -> f
alse, description -> null, driverClass -> oracle.jdbc.driver.OracleDriver, factoryClassLocation -> n
ull, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge14i851u60ajjm4z4gj|79801c, idl
eConnectionTestPeriod -> 0, initialPoolSize -> 3, jdbcUrl -> jdbc:oracle:thin:@192.168.1.53:1521:ORC
L, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnect
ions -> 0, maxPoolSize -> 15, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3,
 numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0, preferredTestQuery -> null, prop
erties -> {user=******, password=******}, propertyCycle -> 0, testConnectionOnCheckin -> false, test
ConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies ->
 false ]
BasicResourcePool - acquire test -- pool size: 0; target_pool_size: 3; desired target? 1
BasicResourcePool - awaitAvailable(): [unknown]
BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@114a947 [managed: 0, unused:
 0, excluded: 0]
C3P0PooledConnectionPool - com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResour
[email protected]() returning. 
BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@114a947 [managed: 1, unused:
 1, excluded: 0]
BasicResourcePool - decremented pending_acquires: 2
C3P0PooledConnectionPool - com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResour
[email protected]() returning. 
BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@114a947 [managed: 2, unused:
 2, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@1949f78)
BasicResourcePool - decremented pending_acquires: 1
C3P0PooledConnectionPool - com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResour
[email protected]() returning. 
BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@114a947 [managed: 3, unused:
 3, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@1949f78)
BasicResourcePool - decremented pending_acquires: 0
BasicResourcePool - trace com.mchange.v2.resourcepool.BasicResourcePool@114a947 [managed: 3, unused:
 2, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@1949f78)
NewPooledConnection - com.mchange.v2.c3p0.impl.NewPooledConnection@c5f20f handling a throwable.
java.sql.SQLException: 不支持的特性
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatureSqlException(DBError.java:689)
at oracle.jdbc.OracleDatabaseMetaData.getDatabaseMajorVersion(OracleDatabaseMetaData.java:4442)
at com.mchange.v2.c3p0.impl.NewProxyDatabaseMetaData.getDatabaseMajorVersion(NewProxyDatabaseMetaDa
ta.java:3678)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.hibernate.cfg.SettingsFactory.getDatabaseMajorVersion(SettingsFactory.java:365)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:115)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2101)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1325)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactory
Bean.java:814)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFacto
ryBean.java:732)
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSession
FactoryBean.java:211)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(A
bstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(Abst
ractAutowireCapableBeanFactory.java:1335)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(Abstra
ctAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutow
ireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(Abstract
AutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.ja
va:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingl
etonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java
:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:1
85)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:1
64)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(De
faultListableBeanFactory.java:423)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(A
bstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContex
t.java:380)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255
)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.j
ava:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:924)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1147)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:516)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
SqlUtils - Attempted to convert SQLException to SQLException. Leaving it alone. [SQLState: null; err
orCode: 17023]

解决方案 »

  1.   

    容器tomcat 6.0
    jdk 1.6.0_10
    oracle版本:10.
    jar包:ojdbc14.jar.jar包没有用错。
      

  2.   

    不知道你整合到什么程度了,hibernate的配置也发下
      

  3.   

    楼主把jar包换成class12.jar试试看。
    Attempted to convert SQLException to SQLException. Leaving it alone. [SQLState: null; err
    orCode: 17023] 
    根据这里,可能是jar包冲突,或者ojdbc14.jar没有实现某个java.sql.*类里面的方法。顺便问一下:你这里是连接不上还是连接池根本就配不起来啊?
      

  4.   

    结贴散粉。
    的确是jar包的问题,用class12.jar后问题解决了。
    感谢crazylaa。感谢包子狼。