File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes Method cleanup failed while trying to execute method cleanup on ManagedConnection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "Method cleanup failed while trying to execute method cleanup on ManagedConnection" Watch "Method cleanup failed while trying to execute method cleanup on ManagedConnection" New topic
Author

Method cleanup failed while trying to execute method cleanup on ManagedConnection

Rahulaiit kumar
Greenhorn

Joined: May 20, 2008
Posts: 4
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))
 
 
subject: Method cleanup failed while trying to execute method cleanup on ManagedConnection
 
Similar Threads
Transaction time out problem on WAS 5.1.1
Problem with WAS 5.1
HTTP 500 - Internal server error
J2CA0081E: Method cleanup failed while trying to execute method cleanup on ManagedConnection
Help with Determining Cause of Error Messages