logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Lorimor <Erik.Lori...@Sun.COM>
Subject JDBCAppender & Sun App Server
Date Wed, 30 Aug 2006 15:29:55 GMT
I've looked through the archives and haven't really found an answer to
my problem.

I'm logging to a MySQL database using the JDBCAppender.  I've written
practically no custom code on top of the log4j module, just a loading  
and
unloading of the configuration, and I'm really not having too many  
problems
with the log4j itself.

BTW: I'm using 1.2.13

I think that my Appserver is disconnecting the connection to the  
database
and my guess is that log4j is unable to re-establish the connection.

I'm probably just being dense on what I should be doing, but I thought
someone else out there might have already experienced this and found
a fix for it.

Error:

Error while cleaning up ManagedConnection
javax.resource.ResourceException: The isolation level for this  
connection could not be retrieved
	at com.sun.gjc.spi.ManagedConnection.cleanup(ManagedConnection.java: 
197)
	at com.sun.enterprise.resource.AbstractConnectorAllocator.cleanup 
(AbstractConnectorAllocator.java:82)
	at com.sun.enterprise.resource.PoolManagerImpl.putbackResourceToPool 
(PoolManagerImpl.java:349)
	at com.sun.enterprise.resource.PoolManagerImpl.resourceErrorOccurred 
(PoolManagerImpl.java:333)
	at  
com.sun.enterprise.resource.LocalTxConnectionEventListener.connectionErr 
orOccurred(LocalTxConnectionEventListener.java:58)
	at com.sun.gjc.spi.ManagedConnection.connectionErrorOccurred 
(ManagedConnection.java:588)
	at com.sun.gjc.spi.ManagedConnectionFactory.matchManagedConnections 
(ManagedConnectionFactory.java:194)
	at  
com.sun.enterprise.resource.AbstractConnectorAllocator.matchConnection 
(AbstractConnectorAllocator.java:93)
	at  
com.sun.enterprise.resource.IASNonSharedResourcePool.getUnenlistedResour 
ce(IASNonSharedResourcePool.java:392)
	at  
com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResource 
(IASNonSharedResourcePool.java:355)
	at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource 
(IASNonSharedResourcePool.java:250)
	at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool 
(PoolManagerImpl.java:211)
	at com.sun.enterprise.resource.PoolManagerImpl.getResource 
(PoolManagerImpl.java:172)
	at  
com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnectio 
n(ConnectionManagerImpl.java:258)
	at  
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection 
(ConnectionManagerImpl.java:193)
	at  
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection 
(ConnectionManagerImpl.java:122)
	at com.sun.gjc.spi.DataSource.getConnection(DataSource.java:70)
	at com.sun.dashboards.admin.ProductListingModel.getProductListing 
(ProductListingModel.java:61)
	at com.sun.dashboards.admin.ProductListingAction.execute 
(ProductListingAction.java:44)
	at org.apache.struts.action.RequestProcessor.processActionPerform 
(RequestProcessor.java:431)
	at org.apache.struts.action.RequestProcessor.process 
(RequestProcessor.java:236)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java: 
1196)
	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:747)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
	at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java: 
249)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
	at org.apache.catalina.security.SecurityUtil.execute 
(SecurityUtil.java:282)
	at org.apache.catalina.security.SecurityUtil.doAsPrivilege 
(SecurityUtil.java:165)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter 
(ApplicationFilterChain.java:257)
	at org.apache.catalina.core.ApplicationFilterChain.access$000 
(ApplicationFilterChain.java:55)
	at org.apache.catalina.core.ApplicationFilterChain$1.run 
(ApplicationFilterChain.java:161)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter 
(ApplicationFilterChain.java:157)
	at org.apache.catalina.core.StandardWrapperValve.invoke 
(StandardWrapperValve.java:263)
	at org.apache.catalina.core.StandardPipeline.invoke 
(StandardPipeline.java:551)
	at org.apache.catalina.core.StandardContextValve.invokeInternal 
(StandardContextValve.java:225)
	at org.apache.catalina.core.StandardContextValve.invoke 
(StandardContextValve.java:173)
	at org.apache.catalina.core.StandardPipeline.invoke 
(StandardPipeline.java:551)
	at org.apache.catalina.core.StandardHostValve.invoke 
(StandardHostValve.java:161)
	at org.apache.catalina.core.StandardPipeline.invoke 
(StandardPipeline.java:551)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java: 
933)
	at  
