db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rafal Markut" <rafal.mar...@mediawave.de>
Subject Problem with DB connection
Date Tue, 11 Jul 2006 13:19:26 GMT
Hello,

I use Turbine 2.3.2 and Torque 3.1.1, Tomcat and MySQL 4.1.7.

Very often I got the exception:
Caused by: org.apache.torque.TorqueException: java.sql.SQLException: Lost 
connection to server during query
or
java.net.SocketException: Software caused connection abort: recv failed.

When I make first DB operation (in this case takes user-data from the DB 
during loggin) then it comes one of these exceptions.
It happens always in the morning - when application was not used ca. 12-15h. 
When the application is used then everything works perfectly. But ... when 
it isn't used some time (like 5-10h) and then somebody make first DB 
operation  ... then this exception appears.
When after that I restart the tomcat then everything works fine.

MySQL must be OK because other software is using it and there are no 
problems.

I made 2 different applications, both of them are on differend servers and 
both have this same problem.
I don't think that it's a bug in the turbine or torque because I couldn't 
find any info about it.
Maybe my configuration is wrong ?

What is strange ... when I put jar with MySQL driver into /WEB-INF/lib then 
I got exception that it cannot find a driver. I had to place it under: 
tomcat/common/endorsed.

I tried with following MySQL drivers: mm.mysql-2.0.4.jar and 
mysql-connector-java-3.1.13.zip.

I'd very greateful for any help. I really don't know what can I do with it.

Below there are that exception and parts of my configuration files.

Caused by: org.apache.torque.TorqueException: java.sql.SQLException: Lost 
connection to server during query
        at 
org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:717)
        at org.apache.torque.Torque.getConnection(Torque.java:268)
        at 
org.apache.torque.util.Transaction.beginOptional(Transaction.java:80)
        at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1195)
        at 
org.apache.turbine.om.security.peer.TurbineUserPeer.doSelect(TurbineUserPeer.java:383)
        at 
org.apache.turbine.om.security.peer.TurbineUserPeer.doSelect(TurbineUserPeer.java:347)
        at 
org.apache.turbine.services.security.db.DBUserManager.accountExists(DBUserManager.java:104)
        ... 42 more
Caused by: java.sql.SQLException: Lost connection to server during query
        at org.gjt.mm.mysql.Connection.execSQL(Connection.java:889)
        at org.gjt.mm.mysql.Connection.execSQL(Connection.java:815)
        at org.gjt.mm.mysql.Connection.setAutoCommit(Connection.java:463)
        at 
org.apache.commons.dbcp.cpdsadapter.ConnectionImpl.setAutoCommit(ConnectionImpl.java:325)
        at 
org.apache.commons.dbcp.datasources.SharedPoolDataSource.setupDefaults(SharedPoolDataSource.java:212)
        at 
org.apache.commons.dbcp.datasources.InstanceKeyDataSource.getConnection(InstanceKeyDataSource.java:654)
        at 
org.apache.commons.dbcp.datasources.InstanceKeyDataSource.getConnection(InstanceKeyDataSource.java:615)
        at 
org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:705)
        ... 48 more



or



Caused by: org.apache.torque.TorqueException: 
com.mysql.jdbc.CommunicationsException: Communications link failure due to 
underlying exception:

** BEGIN NESTED EXCEPTION **

java.net.SocketException
MESSAGE: Software caused connection abort: recv failed

STACKTRACE:

java.net.SocketException: Software caused connection abort: recv failed
 at java.net.SocketInputStream.socketRead0(Native Method)
 at java.net.SocketInputStream.read(SocketInputStream.java:129)
 at 
com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
 at 
com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
 at 
com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
 at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1931)
 at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2380)
 at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2909)
 at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1600)
 at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1695)
 at com.mysql.jdbc.Connection.execSQL(Connection.java:2998)
 at com.mysql.jdbc.Connection.setAutoCommit(Connection.java:4959)
 at 
org.apache.commons.dbcp.cpdsadapter.ConnectionImpl.setAutoCommit(ConnectionImpl.java:325)
 at 
