CAS连接超时问题,需要刷新一次才能登陆CAS is Unavailable There was an error trying to complete your request.

隔夜第二天来时候发现登陆链接失效,需要刷新一次才行

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里设定了,后来发现确实有效了。


  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 4
    评论
503 Service Unavailable 错误是指当前没有可用的服务器来处理用户发送的请求。这个错误通常发生在服务器暂时无法处理请求的情况下,可能是因为服务器过载、维护、故障或者其他技术问题。 当用户在浏览器上请求访问特定网站时,浏览器会向服务器发送一个请求,服务器需要响应并返回相应的网页或者数据。但当服务器暂时无法提供服务时,就会返回状态码503。 有几种可能导致503错误的原因。首先,服务器可能正处于过载状态,无法处理额外的请求。这可能是因为用户量过大、流量剧增或者其他资源限制问题。在这种情况下,用户只需稍后再次尝试访问网站。 其次,服务器也可能在进行维护、升级或修复故障等操作。这时服务器会临时关闭,无法处理请求。用户只需等待一段时间,直到维护工作完成后再次尝试访问。 此外,网络连接问题也可能导致503错误。例如,用户的网络可能存在问题,或者用户的ISP(互联网服务提供商)或云服务供应商等网络基础设施出现故障。在这种情况下,用户可以尝试通过改变网络连接或者等待供应商解决问题来解决。 最后,应用程序错误或配置问题可能是导致503错误的原因。这可能包括服务器应用程序的bug、错误的配置或者其他软件问题。在这种情况下,服务器管理员需要检查日志并进行故障排除来解决问题。 总之,当用户面对503 Service Unavailable 错误时,应该首先确认自己的网络连接是否正常。如果网络连接正常,那十有八九是服务器端的问题,可能是服务器过载、维护、故障或者其他技术问题。用户只需要稍后再次尝试访问或联系服务器管理员来解决问题

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

day walker

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值