这是日志。在没有任何交互的一天之后出现问题。它是异步邮件插件吗?这是一个设置吗?谁可以帮助我,任何帮助表示赞赏。
Grails 2.4.0,ubuntu 16.04
The last packet successfully received from the server was 278.019 milliseconds ago. The last packet sent successfully to the server was 218.021 milliseconds ago.
ERROR 2017-01-19 10:37:47,642 interceptor.TransactionInterceptor Application exception overridden by rollback exception
org.springframework.dao.RecoverableDataAccessException: Hibernate operation: could not prepare statement; SQL [update async_mail_mess set status=? where end_date<? and (status=? or status=?)]; Communications link failure
The last packet successfully received from the server was 278.019 milliseconds ago. The last packet sent successfully to the server was 218.021 milliseconds ago.; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 278.019 milliseconds ago. The last packet sent successfully to the server was 218.021 milliseconds ago.
at grails.plugin.asyncmail.AsynchronousMailPersistenceService$_updateExpiredMessages_closure4.doCall(AsynchronousMailPersistenceService.groovy:66)
at org.grails.datastore.gorm.GormStaticApi.withTransaction(GormStaticApi.groovy:814)
at org.grails.datastore.gorm.GormStaticApi.withTransaction(GormStaticApi.groovy:714)
at grails.plugin.asyncmail.AsynchronousMailPersistenceService.updateExpiredMessages(AsynchronousMailPersistenceService.groovy:63)
at grails.plugin.asyncmail.ExpiredMessagesCollectorJob.execute(ExpiredMessagesCollectorJob.groovy:13)
at grails.plugins.quartz.GrailsJobFactory$GrailsJob.execute(GrailsJobFactory.java:104)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
The last packet successfully received from the server was 278.019 milliseconds ago. The last packet sent successfully to the server was 218.021 milliseconds ago.
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1116)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3853)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2471)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2651)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2671)
at com.mysql.jdbc.ConnectionImpl.setAutoCommit(ConnectionImpl.java:5024)
... 8 more
Caused by: java.net.SocketException: Broken pipe (Write failed)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
at java.net.SocketOutputStream.write(SocketOutputStream.java:153)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3834)
... 12 more
ERROR 2017-01-19 10:37:47,642 listeners.ExceptionPrinterJobListener Exception occurred in job: Grails Job
org.quartz.JobExecutionException: org.springframework.transaction.TransactionSystemException: Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: rollback failed [See nested exception: org.springframework.transaction.TransactionSystemException: Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: rollback failed]
at grails.plugins.quartz.GrailsJobFactory$GrailsJob.execute(GrailsJobFactory.java:111)
at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)
Caused by: org.springframework.transaction.TransactionSystemException: Could not roll back Hibernate transaction; nested exception is org.hibernate.TransactionException: rollback failed
at grails.plugin.asyncmail.ExpiredMessagesCollectorJob.execute(ExpiredMessagesCollectorJob.groovy:13)
at grails.plugins.quartz.GrailsJobFactory$GrailsJob.execute(GrailsJobFactory.java:104)
... 2 more
Caused by: org.hibernate.TransactionException: rollback failed
... 4 more
Caused by: org.hibernate.TransactionException: unable to rollback against JDBC connection
... 4 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communications link failure during rollback(). Transaction resolution unknown.
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1013)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:987)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:982)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:927)
at com.mysql.jdbc.ConnectionImpl.rollback(ConnectionImpl.java:4757)
... 4 more
ERROR 2017-01-19 10:38:09,620 spi.SqlExceptionHelper Communications link failure
答案 0 :(得分:0)
可能是因为两个原因
1。)您的Grails盒与网络断开连接。
2.。)您的数据库服务器停止。
答案 1 :(得分:0)
您可以将配置参数添加到dataSource配置中,以确保数据库连接保持活动状态
dataSource {
properties {
validationQuery=SELECT 1 FROM DUAL
validationQueryTimeout=3
validationInterval=15000
}
}
validationQuery将取决于您的数据库供应商,例如以上适用于Oracle