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


在CUPS操作期间遇到的 `service-error-service-unavailable` 错误通常与CUPS服务的配置或运行状态有关。以下是一些可能的解决方案: 1. **检查CUPS服务状态**: 确保CUPS服务正在运行。可以使用以下命令来检查服务状态: ```bash systemctl status cups ``` 如果服务没有运行,可以使用以下命令启动它: ```bash sudo systemctl start cups ``` 2. **重启CUPS服务**: 有时候简单地重启CUPS服务可以解决一些临时性的问题: ```bash sudo systemctl restart cups ``` 3. **检查CUPS配置文件**: 确保CUPS的配置文件 `/etc/cups/cupsd.conf` 没有错误。特别是检查监听的地址和端口是否正确,例如: ``` Listen localhost:631 ``` 如果需要从网络上的其他机器访问,可能需要更改为: ``` Port 631 ``` 4. **检查打印机配置**: 确保打印机配置正确,并且没有语法错误。检查 `/etc/cups/printers.conf` 文件中的配置。 5. **检查日志文件**: 查看CUPS的日志文件 `/var/log/cups/error_log` 以获取更多关于错误的详细信息。 6. **重新安装CUPS**: 如果上述方法都无法解决问题,可以尝试重新安装CUPS: ```bash sudo apt-get remove cups sudo apt-get install cups ``` 7. **检查网络连接**: 如果CUPS服务是通过网络访问的,请确保网络连接正常,并且没有防火墙规则阻止访问CUPS服务使用的端口(通常是631)。 8. **检查SELinux或AppArmor**: 如果系统上启用了SELinux或AppArmor,它们可能会阻止CUPS服务正常工作。可以暂时禁用这些安全模块来测试是否是它们导致的问题。 通过以上步骤,应该能够解决大部分导致 `service-error-service-unavailable` 错误的情况。如果问题仍然存在,可能需要进一步检查具体的环境配置或寻求社区的帮助。
评论 4
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

day walker

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

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

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

打赏作者

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

抵扣说明:

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

余额充值