java.sql.SQLException: Invalid state, the Connection object is closed in JTDS JDBC driver

Solution Verified - Updated -

Issue

  • We are facing this issue for first time, unexpectedly.
JBWEB000065: HTTP Status 500 - PreparedStatementCallback; uncategorized SQLException for SQL [QUERY]; SQL state [HY010]; error code [0]; Invalid state, the Connection object is closed.; nested exception is java.sql.SQLException: Invalid state, the Connection object is closed.
JBWEB000309: type JBWEB000066: Exception report

JBWEB000068: message PreparedStatementCallback; uncategorized SQLException for SQL [QUERY]; SQL state [HY010]; error code [0]; Invalid state, the Connection object is closed.; nested exception is java.sql.SQLException: Invalid state, the Connection object is closed.

JBWEB000069: description JBWEB000145: The server encountered an internal error that prevented it from fulfilling this request.

JBWEB000070: exception 

org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [QUERY]; SQL state [HY010]; error code [0]; Invalid state, the Connection object is closed.; nested exception is java.sql.SQLException: Invalid state, the Connection object is closed.
    org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83)
    org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80)
    org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:602)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:636)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:661)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:701)
    org.springframework.jdbc.object.SqlQuery.execute(SqlQuery.java:112)
    org.springframework.jdbc.object.SqlQuery.execute(SqlQuery.java:122)
    org.apache.wicket.request.AbstractRequestCycleProcessor.onRuntimeException(AbstractRequestCycleProcessor.java:224)
    org.apache.wicket.request.AbstractRequestCycleProcessor.respond(AbstractRequestCycleProcessor.java:120)
    org.apache.wicket.RequestCycle.step(RequestCycle.java:1408)
    org.apache.wicket.RequestCycle.steps(RequestCycle.java:1465)
    org.apache.wicket.RequestCycle.request(RequestCycle.java:545)
    org.apache.wicket.protocol.http.WicketFilter.doGet(WicketFilter.java:486)
    org.apache.wicket.protocol.http.WicketFilter.doFilter(WicketFilter.java:319)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
        .....................

JBWEB000071: root cause 

java.sql.SQLException: Invalid state, the Connection object is closed.
    net.sourceforge.jtds.jdbc.ConnectionJDBC2.checkOpen(ConnectionJDBC2.java:1494)
    net.sourceforge.jtds.jdbc.ConnectionJDBC2.prepareStatement(ConnectionJDBC2.java:2215)
    org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.doPrepareStatement(BaseWrapperManagedConnection.java:738)
    org.jboss.jca.adapters.jdbc.BaseWrapperManagedConnection.prepareStatement(BaseWrapperManagedConnection.java:724)
    org.jboss.jca.adapters.jdbc.WrappedConnection.prepareStatement(WrappedConnection.java:405)
    org.springframework.jdbc.core.PreparedStatementCreatorFactory$PreparedStatementCreatorImpl.createPreparedStatement(PreparedStatementCreatorFactory.java:245)
    org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:580)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:636)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:661)
    org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:701)
    org.springframework.jdbc.object.SqlQuery.execute(SqlQuery.java:112)
    org.springframework.jdbc.object.SqlQuery.execute(SqlQuery.java:122)
    .................

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 6.2.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.