java.lang.RuntimeException: Error accessing SimplePooledConnection. Connection is invalid

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

java.lang.RuntimeException: Error accessing SimplePooledConnection. Connection is invalid

shivnarayan
This is bugging me since last 2 days:

"java.lang.RuntimeException: Error accessing SimplePooledConnection"

My application is running well in weblogic container environment. But when i am trying to run same in testng environment, Its giving below issue.

[testng] java.lang.RuntimeException: Error accessing SimplePooledConnection. Connection is invalid.
[testng]     at com.ibatis.common.jdbc.SimpleDataSource$SimplePooledConnection.getValidConnection(SimpleDataSource.java:967)
[testng]     at com.ibatis.common.jdbc.SimpleDataSource$SimplePooledConnection.invoke(SimpleDataSource.java:1012)
[testng]     at $Proxy178.setTransactionIsolation(Unknown Source)
[testng]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[testng]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[testng]     at java.lang.reflect.Method.invoke(Method.java:597)
[testng]     at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(Tr
actionAwareDataSourceProxy.java:239)
[testng]     at $Proxy177.setTransactionIsolation(Unknown Source)
[testng]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[testng]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[testng]     at java.lang.reflect.Method.invoke(Method.java:597)
[testng]     at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(Tr
actionAwareDataSourceProxy.java:239)
[testng]     at $Proxy177.setTransactionIsolation(Unknown Source)
[testng]     at com.ibatis.sqlmap.engine.transaction.IsolationLevel.restoreIsolationLevel(IsolationLevel.java:28)
[testng]     at com.ibatis.sqlmap.engine.transaction.external.ExternalTransaction.close(ExternalTransaction.java:80)
[testng]     at com.ibatis.sqlmap.engine.transaction.TransactionManager.end(TransactionManager.java:110)
[testng]     at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.endTransaction(SqlMapExecutorDelegate.java:780)
[testng]     at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.endTransaction(SqlMapSessionImpl.java:170)
[testng]     at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.endTransaction(SqlMapClientImpl.java:149)
[testng]     at com.ibatis.dao.engine.transaction.sqlmap.SqlMapDaoTransaction.rollback(SqlMapDaoTransaction.java:49)
[testng]     at com.ibatis.dao.engine.transaction.sqlmap.SqlMapDaoTransactionManager.rollbackTransaction(SqlMapDaoTransactionMa
er.java:85)
[testng]     at com.ibatis.dao.engine.impl.DaoContext.endTransaction(DaoContext.java:112)
[testng]     at com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:77)
[testng]     at $Proxy43.setCurrentUserId(Unknown Source)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[testng]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[testng]     at java.lang.reflect.Method.invoke(Method.java:597)
[testng]     at com.carreker.cl.common.DaoProxy.invoke(DaoProxy.java:84)
[testng]     at $Proxy43.setCurrentUserId(Unknown Source)
[testng]     at com.carreker.cl.dao.sqlmaps.BaseSqlMapDao.setCurrentUserid(BaseSqlMapDao.java:127)
[testng]     at com.carreker.cl.dao.sqlmaps.BaseSqlMapDao.insert(BaseSqlMapDao.java:99)
[testng]     at com.carreker.cl.dao.sqlmaps.CalendarSqlMapDao.insertRecurrence(CalendarSqlMapDao.java:129)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[testng]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[testng]     at java.lang.reflect.Method.invoke(Method.java:597)
[testng]     at com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:72)
[testng]     at $Proxy55.insertRecurrence(Unknown Source)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[testng]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[testng]     at java.lang.reflect.Method.invoke(Method.java:597)
[testng]     at com.carreker.cl.common.DaoProxy.invoke(DaoProxy.java:84)
[testng]     at $Proxy55.insertRecurrence(Unknown Source)
[testng]     at test.com.fiserv.cl.dao.CalendarDaoTests.testInsertRecurrence(CalendarDaoTests.java:63)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[testng]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[testng]     at java.lang.reflect.Method.invoke(Method.java:597)
[testng]     at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:76)
[testng]     at org.testng.internal.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:178)
[testng]     at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.run(AbstractTestNGSpringContextTests.j
:158)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[testng]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[testng]     at java.lang.reflect.Method.invoke(Method.java:597)
[testng]     at org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:191)
[testng]     at org.testng.internal.Invoker.invokeMethod(Invoker.java:666)
[testng]     at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:846)
[testng]     at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1170)
[testng]     at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
[testng]     at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
[testng]     at org.testng.TestRunner.runWorkers(TestRunner.java:1147)
[testng]     at org.testng.TestRunner.privateRun(TestRunner.java:749)
[testng]     at org.testng.TestRunner.run(TestRunner.java:600)
[testng]     at org.testng.SuiteRunner.runTest(SuiteRunner.java:317)
[testng]     at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:312)
[testng]     at org.testng.SuiteRunner.privateRun(SuiteRunner.java:274)
[testng]     at org.testng.SuiteRunner.run(SuiteRunner.java:223)
[testng]     at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
[testng]     at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
[testng]     at org.testng.TestNG.runSuitesSequentially(TestNG.java:1039)
[testng]     at org.testng.TestNG.runSuitesLocally(TestNG.java:964)
[testng]     at org.testng.TestNG.run(TestNG.java:900)
[testng]     at org.testng.TestNG.privateMain(TestNG.java:1182)
[testng]     at org.testng.TestNG.main(TestNG.java:1146)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: java.lang.RuntimeException: Error accessing SimplePooledConnection. Connection is invalid

shivnarayan
Hi Problem is fixed.

This problem was coming when I was using ibatis in standalone mode.

In container mode it was working fine as It was Ibatis SimpleDataSource which in turn was using container facilitated connection pool.

