Having issues when I shut down Tomcat or run JUnit test. This is in the SpringFramework but I don't know if it is applicable. When the app context is being destroyed on shut down it always throws this error.
In the case of the Junit test, it even happens if I don't do any queries. Appears to be simply because of the initialization of the datasource.
I tried to remove the C2P0 config items... but it is the default anyway.
It doesn't really affect the application in anyway, but it does really mess up the junit test reports. Would appreciate any insight.
Config:
<session-factory>
<property name="connection.url">jdbc:oracle:thin:@localhost:1521:DB</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.username">secret</property>
<property name="connection.password">secret</property>
<property name="show_sql">false</property>
<property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.jdbc.batch_size">25</property>
<property name="hibernate.use_outer_join">false</property>
<property name="hibernate.connection.provider_class">net.sf.hibernate.connection.C3P0ConnectionProvider</property>
<property name="hibernate.transaction.factory_class">net.sf.hibernate.transaction.JDBCTransactionFactory</property>
<property name="hibernate.c3p0.max_size">25</property>
<property name="hibernate.c3p0.min_size">2</property>
<property name="hibernate.c3p0.timeout">5000</property>
<property name="hibernate.c3p0.validate">false</property>
...
Hibernate version: 2.1.5
Full stack trace of any exception that occurs:
[junit] java.sql.SQLException: Io exception: Socket closed
[junit] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
[junit] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
[junit] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
[junit] at oracle.jdbc.driver.OracleConnection.close(OracleConnection.java:1442)
[junit] at com.mchange.v2.c3p0.impl.C3P0PooledConnection.close(C3P0PooledConnection.java:255)
[junit] at com.mchange.v2.c3p0.impl.C3P0PooledConnection.close(C3P0PooledConnection.java:191)
[junit] at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.destroyResource(C3P0PooledConnectionPool.java:150)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:523)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:532)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:805)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.close(BasicResourcePool.java:614)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.close(BasicResourcePool.java:407)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.finalize(BasicResourcePool.java:417)
[junit] at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
[junit] at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
[junit] at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
[junit] at java.lang.ref.Finalizer$3.run(Finalizer.java:148)
[junit] at java.lang.Thread.run(Thread.java:534)
[junit] Failed to destroy resource: com.mchange.v2.c3p0.impl.C3P0PooledConnection@257f1b
[junit] java.sql.SQLException: At least one error occurred while attempting to close() the PooledConnection: java.sql.SQLException: Io exception: Socket closed
[junit] at com.mchange.v2.c3p0.impl.C3P0PooledConnection.close(C3P0PooledConnection.java:281)
[junit] at com.mchange.v2.c3p0.impl.C3P0PooledConnection.close(C3P0PooledConnection.java:191)
[junit] at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.destroyResource(C3P0PooledConnectionPool.java:150)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:523)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:532)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:805)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.close(BasicResourcePool.java:614)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.close(BasicResourcePool.java:407)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.finalize(BasicResourcePool.java:417)
[junit] at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
[junit] at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
[junit] at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
[junit] at java.lang.ref.Finalizer$3.run(Finalizer.java:148)
[junit] at java.lang.Thread.run(Thread.java:534)
[junit] java.sql.SQLException: Io exception: Socket closed
[junit] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
[junit] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
[junit] at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:333)
[junit] at oracle.jdbc.driver.OracleConnection.close(OracleConnection.java:1442)
[junit] at com.mchange.v2.c3p0.impl.C3P0PooledConnection.close(C3P0PooledConnection.java:255)
[junit] at com.mchange.v2.c3p0.impl.C3P0PooledConnection.close(C3P0PooledConnection.java:191)
[junit] at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.destroyResource(C3P0PooledConnectionPool.java:150)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:523)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:532)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:805)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.close(BasicResourcePool.java:614)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.close(BasicResourcePool.java:407)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.finalize(BasicResourcePool.java:417)
[junit] at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
[junit] at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
[junit] at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
[junit] at java.lang.ref.Finalizer$3.run(Finalizer.java:148)
[junit] at java.lang.Thread.run(Thread.java:534)
[junit] Failed to destroy resource: com.mchange.v2.c3p0.impl.C3P0PooledConnection@3f96ee
[junit] java.sql.SQLException: At least one error occurred while attempting to close() the PooledConnection: java.sql.SQLException: Io exception: Socket closed
[junit] at com.mchange.v2.c3p0.impl.C3P0PooledConnection.close(C3P0PooledConnection.java:281)
[junit] at com.mchange.v2.c3p0.impl.C3P0PooledConnection.close(C3P0PooledConnection.java:191)
[junit] at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1.destroyResource(C3P0PooledConnectionPool.java:150)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool$5.run(BasicResourcePool.java:523)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.destroyResource(BasicResourcePool.java:532)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.removeResource(BasicResourcePool.java:805)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.close(BasicResourcePool.java:614)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.close(BasicResourcePool.java:407)
[junit] at com.mchange.v2.resourcepool.BasicResourcePool.finalize(BasicResourcePool.java:417)
[junit] at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
[junit] at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
[junit] at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
[junit] at java.lang.ref.Finalizer$3.run(Finalizer.java:148)
[junit] at java.lang.Thread.run(Thread.java:534)
[junit] com.mchange.v2.resourcepool.BasicResourcePool@1c5466b -- close() called multiple times.
Name and version of the database you are using:
Oracle 9i
|