com.sun.enterprise.web.connector.httpservice.HttpServiceProcessor.proces 
s(HttpServiceProcessor.java:226)
	at com.sun.enterprise.web.HttpServiceWebContainer.service 
(HttpServiceWebContainer.java:2037)
Caused by: java.sql.SQLException: No operations allowed after  
connection closed.Connection was implicitly closed due to underlying  
exception/error:


** BEGIN NESTED EXCEPTION **

com.mysql.jdbc.CommunicationsException
MESSAGE: Communications link failure due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: Connection reset

STACKTRACE:

java.net.SocketException: Connection reset
	at java.net.SocketInputStream.read(SocketInputStream.java:113)
	at com.mysql.jdbc.util.ReadAheadInputStream.fill 
(ReadAheadInputStream.java:113)
	at  
com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNeces 
sary(ReadAheadInputStream.java:160)
	at com.mysql.jdbc.util.ReadAheadInputStream.read 
(ReadAheadInputStream.java:188)
	at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1902)
	at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2351)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2862)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)
	at com.mysql.jdbc.Connection.execSQL(Connection.java:2988)
	at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:4913)
	at com.sun.gjc.spi.ManagedConnectionFactory.isValidByAutoCommit 
(ManagedConnectionFactory.java:271)
	at com.sun.gjc.spi.ManagedConnectionFactory.isValid 
(ManagedConnectionFactory.java:235)
	at com.sun.gjc.spi.ManagedConnectionFactory.matchManagedConnections 
(ManagedConnectionFactory.java:190)
	at  
com.sun.enterprise.resource.AbstractConnectorAllocator.matchConnection 
(AbstractConnectorAllocator.java:93)
	at  
com.sun.enterprise.resource.IASNonSharedResourcePool.getUnenlistedResour 
ce(IASNonSharedResourcePool.java:392)
	at  
com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResource 
(IASNonSharedResourcePool.java:355)
	at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource 
(IASNonSharedResourcePool.java:250)
	at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool 
(PoolManagerImpl.java:211)
	at com.sun.enterprise.resource.PoolManagerImpl.getResource 
(PoolManagerImpl.java:172)
	at  
com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnectio 
n(ConnectionManagerImpl.java:258)
	at  
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection 
(ConnectionManagerImpl.java:193)
	at  
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection 
(ConnectionManagerImpl.java:122)
	at com.sun.gjc.spi.DataSource.getConnection(DataSource.java:70)
	at com.sun.dashboards.admin.ProductListingModel.getProductListing 
(ProductListingModel.java:61)
	at com.sun.dashboards.admin.ProductListingAction.execute 
(ProductListingAction.java:44)
	at org.apache.struts.action.RequestProcessor.processActionPerform 
(RequestProcessor.java:431)
	at org.apache.struts.action.RequestProcessor.process 
(RequestProcessor.java:236)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java: 
1196)
	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:747)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
	at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java: 
249)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
	at org.apache.catalina.security.SecurityUtil.execute 
(SecurityUtil.java:282)
	at org.apache.catalina.security.SecurityUtil.doAsPrivilege 
(SecurityUtil.java:165)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter 
(ApplicationFilterChain.java:257)
	at org.apache.catalina.core.ApplicationFilterChain.access$000 
(ApplicationFilterChain.java:55)
	at org.apache.catalina.core.ApplicationFilterChain$1.run 
(ApplicationFilterChain.java:161)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter 
(ApplicationFilterChain.java:157)
	at org.apache.catalina.core.StandardWrapperValve.invoke 
(StandardWrapperValve.java:263)
	at org.apache.catalina.core.StandardPipeline.invoke 
(StandardPipeline.java:551)
	at org.apache.catalina.core.StandardContextValve.invokeInternal 
(StandardContextValve.java:225)
	at org.apache.catalina.core.StandardContextValve.invoke 
(StandardContextValve.java:173)
	at org.apache.catalina.core.StandardPipeline.invoke 
(StandardPipeline.java:551)
	at org.apache.catalina.core.StandardHostValve.invoke 
(StandardHostValve.java:161)
	at org.apache.catalina.core.StandardPipeline.invoke 
(StandardPipeline.java:551)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java: 
933)
	at  
com.sun.enterprise.web.connector.httpservice.HttpServiceProcessor.proces 
s(HttpServiceProcessor.java:226)
	at com.sun.enterprise.web.HttpServiceWebContainer.service 
(HttpServiceWebContainer.java:2037)


