- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
每当我在 Hudson 中构建作业时,在尝试将结果存储到数据库中时总是会在最后失败。整个工作通常需要大约一个小时的时间来构建和失败。
源文件存储在SVN服务器上,可在本地下载和编辑。一旦我验证作业能够在本地成功构建,我就将所有更改提交到 SVN。
我最近改用了一种基于 ANT 的方法,该方法使 ant 目标与 session 审阅者相匹配。所以我创建了一个sonar.xml文件,其中包含一个名为sonar_scan的目标,在项目的build.xml文件中调用。
我已将 net_read_timeout、net_write_timeout 和 innodb_lock_wait_timeout 设置为 10 分钟,而不是它们的默认值 60 秒或更短。 wait_timeout 设置为 8 小时,所以我知道 wait_timeout 不是问题。
我收到的完整错误信息是:
[sonar:sonar] 19:09:43.831 ERROR - JDBC commit failed
[sonar:sonar] com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Communications link failure during commit(). Transaction resolution unknown.
[sonar:sonar] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.7.0_45]
[sonar:sonar] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) ~[na:1.7.0_45]
[sonar:sonar] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.7.0_45]
[sonar:sonar] at java.lang.reflect.Constructor.newInstance(Constructor.java:526) ~[na:1.7.0_45]
[sonar:sonar] at com.mysql.jdbc.Util.handleNewInstance(Util.java:377) ~[mysql-connector-java-5.1.34.jar:5.1.34]
[sonar:sonar] at com.mysql.jdbc.Util.getInstance(Util.java:360) ~[mysql-connector-java-5.1.34.jar:5.1.34]
[sonar:sonar] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956) ~[mysql-connector-java-5.1.34.jar:5.1.34]
[sonar:sonar] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935) ~[mysql-connector-java-5.1.34.jar:5.1.34]
[sonar:sonar] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:924) ~[mysql-connector-java-5.1.34.jar:5.1.34]
[sonar:sonar] at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:870) ~[mysql-connector-java-5.1.34.jar:5.1.34]
[sonar:sonar] at com.mysql.jdbc.ConnectionImpl.commit(ConnectionImpl.java:1611) ~[mysql-connector-java-5.1.34.jar:5.1.34]
[sonar:sonar] at org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:334) ~[sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.commit(PoolingDataSource.java:211) ~[sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at org.hibernate.transaction.JDBCTransaction.commitAndResetAutoCommit(JDBCTransaction.java:170) ~[sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:146) ~[sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:54) [sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at org.sonar.jpa.session.JpaDatabaseSession.commit(JpaDatabaseSession.java:83) [sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at org.sonar.jpa.session.JpaDatabaseSession.commitAndClose(JpaDatabaseSession.java:69) [sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at org.sonar.jpa.session.JpaDatabaseSession.stop(JpaDatabaseSession.java:64) [sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_45]
[sonar:sonar] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_45]
[sonar:sonar] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_45]
[sonar:sonar] at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_45]
[sonar:sonar] at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110) [sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.stop(ReflectionLifecycleStrategy.java:96) [sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.stop(AbstractInjectionFactory.java:88) [sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at org.picocontainer.behaviors.AbstractBehavior.stop(AbstractBehavior.java:179) [sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at org.picocontainer.behaviors.Stored$RealComponentLifecycle.stop(Stored.java:141) [sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at org.picocontainer.behaviors.Stored.stop(Stored.java:118) [sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at org.picocontainer.DefaultPicoContainer.stopAdapters(DefaultPicoContainer.java:1047) [sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at org.picocontainer.DefaultPicoContainer.stop(DefaultPicoContainer.java:802) [sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at org.sonar.api.platform.ComponentContainer.stopComponents(ComponentContainer.java:123) [sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at org.sonar.api.platform.ComponentContainer.stopComponents(ComponentContainer.java:118) [sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at org.sonar.batch.bootstrapper.Batch.stop(Batch.java:107) [sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67) [sonar-batch-maven-compat-5.1.jar:na]
[sonar:sonar] at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48) [sonar-runner-batch1253226961910621726.jar:na]
[sonar:sonar] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_45]
[sonar:sonar] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_45]
[sonar:sonar] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_45]
[sonar:sonar] at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_45]
[sonar:sonar] at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87) [sonar-ant-task-2.3.jar:na]
[sonar:sonar] at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75) [sonar-ant-task-2.3.jar:na]
[sonar:sonar] at java.security.AccessController.doPrivileged(Native Method) [na:1.7.0_45]
[sonar:sonar] at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69) [sonar-ant-task-2.3.jar:na]
[sonar:sonar] at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50) [sonar-ant-task-2.3.jar:na]
[sonar:sonar] at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102) [sonar-ant-task-2.3.jar:na]
[sonar:sonar] at org.sonar.runner.api.Runner.execute(Runner.java:100) [sonar-ant-task-2.3.jar:na]
[sonar:sonar] at org.sonar.ant.SonarTask.launchAnalysis(SonarTask.java:51) [sonar-ant-task-2.3.jar:na]
[sonar:sonar] at org.sonar.ant.SonarTask.execute(SonarTask.java:46) [sonar-ant-task-2.3.jar:na]
[sonar:sonar] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292) [ant.jar:1.9.2]
[sonar:sonar] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) ~[na:na]
[sonar:sonar] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_45]
[sonar:sonar] at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_45]
[sonar:sonar] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106) [ant.jar:na]
[sonar:sonar] at org.apache.tools.ant.Task.perform(Task.java:348) [ant.jar:1.9.2]
[sonar:sonar] at org.apache.tools.ant.Target.execute(Target.java:435) [ant.jar:1.9.2]
[sonar:sonar] at org.apache.tools.ant.Target.performTasks(Target.java:456) [ant.jar:1.9.2]
[sonar:sonar] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393) [ant.jar:1.9.2]
[sonar:sonar] at org.apache.tools.ant.Project.executeTarget(Project.java:1364) [ant.jar:1.9.2]
[sonar:sonar] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) [ant.jar:na]
[sonar:sonar] at org.apache.tools.ant.Project.executeTargets(Project.java:1248) [ant.jar:1.9.2]
[sonar:sonar] at org.apache.tools.ant.Main.runBuild(Main.java:851) [ant.jar:1.9.2]
[sonar:sonar] at org.apache.tools.ant.Main.startAnt(Main.java:235) [ant.jar:1.9.2]
[sonar:sonar] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280) [ant-launcher.jar:na]
[sonar:sonar] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109) [ant-launcher.jar:na]
[sonar:sonar] 19:09:43.831 WARN - SQL Error: 0, SQLState: null
[sonar:sonar] 19:09:43.831 ERROR - Already closed.
BUILD FAILED
D:\SVN_7_1\buildscripts\sonar.xml:168: org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.ant.SonarTask.launchAnalysis(SonarTask.java:51)
at org.sonar.ant.SonarTask.execute(SonarTask.java:46)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:435)
at org.apache.tools.ant.Target.performTasks(Target.java:456)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1393)
at org.apache.tools.ant.Project.executeTarget(Project.java:1364)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1248)
at org.apache.tools.ant.Main.runBuild(Main.java:851)
at org.apache.tools.ant.Main.startAnt(Main.java:235)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: org.hibernate.exception.GenericJDBCException: Cannot release connection
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
at org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:478)
at org.hibernate.jdbc.ConnectionManager.aggressiveRelease(ConnectionManager.java:429)
at org.hibernate.jdbc.ConnectionManager.afterTransaction(ConnectionManager.java:316)
at org.hibernate.jdbc.JDBCContext.afterTransactionCompletion(JDBCContext.java:248)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:158)
at org.hibernate.ejb.TransactionImpl.commit(TransactionImpl.java:54)
at org.sonar.jpa.session.JpaDatabaseSession.commit(JpaDatabaseSession.java:83)
at org.sonar.jpa.session.JpaDatabaseSession.commitAndClose(JpaDatabaseSession.java:69)
at org.sonar.jpa.session.JpaDatabaseSession.stop(JpaDatabaseSession.java:64)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110)
at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.stop(ReflectionLifecycleStrategy.java:96)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.stop(AbstractInjectionFactory.java:88)
at org.picocontainer.behaviors.AbstractBehavior.stop(AbstractBehavior.java:179)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.stop(Stored.java:141)
at org.picocontainer.behaviors.Stored.stop(Stored.java:118)
at org.picocontainer.DefaultPicoContainer.stopAdapters(DefaultPicoContainer.java:1047)
at org.picocontainer.DefaultPicoContainer.stop(DefaultPicoContainer.java:802)
at org.sonar.api.platform.ComponentContainer.stopComponents(ComponentContainer.java:123)
at org.sonar.api.platform.ComponentContainer.stopComponents(ComponentContainer.java:118)
at org.sonar.batch.bootstrapper.Batch.stop(Batch.java:107)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 24 more
Caused by: java.sql.SQLException: Already closed.
at org.apache.commons.dbcp.PoolableConnection.close(PoolableConnection.java:114)
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:191)
at org.hibernate.connection.DatasourceConnectionProvider.closeConnection(DatasourceConnectionProvider.java:97)
at org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:474)
... 54 more
Total time: 42 minutes 5 seconds
我到处寻找可能的解决方案,但到目前为止我还没有找到。如果有人可以建议我还没有做过的事情,那么我将不胜感激。
最佳答案
网络不稳定
重现代码:
con.query()
sleep(10) //when sleep shutdown your network
conn.roolback()
关于MySQLNonTransientConnectionException : Communications link failure during commit(). 事务解析未知,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32349610/
有Grails2.2/Hibernate/Tomcat7/MySQL5.5 web服务器。在几个小时内没有 Web 客户端请求它之后,对它的第一个请求失败如下。 (事实上 ,它每天早上都会发生。)
我在 PDI (Kettle) 中遇到 MySQL 问题。该错误出现在通过输入表读取信息的过程中。即使所有数据都成功地从基数中给出,也会出现此错误,并且可能不会影响转换。 Error comittin
尝试使用在 NetBeans 上运行的 GlassFish 服务器连接到 MySQL 时总会出现此异常。 (com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransi
我使用 PreparedStatement 进行选择时遇到异常。 Got an exception accessing TestCase data! null Problem to connect.
我将迷你游戏的玩家统计数据存储在 SQL 数据库中,但在加载统计数据时遇到以下错误: com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnecti
我的 Spring-MVC 应用程序在浏览站点时有时会崩溃,我从日志中得到的错误消息如下所示。我完全不知道是什么原因造成的,并且非常感谢任何能引导我走向正确方向的提示。 SEVERE: Ser
使用 MySQL 8.0 版、mysql-connector-java 5.1.48 版、Spring Core 4.3.4 和 Spring Boot 1.4.2 版。 连接字符串是 jdbc:my
当我部署我的应用程序时,过了一会儿我得到了这个异常: javax.servlet.ServletException: Exception [EclipseLink-4002] (Eclipse
我们在虚拟服务器上有一个原始的 Debian 7。带有 OpenJDK 1.7.0_65 的 Tomcat7 连接到本地 MySQL 5.5 安装。具有 ColdFusion 核心(Razuna,MA
我有一个 Java 中的 JDBC MySQL 连接。我的程序可以很好地执行简单的查询。 如果我运行同一个程序超过 10 个小时并执行查询,那么我会收到以下 MySQL 异常: com.mysql.j
我正在运行一个使用 Hibernate 和 C3P0 作为连接池、MySQL 5.6 数据库的 Java Web 应用程序。我继续在已部署的应用程序中遇到连接超时和生成错误的问题: Caused by
我正在处理使用 JDBC 连接到 Amazon RDS 上的 MySQL 数据库的奇怪问题。我有两部不同的 Android 手机在同一网络上运行相同的代码。一个连接没有任何问题。另一个给了我以下异常:
所以我进行了一堆异步调用,唯一的问题是,在我的准备方法中生成一个PreparedStatement,它获取连接(或者如果连接错误则使用新的连接),并且由于某种原因仍然抛出此错误. 我最初认为(现在仍然
我遇到了这个异常 com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: No operations allowed
我正在尝试将我的 Spring Boot 应用程序与 MySQL 服务器连接。 我已正确遵循文档,但仍然遇到一些相关问题每次都会抛出以下异常 com.mysql.jdbc.exceptions.jdb
每当我在 Hudson 中构建作业时,在尝试将结果存储到数据库中时总是会在最后失败。整个工作通常需要大约一个小时的时间来构建和失败。 源文件存储在SVN服务器上,可在本地下载和编辑。一旦我验证作业能够
获取以下代码的错误 package jdbcdrive; import java.sql.*; public class Lpt { /** * @param args
我覆盖了 tomcat 中的一个 war 文件,但没有删除以前的 war 文件。我去了日志,同样的错误在一个循环中,描述如下: MySQLNonTransientConnectionException
我正在处理一个使用 JDBC 连接到 Amazon RDS 上的 MySQL 数据库的奇怪问题。我在同一网络上有两部不同的 Android 手机运行相同的代码。一个连接没有任何问题。另一个给我以下异常
我有一个使用 Hibernate 和 MySQL 的 Java webapp。如果网站几天不使用,MySQL 连接就会失效,我会遇到以下异常: com.mysql.jdbc.exceptions.jd
我是一名优秀的程序员,十分优秀!