Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1038 connectés 

  FORUM HardWare.fr
  Programmation
  Java

  [ Tomcat ] Communications link failure

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

[ Tomcat ] Communications link failure

n°1280297
devil1024
Posté le 10-01-2006 à 12:25:12  profilanswer
 

Bon je suis exposé à un probleme depuis un bon moment maintenant je suis censé mettre en prod un appli web (JSP Servlet - Tomcat - MySQL).
Je tourne en rond depuis 3 semaines et la j'arrive à la date d'échéance...
 
Le problème est quau bout de 8 heures de connexion la base de donnée ferme la connexion, j'ai tout essayé ->  pool de connexion DBCP (idem déco au bout de 8 heures) -> je suis actuellement sur c3p0 (mais c'est toujours pareil déco au bout de 8 heures).
J'ai donc bien l'impression que l'autoReconnect ne marche pas .
Bref la je sais vraiment plus ou chercher, je vous met l'exception renvoyé par Tomcat et ma configuration de c3p0 qui fonctionne mais qui ne semble pas assurer l'autoReconnect.
Sinon si vous pouviez m'orienter vers d'autre forum spécialisé sur Tomcat.
 
 
Exception :

Code :
  1. servletGST.domaine.RuntimeGSTException: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:
  2. ** BEGIN NESTED EXCEPTION **
  3. java.net.SocketException
  4. MESSAGE: Software caused connection abort: recv failed
  5. STACKTRACE:
  6. java.net.SocketException: Software caused connection abort: recv failed
  7. at java.net.SocketInputStream.socketRead0(Native Method)
  8. at java.net.SocketInputStream.read(Unknown Source)
  9. at com.mysql.jdbc.util.ReadAheadInputStream.fill(ReadAheadInputStream.java:113)
  10. at com.mysql.jdbc.util.ReadAheadInputStream.readFromUnderlyingStreamIfNecessary(ReadAheadInputStream.java:160)
  11. at com.mysql.jdbc.util.ReadAheadInputStream.read(ReadAheadInputStream.java:188)
  12. at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:1902)
  13. at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2351)
  14. at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2862)
  15. at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1571)
  16. at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1666)
  17. at com.mysql.jdbc.Connection.execSQL(Connection.java:2988)
  18. at com.mysql.jdbc.Connection.execSQL(Connection.java:2917)
  19. at com.mysql.jdbc.Statement.executeQuery(Statement.java:824)
  20. at com.mchange.v2.c3p0.impl.NewProxyStatement.executeQuery(NewProxyStatement.java:35)
  21. at servletGST.mapping.PersistanceManagerDB.findUtilisateurByLogin(PersistanceManagerDB.java:1173)
  22. at servletGST.web.ServletGST.doPost(ServletGST.java:69)
  23. at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
  24. at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
  25. at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
  26. at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
  27. at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
  28. at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
  29. at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
  30. at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
  31. at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
  32. at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
  33. at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:868)
  34. at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:663)
  35. at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
  36. at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
  37. at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
  38. at java.lang.Thread.run(Unknown Source)
  39. ** END NESTED EXCEPTION **
  40. Last packet sent to the server was 844 ms ago.
  41. servletGST.mapping.PersistanceManagerDB.findUtilisateurByLogin(PersistanceManagerDB.java:1181)
  42. servletGST.web.ServletGST.doPost(ServletGST.java:69)
  43. javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
  44. javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


 
Config c3p0 :
 
méthode init :

Code :
  1. public void init() throws ServletException{
  2.   try {
  3.    //récupération de la source de donnée
  4.    //Pool de connexions c3p0
  5.    Context initCtx = new InitialContext();
  6.    ds = (DataSource) initCtx.lookup("java:comp/env/jdbc/c3p0Pool" );
  7.   } catch (Exception e) {
  8.    throw new RuntimeGSTException(
  9.      "ERREUR - chargement data source. \n" + e);
  10.   }


 
Config server.xml :
 

Code :
  1. <Resource
  2.   auth="Container"
  3.   description="DB Connection"
  4.   driverClass="com.mysql.jdbc.Driver"
  5.   maxPoolSize="4"
  6.   minPoolSize="2"
  7.   acquireIncrement="1"
  8.   name="jdbc/c3p0Pool"
  9.   user="root"
  10.   password="admin"
  11.   factory="org.apache.naming.factory.BeanFactory"
  12.   type="com.mchange.v2.c3p0.ComboPooledDataSource"
  13.   jdbcUrl="jdbc:mysql://localhost:3306/db_support?autoReconnect=true" />
  14.  
  15.  <Context
  16.             path="/SGST-0.7"
  17.             reloadable="true">
  18.           <ResourceLink
  19.             global="jdbc/c3p0Pool"
  20.             name="jdbc/c3p0Pool"
  21.             type="javax.sql.DataSource"/>
  22.         </Context>

mood
Publicité
Posté le 10-01-2006 à 12:25:12  profilanswer
 


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  Java

  [ Tomcat ] Communications link failure

 

Sujets relatifs
Servlet Java Tomcat cookieProbleme d'ouverture de pages jsp avec tomcat.
Passer un bean avec html:linktomcat stockage
[1/2 RESOLU] Problème installation Tomcat 5[J2EE][Tomcat] ServletException[Résolu]
Lancement d'un serveur TomcatTomcat et Struts
Link checker me detecte des liens vers des pages en erreur 404[Struts] Différence de comportement entre Tomcat et Weblogic...
Plus de sujets relatifs à : [ Tomcat ] Communications link failure


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR