spring 2.5 + hibernate3.1 + c3p0 出现的数据库连接问题

08-07-23 ywlovecjy
以前项目用的还是老版本spring 1.2.7 现在项目需要升级到spring2.5 看了spring2.5的文档说只需要把spring的jar包换了就OK了,结果出现如下问题,望高手指点下
spring配置文件数据库连接

<bean id="dataSource"
class="com.mchange.v2.c3p0.ComboPooledDataSource"
destroy-method="close" dependency-check="none">
<property name="driverClass">
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="jdbcUrl">
<value>jdbc:oracle:thin:@192.168.1.200:1521:orcl</value>
</property>
<property name="user">
<value>simapp</value>
</property>
<property name="password">
<value>simapp</value>
</property>
<property name="acquireIncrement">
<value>3</value>
</property>
<property name="initialPoolSize">
<value>3</value>
</property>
<property name="minPoolSize">
<value>2</value>
</property>
<property name="maxPoolSize">
<value>50</value>
</property>
<property name="maxIdleTime">
<value>600</value>
</property>
<property name="idleConnectionTestPeriod">
<value>900</value>
</property>
<property name="maxStatements">
<value>100</value>
</property>
<property name="numHelperThreads">
<value>10</value>
</property>
</bean>


<!-- Hibernate, ORM and common Interceptors -->
<bean id="sessionFactory"
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="configurationClass">
<value>org.hibernate.cfg.AnnotationConfiguration</value>
</property>
<property name="configLocation">
<value>/WEB-INF/${hibernate.cfg}</value>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.Oracle9Dialect
</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.use_outer_join">true</prop>
<prop key="hibernate.format_sql">
true
</prop>
<prop key="hibernate.jdbc.batch_size">15</prop>
<prop key="hibernate.jdbc.fetch_size">5</prop>
<prop key="hibernate.default_batch_fetch_size">8</prop>
<prop key="hibernate.connection.release_mode">
auto
</prop>
</props>
</property>
<property name="dataSource">
<ref bean="dataSource" />
</property>
</bean>

启动成功,访问首页出现如下异常:
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12519, TNS:no appropriate service handler found
The Connection descriptor used by the client was:
192.168.1.200:1521:orcl

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.logicalcobwebs.proxool.DefaultConnectionBuilder.buildConnection(DefaultConnectionBuilder.java:39)
at org.logicalcobwebs.proxool.Prototyper.buildConnection(Prototyper.java:159)
at org.logicalcobwebs.proxool.Prototyper.sweep(Prototyper.java:102)
at org.logicalcobwebs.proxool.PrototyperThread.run(PrototyperThread.java:44)