** END NESTED EXCEPTION **



Last packet sent to the server was 2 ms ago.

STACKTRACE:

com.mysql.jdbc.CommunicationsException: Communications link failure  
due to underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: Connection reset

STACKTRACE:

java.net.SocketException: Connection reset
	at java.net.SocketInputStream.read(SocketInputStream.java:113)
	at com.mysql.jdbc.util.ReadAheadInputStream.fill 
(ReadAheadInputStream.java:113)
	at  
com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNeces 
sary(ReadAheadInputStream.java:160)
	at com.mysql.jdbc.util.ReadAheadInputStream.read 
(ReadAheadInputStream.java:188)
	at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1902)
	at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2351)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2862)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)
	at com.mysql.jdbc.Connection.execSQL(Connection.java:2988)
	at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:4913)
	at com.sun.gjc.spi.ManagedConnectionFactory.isValidByAutoCommit 
(ManagedConnectionFactory.java:271)
	at com.sun.gjc.spi.ManagedConnectionFactory.isValid 
(ManagedConnectionFactory.java:235)
	at com.sun.gjc.spi.ManagedConnectionFactory.matchManagedConnections 
(ManagedConnectionFactory.java:190)
	at  
com.sun.enterprise.resource.AbstractConnectorAllocator.matchConnection 
(AbstractConnectorAllocator.java:93)
	at  
com.sun.enterprise.resource.IASNonSharedResourcePool.getUnenlistedResour 
ce(IASNonSharedResourcePool.java:392)
	at  
com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResource 
(IASNonSharedResourcePool.java:355)
	at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource 
(IASNonSharedResourcePool.java:250)
	at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool 
(PoolManagerImpl.java:211)
	at com.sun.enterprise.resource.PoolManagerImpl.getResource 
(PoolManagerImpl.java:172)
	at  
com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnectio 
n(ConnectionManagerImpl.java:258)
	at  
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection 
(ConnectionManagerImpl.java:193)
	at  
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection 
(ConnectionManagerImpl.java:122)
	at com.sun.gjc.spi.DataSource.getConnection(DataSource.java:70)
	at com.sun.dashboards.admin.ProductListingModel.getProductListing 
(ProductListingModel.java:61)
	at com.sun.dashboards.admin.ProductListingAction.execute 
(ProductListingAction.java:44)
	at org.apache.struts.action.RequestProcessor.processActionPerform 
(RequestProcessor.java:431)
	at org.apache.struts.action.RequestProcessor.process 
(RequestProcessor.java:236)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java: 
1196)
	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:747)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
	at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java: 
249)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
	at org.apache.catalina.security.SecurityUtil.execute 
(SecurityUtil.java:282)
	at org.apache.catalina.security.SecurityUtil.doAsPrivilege 
(SecurityUtil.java:165)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter 
(ApplicationFilterChain.java:257)
	at org.apache.catalina.core.ApplicationFilterChain.access$000 
(ApplicationFilterChain.java:55)
	at org.apache.catalina.core.ApplicationFilterChain$1.run 
(ApplicationFilterChain.java:161)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter 
(ApplicationFilterChain.java:157)
	at org.apache.catalina.core.StandardWrapperValve.invoke 
(StandardWrapperValve.java:263)
	at org.apache.catalina.core.StandardPipeline.invoke 
(StandardPipeline.java:551)
	at org.apache.catalina.core.StandardContextValve.invokeInternal 
(StandardContextValve.java:225)
	at org.apache.catalina.core.StandardContextValve.invoke 
(StandardContextValve.java:173)
	at org.apache.catalina.core.StandardPipeline.invoke 
(StandardPipeline.java:551)
	at org.apache.catalina.core.StandardHostValve.invoke 
(StandardHostValve.java:161)
	at org.apache.catalina.core.StandardPipeline.invoke 
(StandardPipeline.java:551)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java: 
933)
	at  
com.sun.enterprise.web.connector.httpservice.HttpServiceProcessor.proces 
s(HttpServiceProcessor.java:226)
	at com.sun.enterprise.web.HttpServiceWebContainer.service 
(HttpServiceWebContainer.java:2037)


** END NESTED EXCEPTION **



Last packet sent to the server was 2 ms ago.
	at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2563)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2862)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)
	at com.mysql.jdbc.Connection.execSQL(Connection.java:2988)
	at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:4913)
	at com.sun.gjc.spi.ManagedConnectionFactory.isValidByAutoCommit 
