JEEBBS论坛 » BUG反馈 » HTTP Status 500 - Request processing failed; nested exception is org.springframework.transaction.Can
主题 : HTTP Status 500 - Request processing failed; nested exception is org.springframework.transaction.Can |
级别: 秀才
|
1# 发表于:2013-12-11 09:06:11 IP:120.169.*.*
|
||||
---|---|---|---|---|---|
级别: 状元
|
2# 发表于:2013-12-11 09:12:16 IP:115.251.*.*
java.io.EOFException: Can not read response from server. Expected to read 4 bytes, read 0 bytes before connection was unexpectedly lost.
com.mysql.jdbc.MysqlIO.readFully(MysqlIO.java:2475) com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2927) com.mysql.jdbc.MysqlIO.reuseAndReadPacket(MysqlIO.java:2916) |
||
---|---|---|---|
级别: 状元
|
3# 发表于:2013-12-11 09:14:24 IP:115.251.*.*
连接池设置
<Resource name= "jdbc/song " type= "javax.sql.DataSource " driverClassName= "com.mysql.jdbc.Driver " password= "haishui " maxIdle= "20 " 你改下你连接池设置 |
||
---|---|---|---|
级别: 状元
|
4# 发表于:2013-12-11 09:19:38 IP:115.251.*.*
原因大致为:当修改系统日期后Mysql自动关闭已打开的连接,可以数据库连接池(DBCP)还认为这些连接是活动的,如果这时有请求(需要执行读写数据库的操作),连接池就用一个连接去操作数据库,而这个连接在Mysql的连接池中并不存在,所以会出现以上的异常。如果一个连接在和Mysql建立连接时能检查就不会有这样的问题了。
一个数据库连接池proxool,它有两个属性:一个是test-before-use,还有一个是test-after-use,这两个属性就是在使用前和使用后都要进行对连接的检查,如果连接无效就扔掉再创建一个新的连接,它们的解释如下: test-before-use: If you set this to true then each connection is tested (with whatever is defined in house-keeping-test-sql) before being served. If a connection fails then it is discarded and another one is picked. If all connections fail a new one is built. If that one fails then you get an SQLException saying so. test-after-use: If you set this to true then each connection is tested (with whatever is defined in house-keeping-test-sql) after it is closed (that is, returned to the connection pool). If a connection fails then it is discarded. 于是我们在项目中换上proxool的连接池,再运行并访问系统,更改系统时间,再访问,不但如此,proxool的连接池中的连接的数量,活动数以及每个连接的的具体情况都可以一目了然的看到 |
||
---|---|---|---|
级别: 总版主
|
8# 发表于:2013-12-11 09:44:27 IP:115.251.*.*
这需要你研究数据库方面的知识了,你用的mysql数据库版本比较低的吧?你也可以换个mysql*的没你这问题
|
||
---|---|---|---|
级别: 秀才
|
9# 发表于:2013-12-11 09:46:25 IP:120.169.*.*
是tomcat7的server.xml的<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" /> 吗? |
||
---|---|---|---|