I believe standalone batis connection pool is not as robust and that was the reason for below issue,

Ibatis guys can please look upone.

Between I have replaced same with DBCP connection pool in standalone mode and that solved the issue.

Regards,
Shivnarayan Varma




shivnarayan wrote
This is bugging me since last 2 days:

"java.lang.RuntimeException: Error accessing SimplePooledConnection"

My application is running well in weblogic container environment. But when i am trying to run same in testng environment, Its giving below issue.

[testng] java.lang.RuntimeException: Error accessing SimplePooledConnection. Connection is invalid.
[testng]     at com.ibatis.common.jdbc.SimpleDataSource$SimplePooledConnection.getValidConnection(SimpleDataSource.java:967)
[testng]     at com.ibatis.common.jdbc.SimpleDataSource$SimplePooledConnection.invoke(SimpleDataSource.java:1012)
[testng]     at $Proxy178.setTransactionIsolation(Unknown Source)
[testng]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[testng]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[testng]     at java.lang.reflect.Method.invoke(Method.java:597)
[testng]     at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(Tr
actionAwareDataSourceProxy.java:239)
[testng]     at $Proxy177.setTransactionIsolation(Unknown Source)
[testng]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[testng]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[testng]     at java.lang.reflect.Method.invoke(Method.java:597)
[testng]     at org.springframework.jdbc.datasource.TransactionAwareDataSourceProxy$TransactionAwareInvocationHandler.invoke(Tr
actionAwareDataSourceProxy.java:239)
[testng]     at $Proxy177.setTransactionIsolation(Unknown Source)
[testng]     at com.ibatis.sqlmap.engine.transaction.IsolationLevel.restoreIsolationLevel(IsolationLevel.java:28)
[testng]     at com.ibatis.sqlmap.engine.transaction.external.ExternalTransaction.close(ExternalTransaction.java:80)
[testng]     at com.ibatis.sqlmap.engine.transaction.TransactionManager.end(TransactionManager.java:110)
[testng]     at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.endTransaction(SqlMapExecutorDelegate.java:780)
[testng]     at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.endTransaction(SqlMapSessionImpl.java:170)
[testng]     at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.endTransaction(SqlMapClientImpl.java:149)
[testng]     at com.ibatis.dao.engine.transaction.sqlmap.SqlMapDaoTransaction.rollback(SqlMapDaoTransaction.java:49)
[testng]     at com.ibatis.dao.engine.transaction.sqlmap.SqlMapDaoTransactionManager.rollbackTransaction(SqlMapDaoTransactionMa
er.java:85)
[testng]     at com.ibatis.dao.engine.impl.DaoContext.endTransaction(DaoContext.java:112)
[testng]     at com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:77)
[testng]     at $Proxy43.setCurrentUserId(Unknown Source)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[testng]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[testng]     at java.lang.reflect.Method.invoke(Method.java:597)
[testng]     at com.carreker.cl.common.DaoProxy.invoke(DaoProxy.java:84)
[testng]     at $Proxy43.setCurrentUserId(Unknown Source)
[testng]     at com.carreker.cl.dao.sqlmaps.BaseSqlMapDao.setCurrentUserid(BaseSqlMapDao.java:127)
[testng]     at com.carreker.cl.dao.sqlmaps.BaseSqlMapDao.insert(BaseSqlMapDao.java:99)
[testng]     at com.carreker.cl.dao.sqlmaps.CalendarSqlMapDao.insertRecurrence(CalendarSqlMapDao.java:129)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[testng]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[testng]     at java.lang.reflect.Method.invoke(Method.java:597)
[testng]     at com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:72)
[testng]     at $Proxy55.insertRecurrence(Unknown Source)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[testng]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[testng]     at java.lang.reflect.Method.invoke(Method.java:597)
[testng]     at com.carreker.cl.common.DaoProxy.invoke(DaoProxy.java:84)
[testng]     at $Proxy55.insertRecurrence(Unknown Source)
[testng]     at test.com.fiserv.cl.dao.CalendarDaoTests.testInsertRecurrence(CalendarDaoTests.java:63)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[testng]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[testng]     at java.lang.reflect.Method.invoke(Method.java:597)
[testng]     at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:76)
[testng]     at org.testng.internal.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:178)
[testng]     at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.run(AbstractTestNGSpringContextTests.j
:158)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[testng]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[testng]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[testng]     at java.lang.reflect.Method.invoke(Method.java:597)
[testng]     at org.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:191)
[testng]     at org.testng.internal.Invoker.invokeMethod(Invoker.java:666)
[testng]     at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:846)
[testng]     at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1170)
[testng]     at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
[testng]     at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
[testng]     at org.testng.TestRunner.runWorkers(TestRunner.java:1147)
[testng]     at org.testng.TestRunner.privateRun(TestRunner.java:749)
[testng]     at org.testng.TestRunner.run(TestRunner.java:600)
[testng]     at org.testng.SuiteRunner.runTest(SuiteRunner.java:317)
[testng]     at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:312)
[testng]     at org.testng.SuiteRunner.privateRun(SuiteRunner.java:274)
[testng]     at org.testng.SuiteRunner.run(SuiteRunner.java:223)
[testng]     at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
[testng]     at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
[testng]     at org.testng.TestNG.runSuitesSequentially(TestNG.java:1039)
[testng]     at org.testng.TestNG.runSuitesLocally(TestNG.java:964)
[testng]     at org.testng.TestNG.run(TestNG.java:900)
[testng]     at org.testng.TestNG.privateMain(TestNG.java:1182)
[testng]     at org.testng.TestNG.main(TestNG.java:1146)
Loading...