[opencms-dev] Closed PreparedStatement after long inactivity of opencms
Achim Westermann
achim.westermann at gmx.de
Tue Sep 29 17:58:50 CEST 2009
Hi Tarun,
your connections have been closed I guess. You should turn on eviction
in the configuration file opencms.properties.
Example:
db.pool.default.testWhileIdle=true
db.pool.default.timeBetweenEvictionRuns=720000
db.pool.default.numTestsPerEvictionRun=40
db.pool.default.minEvictableIdleTime=360000
Also read the comments in that file to know what those settings do.
HTH,
Achim
Tarun Chaudhary wrote:
> Hello All,
> I am using OpenCms version 7.0.5 with mysql Db.
> I run it under tomcat version 5.5.27 . When I leave the opencms inactive
> for a long time specially at nights when no one access the opencms, in
> the early morning, the first few access requests gives following exception.
> I understand its a Db connection statement problem and I understand
> opencms uses dbcp connection pool and pool for prepared statements, to
> eliminate few causes, I disabled the prepared statement pooling by
> making db.statements.default.pooling=false in opencms.properties but the
> problem still persists. I have seen various people are getting the same
> exception but I couldnt find the solution online.
>
> Before digging down myself deep into the problem, was just wondering
> does anyone knows the real cause and the fix to this problem?
>
>
>
> org.opencms.db.CmsDbSqlException: Error reading the user "Guest".
>
> at
> org.opencms.db.CmsDbSqlException.createException(CmsDbSqlException.java:116)
>
> at org.opencms.db.CmsDbContext.throwException(CmsDbContext.java:238)
>
> at org.opencms.db.CmsDbContext.report(CmsDbContext.java:212)
>
> at org.opencms.db.CmsSecurityManager.readUser(CmsSecurityManager.java:4336)
>
> at org.opencms.main.OpenCmsCore.initCmsObject(OpenCmsCore.java:1911)
>
> at org.opencms.main.OpenCmsCore.initCmsObject(OpenCmsCore.java:827)
>
> at org.opencms.main.OpenCmsCore.initCmsObject(OpenCmsCore.java:852)
>
> at org.opencms.main.OpenCms.initCmsObject(OpenCms.java:606)
>
> at
> com.switchfire.cms.webservices.CmsServiceInitializer.getCmsObject(CmsServiceInitializer.java:67)
>
> at
> com.switchfire.cms.webservices.CmsServiceInitializer.login(CmsServiceInitializer.java:76)
>
> at
> com.switchfire.cms.servlet.CmsClientAlertServlet.doProcess(CmsClientAlertServlet.java:47)
>
> at com.switchfire.cms.servlet.BaseCmsServlet.doPost(BaseCmsServlet.java:32)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
>
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
>
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
>
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
>
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
>
> at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
>
> at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
>
> at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
>
> at
> org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
>
> at
> org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895)
>
> at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
>
> at java.lang.Thread.run(Thread.java:619)
>
> Caused by: org.opencms.db.CmsDbSqlException: An SQL error occurred when
> executing the following query:
> com.mysql.jdbc.PreparedStatement at 2eebc11d: statement has been closed, no
> further internal information available.
>
> at org.opencms.db.generic.CmsUserDriver.readUser(CmsUserDriver.java:1379)
>
> at org.opencms.db.CmsDriverManager.readUser(CmsDriverManager.java:6849)
>
> at org.opencms.db.CmsSecurityManager.readUser(CmsSecurityManager.java:4334)
>
> ... 25 more
>
> Caused by: com.mysql.jdbc.CommunicationsException: Communications link
> failure due to underlying exception:
>
> ** BEGIN NESTED EXCEPTION **
>
> java.net.SocketException
>
> MESSAGE: Broken pipe
>
> STACKTRACE:
>
> java.net.SocketException: Broken pipe
>
> at java.net.SocketOutputStream.socketWrite0(Native Method)
>
> at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:92)
>
> at java.net.SocketOutputStream.write(SocketOutputStream.java:136)
>
> at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
>
> at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
>
> at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2744)
>
> at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1612)
>
> at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
>
> at com.mysql.jdbc.Connection.execSQL(Connection.java:3256)
>
> at
> com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313)
>
> at
> com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1448)
>
> at
> org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
>
> at org.opencms.db.generic.CmsUserDriver.readUser(CmsUserDriver.java:1362)
>
> at org.opencms.db.CmsDriverManager.readUser(CmsDriverManager.java:6849)
>
> at org.opencms.db.CmsSecurityManager.readUser(CmsSecurityManager.java:4334)
>
> at org.opencms.main.OpenCmsCore.initCmsObject(OpenCmsCore.java:1911)
>
> at org.opencms.main.OpenCmsCore.initCmsObject(OpenCmsCore.java:827)
>
> at org.opencms.main.OpenCmsCore.initCmsObject(OpenCmsCore.java:852)
>
> at org.opencms.main.OpenCms.initCmsObject(OpenCms.java:606)
>
> at
> com.switchfire.cms.webservices.CmsServiceInitializer.getCmsObject(CmsServiceInitializer.java:67)
>
> at
> com.switchfire.cms.webservices.CmsServiceInitializer.login(CmsServiceInitializer.java:76)
>
> at
> com.switchfire.cms.servlet.CmsClientAlertServlet.doProcess(CmsClientAlertServlet.java:47)
>
> at com.switchfire.cms.servlet.BaseCmsServlet.doPost(BaseCmsServlet.java:32)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
>
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
>
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
>
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
>
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
>
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
>
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
>
> at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
>
> at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
>
> at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773)
>
> at
> org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703)
>
> at
> org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895)
>
> at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
>
> at java.lang.Thread.run(Thread.java:619)
>
>
>
> ** END NESTED EXCEPTION **
>
>
>
>
>
> Last packet sent to the server was 1 ms ago.
>
> at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:2759)
>
> at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1612)
>
> at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
>
> at com.mysql.jdbc.Connection.execSQL(Connection.java:3256)
>
> at
> com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313)
>
> at
> com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1448)
>
> at
> org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
>
> at org.opencms.db.generic.CmsUserDriver.readUser(CmsUserDriver.java:1362)
>
> ... 27 more
>
>
>
> Regards,
>
> Tarun
>
>
> ------------------------------------------------------------------------
>
>
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
More information about the opencms-dev
mailing list