• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Method cleanup failed while trying to execute method cleanup on ManagedConnection

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am using WebSphere 5 .1.0, Oracle 9i database and ojdbc14-10.2.0.2.0.jar as driver. The connection is established using JNDI datasource.

I am getting the connection as
Connection conn = DataSourceUtils.getConnection(dataSource);

Note:- DataSourceUtils is an abstract class of Springframework

And then calling
ArrayDescriptor stringArrDescr = (ArrayDescriptor)ArrayDescriptor.createDescriptor("DBO.STR_ARRAY", conn);

Note:- ArrayDescriptor is a class of Oracle.Sql

It is throwing a class cast exception error.

I have verified that there should be only one JAR file for the driver i.e. it should be there on the server and not in the lib of the WAR file.

The connection object is of type WSJdbcConnection. When I searched the net I found that I have to cast the connection type to some native type so I changed my code to


if (conn instanceof WSJdbcConnection) {

Connection pc = (Connection)WSJdbcUtil.getNativeConnection((WSJdbcConnection)conn);
}

Now, after adding this code I am not getting the class cast exception and the functionality is working fine but in the logs of the server I am seeing the exception message as

165cea93 MCWrapper E J2CA0081E: Method cleanup failed while trying to execute method cleanup on ManagedConnection com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl@15c66ac9 from resource jdbc/syfact. Caught exception: com.ibm.ws.exception.WsException: DSRA0080E: An exception was received by the Data Store Adapter. See original exception message: Closed Connection.

After seeing this exception message the I commented the line in which I am closing the connection .i.e. //DBConduit.closeConnection(conn);

But I am still getting the same error.

One more thing, this application runs across different servers i.e. WebLogic, Jboss, Tomcat etc. Is there any generic solution of ClassCastException problem that is valid across all the Application Server?

Please help me to resolve this issue.

The full stack trace of error that I am getting after casting the Connection Object is :


[5/20/08 10:24:11:869 IST] 165cea93 MCWrapper E J2CA0081E: Method cleanup failed while trying to execute method cleanup on ManagedConnection com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl@15c66ac9 from resource jdbc/syfact. Caught exception: com.ibm.ws.exception.WsException: DSRA0080E: An exception was received by the Data Store Adapter. See original exception message: Closed Connection.
at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.<init>(DataStoreAdapterException.java:244)
at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.<init>(DataStoreAdapterException.java:171)
at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.<init>(DataStoreAdapterException.java:124)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.cleanupStates(WSRdbManagedConnectionImpl.java(Compiled Code))
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.cleanup(WSRdbManagedConnectionImpl.java(Compiled Code))
at com.ibm.ejs.j2c.MCWrapper.cleanup(MCWrapper.java(Compiled Code))
at com.ibm.ejs.j2c.poolmanager.FreePool.returnToFreePool(FreePool.java(Compiled Code))
at com.ibm.ejs.j2c.poolmanager.PoolManager.release(PoolManager.java(Compiled Code))
at com.ibm.ejs.j2c.MCWrapper.releaseToPoolManager(MCWrapper.java(Compiled Code))
at com.ibm.ejs.j2c.LocalTransactionWrapper.afterCompletionCode(LocalTransactionWrapper.java:1077)
at com.ibm.ejs.j2c.LocalTransactionWrapper.afterCompletion(LocalTransactionWrapper.java:1014)
at com.ibm.ws.LocalTransaction.LocalTranCoordImpl.informSynchronizations(LocalTranCoordImpl.java(Compiled Code))
at com.ibm.ws.LocalTransaction.LocalTranCoordImpl.cleanup(LocalTranCoordImpl.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppTransactionCollaborator.postInvoke(WebAppTransactionCollaborator.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code))
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code))
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code))
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
Caused by: java.sql.SQLException: Closed Connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java(Inlined Compiled Code))
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java(Inlined Compiled Code))
at oracle.jdbc.driver.PhysicalConnection.setAutoCommit(PhysicalConnection.java(Compiled Code))
at oracle.jdbc.OracleConnectionWrapper.setAutoCommit(OracleConnectionWrapper.java(Compiled Code))
at com.ibm.websphere.rsadapter.OracleDataStoreHelper.doConnectionCleanup(OracleDataStoreHelper.java(Compiled Code))
... 22 more
---- Begin backtrace for nested exception
java.sql.SQLException: Closed Connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java(Inlined Compiled Code))
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java(Inlined Compiled Code))
at oracle.jdbc.driver.PhysicalConnection.setAutoCommit(PhysicalConnection.java(Compiled Code))
at oracle.jdbc.OracleConnectionWrapper.setAutoCommit(OracleConnectionWrapper.java(Compiled Code))
at com.ibm.websphere.rsadapter.OracleDataStoreHelper.doConnectionCleanup(OracleDataStoreHelper.java(Compiled Code))
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.cleanupStates(WSRdbManagedConnectionImpl.java(Compiled Code))
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.cleanup(WSRdbManagedConnectionImpl.java(Compiled Code))
at com.ibm.ejs.j2c.MCWrapper.cleanup(MCWrapper.java(Compiled Code))
at com.ibm.ejs.j2c.poolmanager.FreePool.returnToFreePool(FreePool.java(Compiled Code))
at com.ibm.ejs.j2c.poolmanager.PoolManager.release(PoolManager.java(Compiled Code))
at com.ibm.ejs.j2c.MCWrapper.releaseToPoolManager(MCWrapper.java(Compiled Code))
at com.ibm.ejs.j2c.LocalTransactionWrapper.afterCompletionCode(LocalTransactionWrapper.java:1077)
at com.ibm.ejs.j2c.LocalTransactionWrapper.afterCompletion(LocalTransactionWrapper.java:1014)
at com.ibm.ws.LocalTransaction.LocalTranCoordImpl.informSynchronizations(LocalTranCoordImpl.java(Compiled Code))
at com.ibm.ws.LocalTransaction.LocalTranCoordImpl.cleanup(LocalTranCoordImpl.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppTransactionCollaborator.postInvoke(WebAppTransactionCollaborator.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code))
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code))
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code))
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:439)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
reply
    Bookmark Topic Watch Topic
  • New Topic