LibrePlan Forum

Full Version: jdbc connection problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
libreplan_1.4.1.tar.gz
mysql-connector-java-5.1.37-bin.jar
tomcat7
Ubuntu 14.04.4 LTS
java version "1.7.0_111"
OpenJDK Runtime Environment (IcedTea 2.6.7) (7u111-2.6.7-0ubuntu0.14.04.3)
OpenJDK 64-Bit Server VM (build 24.111-b01, mixed mode)

<Context>
<Resource
        name="jdbc/libreplan-ds"
        auth="Container"
        type="javax.sql.DataSource"
        driverClassName="com.mysql.jdbc.Driver"
        url="jdbc:mysql://localhost:3306/libreplan"
        autoReconnect="true"
        removeAbandoned="true"
        removeAbandonedTimeout="60"
        logAbandoned="true"
        username="******"
        password="*****"
        maxActive="100"
        maxIdle="30"
        maxWait="10000"
        validationQuery="Select 1" />
</Context>

my problem is that after libreplan is started in tomcat after some time it will not connect to the database and I get the following error. I cannot use the app again until I restart tomcat. I have scoured the interned and tried all types recommendations and nothing changes it.

ERROR:
Caused by: org.springframework.transaction.CannotCreateTransactionException: Could not open Hibernate Session for transaction; nested exception is org.hibernate.TransactionException: JDBC begin failed:
        at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:599)
        at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:374)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:263)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
        at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
        at com.sun.proxy.$Proxy40.getConfigurationWithReadOnlyTransaction(Unknown Source)
        at org.libreplan.web.common.LoginController.getLoginValue(LoginController.java:56)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.zkforge.apache.commons.el.ArraySuffix.evaluate(ArraySuffix.java:317)
        ... 93 more
Caused by: org.hibernate.TransactionException: JDBC begin failed:
        at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:68)
        at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1327)
        at org.springframework.orm.hibernate3.HibernateTransactionManager.doBegin(HibernateTransactionManager.java:558)
        ... 105 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed after connection closed.
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
        at com.mysql.jdbc.Util.getInstance(Util.java:386)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:989)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:975)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:920)
        at com.mysql.jdbc.ConnectionImpl.throwConnectionClosedException(ConnectionImpl.java:1311)
        at com.mysql.jdbc.ConnectionImpl.checkClosed(ConnectionImpl.java:1303)
        at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:5309)
        at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126)
        at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109)
        at org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:80)
        at com.sun.proxy.$Proxy17.setAutoCommit(Unknown Source)
        at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:63)
        ... 107 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 44,095,282 milliseconds ago.  The last packet sent successfully to the server was 44,095,282 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
Any help, I have tried everything