You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I am using log4J to log all errors in my application to database . I have configured exact column mappings in log4j.xml and whenever logger.error() is invoked it will log the errors to DB. I am using connection factory class which returns datasource to establish the connection and insert the errors to DB. Whenever there is an exception while inserting to DB my next log events are not logged and I see below exception in the sysout file.
J2CA0081E: Method cleanup failed while trying to execute method cleanup on ManagedConnection WSRdbManagedConnectionImpl@46a686c2 from resource jdbc/logspgSQL. Caught exception: com.ibm.ws.exception.WsException: DSRA0080E: An exception was received by the Data Store Adapter. See original exception message: Cannot call 'cleanup' on a ManagedConnection while it is still in a transaction..
at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.(DataStoreAdapterException.java:256)
at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.(DataStoreAdapterException.java:205)
at com.ibm.ws.rsadapter.AdapterUtil.createDataStoreAdapterException(AdapterUtil.java:442)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.cleanupTransactions(WSRdbManagedConnectionImpl.java:4743)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.cleanup(WSRdbManagedConnectionImpl.java:4176)
at com.ibm.ejs.j2c.MCWrapper.cleanup(MCWrapper.java:1846)
at com.ibm.ejs.j2c.FreePool.returnToFreePool(FreePool.java:554)
at com.ibm.ejs.j2c.PoolManager.release(PoolManager.java:2928)
at com.ibm.ejs.j2c.MCWrapper.releaseToPoolManager(MCWrapper.java:2639)
at com.ibm.ejs.j2c.ConnectionEventListener.connectionClosed(ConnectionEventListener.java:395)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.processConnectionClosedEvent(WSRdbManagedConnectionImpl.java:2010)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.closeWrapper(WSJdbcConnection.java:983)
at com.ibm.ws.rsadapter.jdbc.WSJdbcObject.close(WSJdbcObject.java:242)
at com.ibm.ws.rsadapter.jdbc.WSJdbcObject.close(WSJdbcObject.java:195)
at org.apache.logging.log4j.core.util.Closer.close(Closer.java:43)
at org.apache.logging.log4j.core.appender.db.jdbc.JdbcDatabaseManager.closeResources(JdbcDatabaseManager.java:535)
at org.apache.logging.log4j.core.appender.db.jdbc.JdbcDatabaseManager.commitAndClose(JdbcDatabaseManager.java:566)
at org.apache.logging.log4j.core.appender.db.AbstractDatabaseManager.flush(AbstractDatabaseManager.java:192)
at org.apache.logging.log4j.core.appender.db.AbstractDatabaseManager.buffer(AbstractDatabaseManager.java:159)
at org.apache.logging.log4j.core.appender.db.AbstractDatabaseManager.write(AbstractDatabaseManager.java:296)
at org.apache.logging.log4j.core.appender.db.AbstractDatabaseAppender.append(AbstractDatabaseAppender.java:110)
at org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:161)
at org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:134)
at org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:125)
at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:89)
at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:675)
at org.apache.logging.log4j.core.async.AsyncLoggerConfig.callAppenders(AsyncLoggerConfig.java:144)
at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:633)
at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:616)
at org.apache.logging.log4j.core.async.AsyncLoggerConfig.log(AsyncLoggerConfig.java:138)
at org.apache.logging.log4j.core.async.AsyncLoggerConfig.logToAsyncLoggerConfigsOnCurrentThread(AsyncLoggerConfig.java:186)
at org.apache.logging.log4j.core.async.AsyncLoggerConfigDisruptor$Log4jEventWrapperHandler.onEvent(AsyncLoggerConfigDisruptor.java:112)
at org.apache.logging.log4j.core.async.AsyncLoggerConfigDisruptor$Log4jEventWrapperHandler.onEvent(AsyncLoggerConfigDisruptor.java:98)
at com.lmax.disruptor.BatchEventProcessor.processEvents(BatchEventProcessor.java:168)
at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:125)
at java.lang.Thread.run(Thread.java:825)
The text was updated successfully, but these errors were encountered:
Description
Hi,
I am using log4J to log all errors in my application to database . I have configured exact column mappings in log4j.xml and whenever logger.error() is invoked it will log the errors to DB. I am using connection factory class which returns datasource to establish the connection and insert the errors to DB. Whenever there is an exception while inserting to DB my next log events are not logged and I see below exception in the sysout file.
Version: [Log4j 2.17.2]
JDK: [JDK 1.8]
Websphere application server 8.5.5.18
postgresql-9.4-1202.jdbc41.jar
Below is my XML configuration
log4J xml configuration.txt
LogsStoreConnectionFactory.txt
Logs
J2CA0081E: Method cleanup failed while trying to execute method cleanup on ManagedConnection WSRdbManagedConnectionImpl@46a686c2 from resource jdbc/logspgSQL. Caught exception: com.ibm.ws.exception.WsException: DSRA0080E: An exception was received by the Data Store Adapter. See original exception message: Cannot call 'cleanup' on a ManagedConnection while it is still in a transaction..
at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.(DataStoreAdapterException.java:256)
at com.ibm.ws.rsadapter.exceptions.DataStoreAdapterException.(DataStoreAdapterException.java:205)
at com.ibm.ws.rsadapter.AdapterUtil.createDataStoreAdapterException(AdapterUtil.java:442)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.cleanupTransactions(WSRdbManagedConnectionImpl.java:4743)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.cleanup(WSRdbManagedConnectionImpl.java:4176)
at com.ibm.ejs.j2c.MCWrapper.cleanup(MCWrapper.java:1846)
at com.ibm.ejs.j2c.FreePool.returnToFreePool(FreePool.java:554)
at com.ibm.ejs.j2c.PoolManager.release(PoolManager.java:2928)
at com.ibm.ejs.j2c.MCWrapper.releaseToPoolManager(MCWrapper.java:2639)
at com.ibm.ejs.j2c.ConnectionEventListener.connectionClosed(ConnectionEventListener.java:395)
at com.ibm.ws.rsadapter.spi.WSRdbManagedConnectionImpl.processConnectionClosedEvent(WSRdbManagedConnectionImpl.java:2010)
at com.ibm.ws.rsadapter.jdbc.WSJdbcConnection.closeWrapper(WSJdbcConnection.java:983)
at com.ibm.ws.rsadapter.jdbc.WSJdbcObject.close(WSJdbcObject.java:242)
at com.ibm.ws.rsadapter.jdbc.WSJdbcObject.close(WSJdbcObject.java:195)
at org.apache.logging.log4j.core.util.Closer.close(Closer.java:43)
at org.apache.logging.log4j.core.appender.db.jdbc.JdbcDatabaseManager.closeResources(JdbcDatabaseManager.java:535)
at org.apache.logging.log4j.core.appender.db.jdbc.JdbcDatabaseManager.commitAndClose(JdbcDatabaseManager.java:566)
at org.apache.logging.log4j.core.appender.db.AbstractDatabaseManager.flush(AbstractDatabaseManager.java:192)
at org.apache.logging.log4j.core.appender.db.AbstractDatabaseManager.buffer(AbstractDatabaseManager.java:159)
at org.apache.logging.log4j.core.appender.db.AbstractDatabaseManager.write(AbstractDatabaseManager.java:296)
at org.apache.logging.log4j.core.appender.db.AbstractDatabaseAppender.append(AbstractDatabaseAppender.java:110)
at org.apache.logging.log4j.core.config.AppenderControl.tryCallAppender(AppenderControl.java:161)
at org.apache.logging.log4j.core.config.AppenderControl.callAppender0(AppenderControl.java:134)
at org.apache.logging.log4j.core.config.AppenderControl.callAppenderPreventRecursion(AppenderControl.java:125)
at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:89)
at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:675)
at org.apache.logging.log4j.core.async.AsyncLoggerConfig.callAppenders(AsyncLoggerConfig.java:144)
at org.apache.logging.log4j.core.config.LoggerConfig.processLogEvent(LoggerConfig.java:633)
at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:616)
at org.apache.logging.log4j.core.async.AsyncLoggerConfig.log(AsyncLoggerConfig.java:138)
at org.apache.logging.log4j.core.async.AsyncLoggerConfig.logToAsyncLoggerConfigsOnCurrentThread(AsyncLoggerConfig.java:186)
at org.apache.logging.log4j.core.async.AsyncLoggerConfigDisruptor$Log4jEventWrapperHandler.onEvent(AsyncLoggerConfigDisruptor.java:112)
at org.apache.logging.log4j.core.async.AsyncLoggerConfigDisruptor$Log4jEventWrapperHandler.onEvent(AsyncLoggerConfigDisruptor.java:98)
at com.lmax.disruptor.BatchEventProcessor.processEvents(BatchEventProcessor.java:168)
at com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:125)
at java.lang.Thread.run(Thread.java:825)
The text was updated successfully, but these errors were encountered: