File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes java.sql.SQLException: Connection has already been closed. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java.sql.SQLException: Connection has already been closed." Watch "java.sql.SQLException: Connection has already been closed." New topic
Author

java.sql.SQLException: Connection has already been closed.

Balamurugan Guruswamy
Greenhorn

Joined: Dec 21, 2009
Posts: 1
Hi,
I used to get a lot of incidents raised due to failure of batches. All these incidents point to the same root cause, Connection Exception which its shown below.
Almost once in a week i am getting this issue.

I am using spring1.2.8,weblogic9.2 and oracle10g.
Please can anybody provide solution for
1) Why its happening and how to replicate the issue?
2) Whats the solution for this issue?


java.sql.SQLException: Connection has already been closed.
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:195)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:224)
at weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_PoolConnection_oracle_jdbc_driver_T4CConnection_920_WLStub.createStatement(Unknown Source)
at weblogic.jdbc.rmi.SerialConnection.createStatement(SerialConnection.java:161)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:276)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:348)
at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:352)
..........
.........
Caused by: java.sql.SQLException: Connection has already been closed.
at weblogic.jdbc.wrapper.PoolConnection.checkConnection(PoolConnection.java:59)
at weblogic.jdbc.wrapper.Connection.preInvocationHandler(Connection.java:87)
at weblogic.jdbc.wrapper.Connection.createStatement(Connection.java:454)
at weblogic.jdbc.rmi.internal.ConnectionImpl.createStatement(ConnectionImpl.java:238)
at weblogic.jdbc.rmi.internal.ConnectionImpl_weblogic_jdbc_wrapper_PoolConnection_oracle_jdbc_driver_T4CConnection_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:517)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:407)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:403)
at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:56)
at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:934)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

Regards,
Bala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: java.sql.SQLException: Connection has already been closed.
 
Similar Threads
Hibernate "Session closed" error with two apps using hibernate
Hibernate Result Set Closed
Null pointer in JTSConnection
HIbernate with Oracle and Weblogic: Help Please
GenericJDBCException