(ManagedConnectionFactory.java:271)
	at com.sun.gjc.spi.ManagedConnectionFactory.isValid 
(ManagedConnectionFactory.java:235)
	at com.sun.gjc.spi.ManagedConnectionFactory.matchManagedConnections 
(ManagedConnectionFactory.java:190)
	at  
com.sun.enterprise.resource.AbstractConnectorAllocator.matchConnection 
(AbstractConnectorAllocator.java:93)
	at  
com.sun.enterprise.resource.IASNonSharedResourcePool.getUnenlistedResour 
ce(IASNonSharedResourcePool.java:392)
	at  
com.sun.enterprise.resource.IASNonSharedResourcePool.internalGetResource 
(IASNonSharedResourcePool.java:355)
	at com.sun.enterprise.resource.IASNonSharedResourcePool.getResource 
(IASNonSharedResourcePool.java:250)
	at com.sun.enterprise.resource.PoolManagerImpl.getResourceFromPool 
(PoolManagerImpl.java:211)
	at com.sun.enterprise.resource.PoolManagerImpl.getResource 
(PoolManagerImpl.java:172)
	at  
com.sun.enterprise.connectors.ConnectionManagerImpl.internalGetConnectio 
n(ConnectionManagerImpl.java:258)
	at  
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection 
(ConnectionManagerImpl.java:193)
	at  
com.sun.enterprise.connectors.ConnectionManagerImpl.allocateConnection 
(ConnectionManagerImpl.java:122)
	at com.sun.gjc.spi.DataSource.getConnection(DataSource.java:70)
	at com.sun.dashboards.admin.ProductListingModel.getProductListing 
(ProductListingModel.java:61)
	at com.sun.dashboards.admin.ProductListingAction.execute 
(ProductListingAction.java:44)
	at org.apache.struts.action.RequestProcessor.processActionPerform 
(RequestProcessor.java:431)
	at org.apache.struts.action.RequestProcessor.process 
(RequestProcessor.java:236)
	at org.apache.struts.action.ActionServlet.process(ActionServlet.java: 
1196)
	at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:747)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:860)
	at sun.reflect.GeneratedMethodAccessor70.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke 
(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java: 
249)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAsPrivileged(Subject.java:517)
	at org.apache.catalina.security.SecurityUtil.execute 
(SecurityUtil.java:282)
	at org.apache.catalina.security.SecurityUtil.doAsPrivilege 
(SecurityUtil.java:165)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter 
(ApplicationFilterChain.java:257)
	at org.apache.catalina.core.ApplicationFilterChain.access$000 
(ApplicationFilterChain.java:55)
	at org.apache.catalina.core.ApplicationFilterChain$1.run 
(ApplicationFilterChain.java:161)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter 
(ApplicationFilterChain.java:157)
	at org.apache.catalina.core.StandardWrapperValve.invoke 
(StandardWrapperValve.java:263)
	at org.apache.catalina.core.StandardPipeline.invoke 
(StandardPipeline.java:551)
	at org.apache.catalina.core.StandardContextValve.invokeInternal 
(StandardContextValve.java:225)
	at org.apache.catalina.core.StandardContextValve.invoke 
(StandardContextValve.java:173)
	at org.apache.catalina.core.StandardPipeline.invoke 
(StandardPipeline.java:551)
	at org.apache.catalina.core.StandardHostValve.invoke 
(StandardHostValve.java:161)
	at org.apache.catalina.core.StandardPipeline.invoke 
(StandardPipeline.java:551)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java: 
933)
	at  
com.sun.enterprise.web.connector.httpservice.HttpServiceProcessor.proces 
s(HttpServiceProcessor.java:226)
	at com.sun.enterprise.web.HttpServiceWebContainer.service 
(HttpServiceWebContainer.java:2037)


** END NESTED EXCEPTION **


	at com.mysql.jdbc.Connection.checkClosed(Connection.java:1842)
	at com.mysql.jdbc.Connection.createStatement(Connection.java:2840)
	at com.mysql.jdbc.Connection.createStatement(Connection.java:2822)
	at com.mysql.jdbc.Connection.getMetadataSafeStatement 
(Connection.java:3405)
	at com.mysql.jdbc.Connection.getTransactionIsolation(Connection.java: 
3500)
	at com.sun.gjc.spi.ManagedConnection.cleanup(ManagedConnection.java: 
193)
	... 47 more

Diagnostic Causes

Diagnostic Checks



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message