CAS连接超时问题,需要刷新一次才能登陆CAS is Unavailable There was an error trying to complete your request.
2012-09-14 11:30
691 查看
隔夜第二天来时候发现登陆链接失效,需要刷新一次才行,
CAS is Unavailable
There was an error trying to complete your request. Please notify your support desk or try again
Copyright © 2005 - 2010 Jasig, Inc. All rights reserved.
Powered by Jasig Central Authentication Service 3.4.11
日志信息如下:
2012-09-07 09:11:30,235 INFO [com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: [username: admin]
WHAT: PreparedStatementCallback; SQL [select passwd from esb_users where enabled=1 and username = ? ]; The last packet successfully received from the server was 60,130,736 milliseconds ago.
The last packet sent successfully to the server was 60,130,737 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 60,130,736 milliseconds ago. The last packet sent successfully to the server was 60,130,737 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.
ACTION: TICKET_GRANTING_TICKET_NOT_CREATED
APPLICATION: CAS
WHEN: Fri Sep 07 09:11:30 GMT+08:00 2012
CLIENT IP ADDRESS: 10.1.81.226
SERVER IP ADDRESS: 10.1.83.34
可使用autoReconnect=true 参数指定,链接不失效即可。
指定如下:
<bean id="casDataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://10.1.83.34:3306/icinga?autoReconnect=true</value>
</property>
<property name="username">
<value>icinga</value>
</property>
<property name="password">
<value>icinga</value>
</property>
</bean>
指定后还是有问题,日志报错:
严重: Servlet.service() for servlet cas threw exception
java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2503)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2953)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2942)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3485)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1960)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2114)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2696)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2105)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2264)
经过查找,似乎是mysql5已经不推荐使用autoReconnect接口了
而且如果使用proxool连接池的话,有属性用于链接前后的有效性检查。
于是,我就思考,dhcp应该也有类似的功能吧,最后加入了:
<property name="validationQuery">
<value>SELECT 1 FROM DUAL</value>
</property>
<property name="testOnBorrow">
<value>true</value>
</property>
果然好用了。
另外说说mysql的wait_timeout属性,默认是8小时,
为了测试这个问题,需要把这个值改小点,修改起来还真不好改。
set wait_timeout=5000;
发现我立马就丢失连接了,而且重新来一遍,值又回去了。
set global wait_timeout=5000;
似乎不好用
最后去/etc/my.cnf里设定了,后来发现确实有效了。
CAS is Unavailable
There was an error trying to complete your request. Please notify your support desk or try again
Copyright © 2005 - 2010 Jasig, Inc. All rights reserved.
Powered by Jasig Central Authentication Service 3.4.11
日志信息如下:
2012-09-07 09:11:30,235 INFO [com.github.inspektr.audit.support.Slf4jLoggingAuditTrailManager] - <Audit trail record BEGIN
=============================================================
WHO: [username: admin]
WHAT: PreparedStatementCallback; SQL [select passwd from esb_users where enabled=1 and username = ? ]; The last packet successfully received from the server was 60,130,736 milliseconds ago.
The last packet sent successfully to the server was 60,130,737 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 60,130,736 milliseconds ago. The last packet sent successfully to the server was 60,130,737 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.
ACTION: TICKET_GRANTING_TICKET_NOT_CREATED
APPLICATION: CAS
WHEN: Fri Sep 07 09:11:30 GMT+08:00 2012
CLIENT IP ADDRESS: 10.1.81.226
SERVER IP ADDRESS: 10.1.83.34
可使用autoReconnect=true 参数指定,链接不失效即可。
指定如下:
<bean id="casDataSource" class="org.apache.commons.dbcp.BasicDataSource">
<property name="driverClassName">
<value>com.mysql.jdbc.Driver</value>
</property>
<property name="url">
<value>jdbc:mysql://10.1.83.34:3306/icinga?autoReconnect=true</value>
</property>
<property name="username">
<value>icinga</value>
</property>
<property name="password">
<value>icinga</value>
</property>
</bean>
指定后还是有问题,日志报错:
严重: Servlet.service() for servlet cas threw exception
java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
at com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2503)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2953)
at com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2942)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3485)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1960)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2114)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2696)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2105)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2264)
经过查找,似乎是mysql5已经不推荐使用autoReconnect接口了
而且如果使用proxool连接池的话,有属性用于链接前后的有效性检查。
于是,我就思考,dhcp应该也有类似的功能吧,最后加入了:
<property name="validationQuery">
<value>SELECT 1 FROM DUAL</value>
</property>
<property name="testOnBorrow">
<value>true</value>
</property>
果然好用了。
另外说说mysql的wait_timeout属性,默认是8小时,
为了测试这个问题,需要把这个值改小点,修改起来还真不好改。
set wait_timeout=5000;
发现我立马就丢失连接了,而且重新来一遍,值又回去了。
set global wait_timeout=5000;
似乎不好用
最后去/etc/my.cnf里设定了,后来发现确实有效了。
相关文章推荐
- MOSS服务器场迁移1-有关切换登录用户时需要刷新一次才能成功的问题
- CAS登出后过一段时间登录,页面需要刷新问题
- Linux服务器需要登录之后才能连接无线问题?
- 有SelectedIndexChanged事件的控件的刷新问题-需要点击两下才能刷新的问题
- web网站css,js更新后客户浏览器缓存问题,需要刷新才能正常展示的解决办法
- 网页需要反复刷新才能打开网页的原因是卡巴斯基过滤的问题
- 解决SQL Server发布订阅时需要有实际的服务器名称才能连接到服务器的问题
- web网站css,js更新后客户浏览器缓存问题,需要刷新才能正常展示的解决办法
- 【转载】----web网站css,js更新后客户浏览器缓存问题,需要刷新才能正常展示的解决办法
- tableView中需要点击一次才能跳转的问题
- 【转载】web网站css,js更新后客户浏览器缓存问题,需要刷新才能正常展示的解决办法
- web网站css,js更新后客户浏览器缓存问题,需要刷新才能正常展示的解决办法
- 遇到问题---web程序访问MongoDB首次超时错误刷新后恢复---Nginx连接时间问题
- mybatis、spring xsd映射问题(否则需要连接外网才能启动)
- web网站css,js更新后客户浏览器缓存问题,需要刷新才能正常展示的解决办法
- SQL Server 2008及以上版本出现”SQL Server 复制需要有实际的服务器名称才能连接到服务器...“的问题解决
- AJAX进入方法设置Session,需要刷新页面jsp才能获取值的问题
- AO连接ArcGIS server 超时问题
- 解决SSH会话连接超时问题
- Mac OS X 下连接CMCC无法弹出登陆页面问题