org.apache.commons.dbcp.datasources.SharedPoolDataSource.setupDefaults(SharedPoolDataSource.java:212)
 at 
org.apache.commons.dbcp.datasources.InstanceKeyDataSource.getConnection(InstanceKeyDataSource.java:654)
 at 
org.apache.commons.dbcp.datasources.InstanceKeyDataSource.getConnection(InstanceKeyDataSource.java:615)
 at org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:705)
 at org.apache.torque.Torque.getConnection(Torque.java:268)
 at org.apache.torque.util.Transaction.beginOptional(Transaction.java:80)
 at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1195)
 at 
org.apache.turbine.om.security.peer.TurbineUserPeer.doSelect(TurbineUserPeer.java:383)
 at 
org.apache.turbine.om.security.peer.TurbineUserPeer.doSelect(TurbineUserPeer.java:347)
 at 
org.apache.turbine.services.security.db.DBUserManager.accountExists(DBUserManager.java:104)
 at 
org.apache.turbine.services.security.BaseSecurityService.accountExists(BaseSecurityService.java:672)
 at 
org.apache.turbine.services.security.TurbineSecurity.accountExists(TurbineSecurity.java:244)
 at 
de.mediawave.citrix.dashboard.modules.actions.LoginUserAction.doLogin(LoginUserAction.java:40)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at 
org.apache.turbine.util.velocity.VelocityActionEvent.executeEvents(VelocityActionEvent.java:135)
 at 
org.apache.turbine.util.velocity.VelocityActionEvent.perform(VelocityActionEvent.java:78)
 at 
org.apache.turbine.modules.actions.VelocityAction.perform(VelocityAction.java:72)
 at org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:99)
 at 
org.apache.turbine.modules.pages.DefaultPage.doBuild(DefaultPage.java:113)
 at org.apache.turbine.modules.Page.build(Page.java:53)
 at org.apache.turbine.modules.PageLoader.exec(PageLoader.java:101)
 at org.apache.turbine.Turbine.doGet(Turbine.java:789)
 at org.apache.turbine.Turbine.doPost(Turbine.java:884)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
 at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
 at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
 at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
 at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
 at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 at 
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
 at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
 at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
 at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
 at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
 at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
 at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
 at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
 at 
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
 at 
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
 at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
 at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
 at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
 at 
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
 at 
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
 at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
 at java.lang.Thread.run(Thread.java:534)


** END NESTED EXCEPTION **



Last packet sent to the server was 16 ms ago.
 at org.apache.torque.TorqueInstance.getConnection(TorqueInstance.java:717)
 at org.apache.torque.Torque.getConnection(Torque.java:268)
 at org.apache.torque.util.Transaction.beginOptional(Transaction.java:80)
 at org.apache.torque.util.BasePeer.doSelect(BasePeer.java:1195)
 at 
org.apache.turbine.om.security.peer.TurbineUserPeer.doSelect(TurbineUserPeer.java:383)
 at 
org.apache.turbine.om.security.peer.TurbineUserPeer.doSelect(TurbineUserPeer.java:347)
 at 
org.apache.turbine.services.security.db.DBUserManager.accountExists(DBUserManager.java:104)
 ... 42 more


Torque.properties:

torque.database.default = myapp
torque.database.myapp.adapter = mysql

# Using commons-dbcp
torque.dsfactory.myapp.factory = 
org.apache.torque.dsfactory.SharedPoolDataSourceFactory
torque.dsfactory.myapp.connection.driver = org.gjt.mm.mysql.Driver
torque.dsfactory.myapp.connection.url = 
jdbc:mysql://localhost/dashboard?useUnicode\=true&characterEncoding\=UTF-8
torque.dsfactory.myapp.connection.user = myappuser
torque.dsfactory.myapp.connection.password = myapppassword




Part of TurbineResources.properties:

services.ComponentService.name = torque
services.ComponentService.torque.classname = org.apache.torque.Torque
services.ComponentService.torque.config = /WEB-INF/conf/Torque.properties

with best regards,
Rafal 


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


Mime
View raw message