Presto log in page not displaying

matthew.t.short
User offline. Last seen 1 year 5 weeks ago. Offline
Joined: 11/01/2010
Points: 31

I just tried to log into our Presto page and the log in page does not appear, it is just a black window.  If I hit refresh the login screen will appear for a flash and then return to the black screen.

I checked the log file in Presto Install/Presto2.70\server\apache-tomcat-5.5.20\logs and the only file updated is the stdout_2011-309.log with the following information:

2011-03-14 19:03:50,324 ERROR [com.jackbe.jbp.sas.sg.controller.ServiceGatewayController] - <Unable to connect to Presto repository. Reason = org.springframework.dao.DataAccessResourceFailureException: JDO operation: The last packet successfully received from the server was 279,877,625 milliseconds ago.  The last packet sent successfully to the server was 279,877,641 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.; SQL []; The last packet successfully received from the server was 279,877,625 milliseconds ago.  The last packet sent successfully to the server was 279,877,641 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.; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 279,877,625 milliseconds ago.  The last packet sent successfully to the server was 279,877,641 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.>
 

This is the second time this has happened.  To fix it I just restart the server and test our datasources and everything is fine.  This has never happened before, any help would be appreciated.

Thanks

0
Your rating: None
Mike Bennett
User offline. Last seen 3 weeks 4 days ago. Offline
Joined: 12/09/2009
Points: 53

You are using MySQL for your Presto Repository, right?  Your error messages seems to indicate so because it references "Connector/J".

MySQL has a "feature" where the MySQL server will close the connections if there has been no activity after a configurable amount of time.  By default this is 24 hours.

You error message says the last communication on that connection was 279,877,625 milliseconds ago.  That's 3 days, so its highly likely that your MySQL server has terminated the connection.

As the error message indicates, one option you have is to configure MySQL to have a high "wait_timeout" option.  You can look at the MySQL docs for more info on that.

The better option is to configure Presto's connection pool so it validates that the connection is still valid.  In 2.7, the pool is configured in two files, rdsApplicationContext.xml and userRepositoryApplicationContext.xml (both are in TOMCAT-HOME/webapps/presto/WEB-INF/classes.).  To do that, find the "dataSource" bean definition in each file and make it look like this:

 

   <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">

        <property name="driverClassName" value="${jdbc.driverClassName}"/>

        <property name="url" value="${jdbc.url}"/>

        <property name="username" value="${jdbc.username}"/>

        <property name="password" value="${jdbc.password}"/>

        

        <property name="initialSize" value="${pool.initialSize}"/>

        <property name="minIdle" value="${pool.minIdle}"/>

        <property name="maxIdle" value="${pool.maxIdle}"/>

        <property name="maxActive" value="${pool.maxActive}"/>

        <!-- The maximum number of milliseconds that the pool will wait 

          (when there are no available connections) for a connection to be 

           returned before throwing an exception, or -1 to wait indefinitely.

        -->   

        <property name="maxWait" value="${pool.maxWait}"/>

 

        <property name="validationQuery" value="${pool.validationQuery}"/>

        <property name="validationCallTimeout" value="${pool.validationCallTimeout}" />

        <property name="testWhileIdle" value="${pool.testWhileIdle}" />

 

        <property name="timeBetweenEvictionRunsMillis" value="${pool.timeBetweenEvictionRunsMillis}"/>

        <property name="numTestsPerEvictionRun" value="${pool.numTestsPerEvictionRun}"/>

        <property name="minEvictableIdleTimeMillis" value="${pool.minEvictableIdleTimeMillis}" />

    </bean>

    

What you are doing is adding connection pool parameters (the "${pool.*} entries).  The VALUES for the "pool.*" properties then need to be added to the corresponding rdsJdbc.properties and userRepositoryJdbc.properties files.  For MySQL add these properties:
 

pool.initialSize=0

pool.minIdle=0

pool.maxIdle=8

pool.maxActive=30

pool.maxWait=10000

pool.validationCallTimeout=0

pool.testWhileIdle=true

pool.timeBetweenEvictionRunsMillis=300000

pool.numTestsPerEvictionRun=8

pool.minEvictableIdleTimeMillis=900000

pool.validationQuery=select 1 from dual

 

Save and re-start presto.

 

Mike Bennett
User offline. Last seen 3 weeks 4 days ago. Offline
Joined: 12/09/2009
Points: 53

One other thing to note: I gathered from your post you are using version 2.7. 

Presto 3.0 and later already has the datasources configured properly to avoid this.  So, users on these versions should have not have these issues.  Consider this a slight push to upgrade!

matthew.t.short
User offline. Last seen 1 year 5 weeks ago. Offline
Joined: 11/01/2010
Points: 31

Thanks for the help, I will check it out.