I am using Flyway CE 5.2.4 Maven plugin against Oracle 12.2. Regardless of the actual error in the migration script, Flyway reports the following errors:
Closed Connection
Unable to commit transaction
Unable to restore autocommit to original value for connection
As an example, take this very simple migration script with a table that doesn't exist:
INSERT INTO bad_table_name (column1) VALUES (1);
It gives the expected ORA-00942: table or view does not exist error when run in SQL*Plus, TOAD, etc., but when run in Flyway gives the following error; the same result happens in Flyway CE 5.2.1.
[ERROR] Error while closing JDBC statement
java.sql.SQLRecoverableException: Closed Connection
at oracle.jdbc.driver.PhysicalConnection.needLine(PhysicalConnection.java:4220)
at oracle.jdbc.driver.OracleStatement.closeOrCache(OracleStatement.java:1431)
at oracle.jdbc.driver.OracleStatement.close(OracleStatement.java:1410)
at oracle.jdbc.driver.OracleStatementWrapper.close(OracleStatementWrapper.java:102)
at org.flywaydb.core.internal.jdbc.JdbcUtils.closeStatement(JdbcUtils.java:114)
at org.flywaydb.core.internal.jdbc.JdbcTemplate.executeStatement(JdbcTemplate.java:243)
at org.flywaydb.core.internal.sqlscript.StandardSqlStatement.execute(StandardSqlStatement.java:42)
at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.executeStatement(DefaultSqlScriptExecutor.java:189)
at org.flywaydb.core.internal.sqlscript.DefaultSqlScriptExecutor.execute(DefaultSqlScriptExecutor.java:125)
at org.flywaydb.core.internal.resolver.sql.SqlMigrationExecutor.execute(SqlMigrationExecutor.java:77)
at org.flywaydb.core.internal.command.DbMigrate.doMigrateGroup(DbMigrate.java:367)
at org.flywaydb.core.internal.command.DbMigrate.access$200(DbMigrate.java:54)
at org.flywaydb.core.internal.command.DbMigrate$3.call(DbMigrate.java:284)
at org.flywaydb.core.internal.jdbc.TransactionTemplate.execute(TransactionTemplate.java:74)
at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:281)
at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:246)
at org.flywaydb.core.internal.command.DbMigrate.access$100(DbMigrate.java:54)
at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:164)
at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:161)
at org.flywaydb.core.internal.database.base.Connection$1.call(Connection.java:147)
at org.flywaydb.core.internal.jdbc.TransactionTemplate.execute(TransactionTemplate.java:74)
at org.flywaydb.core.internal.database.base.Connection.lock(Connection.java:143)
at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:155)
at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:161)
at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:139)
at org.flywaydb.core.Flyway$1.execute(Flyway.java:1395)
at org.flywaydb.core.Flyway$1.execute(Flyway.java:1356)
at org.flywaydb.core.Flyway.execute(Flyway.java:1711)
at org.flywaydb.core.Flyway.migrate(Flyway.java:1356)
at org.flywaydb.maven.MigrateMojo.doExecute(MigrateMojo.java:35)
at org.flywaydb.maven.AbstractFlywayMojo.execute(AbstractFlywayMojo.java:746)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] Unable to rollback transaction
java.sql.SQLRecoverableException: Closed Connection
at oracle.jdbc.driver.PhysicalConnection.getAutoCommit(PhysicalConnection.java:2254)
at oracle.jdbc.driver.PhysicalConnection.rollback(PhysicalConnection.java:2424)
at org.flywaydb.core.internal.jdbc.TransactionTemplate.execute(TransactionTemplate.java:90)
at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:281)
at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:246)
at org.flywaydb.core.internal.command.DbMigrate.access$100(DbMigrate.java:54)
at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:164)
at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:161)
at org.flywaydb.core.internal.database.base.Connection$1.call(Connection.java:147)
at org.flywaydb.core.internal.jdbc.TransactionTemplate.execute(TransactionTemplate.java:74)
at org.flywaydb.core.internal.database.base.Connection.lock(Connection.java:143)
at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:155)
at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:161)
at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:139)
at org.flywaydb.core.Flyway$1.execute(Flyway.java:1395)
at org.flywaydb.core.Flyway$1.execute(Flyway.java:1356)
at org.flywaydb.core.Flyway.execute(Flyway.java:1711)
at org.flywaydb.core.Flyway.migrate(Flyway.java:1356)
at org.flywaydb.maven.MigrateMojo.doExecute(MigrateMojo.java:35)
at org.flywaydb.maven.AbstractFlywayMojo.execute(AbstractFlywayMojo.java:746)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] Unable to restore autocommit to original value for connection
java.sql.SQLRecoverableException: Closed Connection
at oracle.jdbc.driver.PhysicalConnection.setAutoCommit(PhysicalConnection.java:2232)
at org.flywaydb.core.internal.jdbc.TransactionTemplate.execute(TransactionTemplate.java:105)
at org.flywaydb.core.internal.command.DbMigrate.applyMigrations(DbMigrate.java:281)
at org.flywaydb.core.internal.command.DbMigrate.migrateGroup(DbMigrate.java:246)
at org.flywaydb.core.internal.command.DbMigrate.access$100(DbMigrate.java:54)
at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:164)
at org.flywaydb.core.internal.command.DbMigrate$2.call(DbMigrate.java:161)
at org.flywaydb.core.internal.database.base.Connection$1.call(Connection.java:147)
at org.flywaydb.core.internal.jdbc.TransactionTemplate.execute(TransactionTemplate.java:74)
at org.flywaydb.core.internal.database.base.Connection.lock(Connection.java:143)
at org.flywaydb.core.internal.schemahistory.JdbcTableSchemaHistory.lock(JdbcTableSchemaHistory.java:155)
at org.flywaydb.core.internal.command.DbMigrate.migrateAll(DbMigrate.java:161)
at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:139)
at org.flywaydb.core.Flyway$1.execute(Flyway.java:1395)
at org.flywaydb.core.Flyway$1.execute(Flyway.java:1356)
at org.flywaydb.core.Flyway.execute(Flyway.java:1711)
at org.flywaydb.core.Flyway.migrate(Flyway.java:1356)
at org.flywaydb.maven.MigrateMojo.doExecute(MigrateMojo.java:35)
at org.flywaydb.maven.AbstractFlywayMojo.execute(AbstractFlywayMojo.java:746)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] Migration of schema "SCHEMA1" to version 004 - Test failed! Please restore backups and roll back database and code!
[ERROR] Unable to rollback transaction
java.sql.SQLRecoverableException: Closed Connection
at oracle.jdbc.driver.PhysicalConnection.getAutoCommit(PhysicalConnection.java:2254)
at oracle.jdbc.driver.PhysicalConnection.rollback(PhysicalConnection.java:2424)
at org.flywaydb.core.internal.jdbc.TransactionTemplate.execute(TransactionTemplate.java:90)
at org.flywaydb.core.internal.database.base.Connection.restoreOriginalSchema(Connection.java:165)
at org.flywaydb.core.internal.database.base.Connection.close(Connection.java:159)
at org.flywaydb.core.internal.database.base.Database.close(Database.java:485)
at org.flywaydb.core.Flyway.execute(Flyway.java:1731)
at org.flywaydb.core.Flyway.migrate(Flyway.java:1356)
at org.flywaydb.maven.MigrateMojo.doExecute(MigrateMojo.java:35)
at org.flywaydb.maven.AbstractFlywayMojo.execute(AbstractFlywayMojo.java:746)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[ERROR] Unable to restore autocommit to original value for connection
java.sql.SQLRecoverableException: Closed Connection
at oracle.jdbc.driver.PhysicalConnection.setAutoCommit(PhysicalConnection.java:2232)
at org.flywaydb.core.internal.jdbc.TransactionTemplate.execute(TransactionTemplate.java:105)
at org.flywaydb.core.internal.database.base.Connection.restoreOriginalSchema(Connection.java:165)
at org.flywaydb.core.internal.database.base.Connection.close(Connection.java:159)
at org.flywaydb.core.internal.database.base.Database.close(Database.java:485)
at org.flywaydb.core.Flyway.execute(Flyway.java:1731)
at org.flywaydb.core.Flyway.migrate(Flyway.java:1356)
at org.flywaydb.maven.MigrateMojo.doExecute(MigrateMojo.java:35)
at org.flywaydb.maven.AbstractFlywayMojo.execute(AbstractFlywayMojo.java:746)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.516 s
[INFO] Finished at: 2019-02-26T07:43:54-07:00
[INFO] Final Memory: 14M/345M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.flywaydb:flyway-maven-plugin:5.2.4:migrate (default-cli) on project database: org.flywaydb.core.internal.exception.FlywaySqlException:
[ERROR] Unable to commit transaction
[ERROR] ----------------------------
[ERROR] SQL State : 08003
[ERROR] Error Code : 17008
[ERROR] Message : Closed Connection
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Please file an issue in the Flyway issue tracker with these details and ,if possible, steps to reproduce.
I was trying to attempt maven release through Jenkins , but running with below error. Can any one faced this kind of error.
any help on this issue will be appreciate, we running issue in production
**error logs**
----------
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.5:rollback (default-cli) on project AuthorizedEventServiceParent: Cannot restore from a missing backup POM: /opt/Jenkins/workspace/uthorizedEventServiceParent-45I6W7JFLSTHNWDJCYNAQKDWWSVTP7CN5RGR35I3VBKTCW5V7WMQ/pom.xml.releaseBackup
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:120)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:355)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:216)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:160)
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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: Cannot restore from a missing backup POM: /opt/Jenkins/workspace/uthorizedEventServiceParent-45I6W7JFLSTHNWDJCYNAQKDWWSVTP7CN5RGR35I3VBKTCW5V7WMQ/pom.xml.releaseBackup
at org.apache.maven.plugins.release.RollbackReleaseMojo.execute(RollbackReleaseMojo.java:59)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:132)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: org.apache.maven.shared.release.ReleaseExecutionException: Cannot restore from a missing backup POM: /opt/Jenkins/workspace/uthorizedEventServiceParent-45I6W7JFLSTHNWDJCYNAQKDWWSVTP7CN5RGR35I3VBKTCW5V7WMQ/pom.xml.releaseBackup
at org.apache.maven.shared.release.phase.RestoreBackupPomsPhase.restorePomBackup(RestoreBackupPomsPhase.java:90)
at org.apache.maven.shared.release.phase.RestoreBackupPomsPhase.execute(RestoreBackupPomsPhase.java:67)
at org.apache.maven.shared.release.DefaultReleaseManager.rollback(DefaultReleaseManager.java:304)
at org.apache.maven.shared.release.DefaultReleaseManager.rollback(DefaultReleaseManager.java:283)
at org.apache.maven.shared.release.DefaultReleaseManager.rollback(DefaultReleaseManager.java:269)
at org.apache.maven.plugins.release.RollbackReleaseMojo.execute(RollbackReleaseMojo.java:55)
... 21 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
----------
Regards,
Manojkumar
The documentation for maven site plugin http://maven.apache.org/plugins/maven-site-plugin/examples/creating-content.html#Filtering suggests using $context to access properties with dot-notation.
I have a property nexus.url in my pom file. Using $context.get("nexus.url") or $context.get("parent.version") in the .apt file gives a parsing error:
[ERROR] Error parsing src/site/apt/readme.apt.vm as a velocity template, using as text.
Running mvn with -X flag gives out this trace:
java.lang.RuntimeException: Exception when invoking public void org.apache.velocity.tools.generic.SafeConfig.configure(java.util.Map) on org.apache.velocity.tools.view.ViewContextTool#6a950a3b
at org.apache.velocity.tools.ToolInfo.invoke(ToolInfo.java:375)
at org.apache.velocity.tools.ToolInfo.configure(ToolInfo.java:294)
at org.apache.velocity.tools.ToolInfo.create(ToolInfo.java:255)
at org.apache.velocity.tools.Toolbox.getFromInfo(Toolbox.java:152)
at org.apache.velocity.tools.Toolbox.get(Toolbox.java:112)
at org.apache.velocity.tools.ToolContext.findTool(ToolContext.java:221)
at org.apache.velocity.tools.ToolContext.get(ToolContext.java:206)
at org.apache.velocity.context.InternalContextAdapterImpl.get(InternalContextAdapterImpl.java:219)
at org.apache.velocity.runtime.parser.node.ASTReference.getVariableValue(ASTReference.java:740)
at org.apache.velocity.runtime.parser.node.ASTReference.execute(ASTReference.java:175)
at org.apache.velocity.runtime.parser.node.ASTReference.render(ASTReference.java:294)
at org.apache.velocity.runtime.parser.node.SimpleNode.render(SimpleNode.java:318)
at org.apache.velocity.Template.merge(Template.java:254)
at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:508)
at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderDocument(DefaultSiteRenderer.java:354)
at org.apache.maven.doxia.siterenderer.DoxiaDocumentRenderer.renderDocument(DoxiaDocumentRenderer.java:51)
at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.renderModule(DefaultSiteRenderer.java:311)
at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render(DefaultSiteRenderer.java:129)
at org.apache.maven.plugins.site.render.SiteMojo.renderDoxiaDocuments(SiteMojo.java:261)
at org.apache.maven.plugins.site.render.SiteMojo.renderLocale(SiteMojo.java:172)
at org.apache.maven.plugins.site.render.SiteMojo.execute(SiteMojo.java:141)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: java.lang.NullPointerException
at org.apache.velocity.tools.view.ViewContextTool.configure(ViewContextTool.java:69)
at org.apache.velocity.tools.generic.SafeConfig.configure(SafeConfig.java:113)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.velocity.tools.ToolInfo.invoke(ToolInfo.java:363)
Figured it out. It works fine with version 3.5.1 of maven-site-plugin.
I have recently upgraded to SonarQube 5.1.2 and have added the "design" plugin that I used to have in my old 3.2 instance.
This is my list of installed plugins:
cobertura,false,sonar-cobertura-plugin-1.6.3.jar|3ea2c0afe6e6b9701e4d5c8af382d388
emailnotifications,true,sonar-email-notifications-plugin-5.1.2.jar|3dd4e623752556c7a8757c1989af0ece
python,false,sonar-python-plugin-1.5.jar|268d44b47786147ef51376215c6c230a
crowd,false,sonar-crowd-plugin-2.0.jar|f580d366b948f01071317ef28bb60da1
pmd,false,sonar-pmd-plugin-2.4.1.jar|ff3781c9788d4e83f60e83bbd3d12e10
motionchart,false,sonar-motion-chart-plugin-1.7.jar|bdb198c2207ef033d6f1ee3e3eaea2b1
scmsvn,false,sonar-scm-svn-plugin-1.0.jar|6915a69a7810c2b33ad4276d99a23077
javascript,false,sonar-javascript-plugin-2.8.jar|0f87170f4cec0f7fc51b6572530153f9
core,true,sonar-core-plugin-5.1.2.jar|b86ec05f4953608b2b4b697c027ab994
csharp,false,sonar-csharp-plugin-4.2.jar|af49378c5127353a2536ae77159ddbbb
buildstability,false,sonar-build-stability-plugin-1.3.jar|efc9f452c6fa20e268b6f1bb974d8e93
findbugs,false,sonar-findbugs-plugin-3.3.jar|f89994727607c7aacbea6e9396fed153
groovy,false,sonar-groovy-plugin-1.2.jar|14908dd5f3a9b9d795dbc103f0af546f
java,false,sonar-java-plugin-3.5.jar|64ff984b1b847bb6089cdda940ac0483
web,false,sonar-web-plugin-2.4.jar|1dbfc63768da3d753a61eda6146a8f7b
scmgit,false,sonar-scm-git-plugin-1.0.jar|e1d9d8e1d3524f9f0f69017e6dbead02
design,false,sonar-design-plugin-4.5.6.jar|6858390fab9e7e9e781bd17a837e32ce
scmstats,false,sonar-scm-stats-plugin-0.3.1.jar|79b6807b2bc2fe5d0607c37557ceb2be
timeline,false,sonar-timeline-plugin-1.5.jar|bbd6b21fb738281b5dd42e793d01bb5f
php,false,sonar-php-plugin-2.6.jar|5e37936c012cca253006867af1748793
l10nen,true,sonar-l10n-en-plugin-5.1.2.jar|bb21d03934050deec6cc95d0063d7789
checkstyle,false,sonar-checkstyle-plugin-2.3.jar|9c90929f5f058f6372f0f2346ab0d3ed
jira,false,sonar-jira-plugin-1.2.jar|0e68329678d4706d2d98e0f08fd5306e
I'm getting this error while trying to run mvn clean verify sonar:sonar on a project that used to work with old Sonar version.
It also works OK when I exclude that design plugin:
-Dsonar.excudePlugins=design
Any idea on how to fix this?
Thanks in advance.
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project myproject: org.sonar.plugins.design.batch.MavenDependenciesSensor has unsatisfied dependency 'interface org.apache.maven.shared.dependency.tree.DependencyTreeBuilder' for constructor 'public org.sonar.plugins.design.batch.MavenDependenciesSensor(org.apache.maven.artifact.repository.ArtifactRepository,org.apache.maven.artifact.factory.ArtifactFactory,org.apache.maven.artifact.metadata.ArtifactMetadataSource,org.apache.maven.artifact.resolver.ArtifactCollector,org.apache.maven.shared.dependency.tree.DependencyTreeBuilder,org.sonar.api.batch.SonarIndex)' from org.picocontainer.DefaultPicoContainer#232af575:310<[Immutable]:org.picocontainer.DefaultPicoContainer#5177d2af:252<[Immutable]:org.picocontainer.DefaultPicoContainer#4f265869:23<[Immutable]:org.picocontainer.DefaultPicoContainer#6760353c:107<| -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project myproject: org.sonar.plugins.design.batch.MavenDependenciesSensor has unsatisfied dependency 'interface org.apache.maven.shared.dependency.tree.DependencyTreeBuilder' for constructor 'public org.sonar.plugins.design.batch.MavenDependenciesSensor(org.apache.maven.artifact.repository.ArtifactRepository,org.apache.maven.artifact.factory.ArtifactFactory,org.apache.maven.artifact.metadata.ArtifactMetadataSource,org.apache.maven.artifact.resolver.ArtifactCollector,org.apache.maven.shared.dependency.tree.DependencyTreeBuilder,org.sonar.api.batch.SonarIndex)' from org.picocontainer.DefaultPicoContainer#232af575:310<[Immutable]:org.picocontainer.DefaultPicoContainer#5177d2af:252<[Immutable]:org.picocontainer.DefaultPicoContainer#4f265869:23<[Immutable]:org.picocontainer.DefaultPicoContainer#6760353c:107<|
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: org.sonar.plugins.design.batch.MavenDependenciesSensor has unsatisfied dependency 'interface org.apache.maven.shared.dependency.tree.DependencyTreeBuilder' for constructor 'public org.sonar.plugins.design.batch.MavenDependenciesSensor(org.apache.maven.artifact.repository.ArtifactRepository,org.apache.maven.artifact.factory.ArtifactFactory,org.apache.maven.artifact.metadata.ArtifactMetadataSource,org.apache.maven.artifact.resolver.ArtifactCollector,org.apache.maven.shared.dependency.tree.DependencyTreeBuilder,org.sonar.api.batch.SonarIndex)' from org.picocontainer.DefaultPicoContainer#232af575:310<[Immutable]:org.picocontainer.DefaultPicoContainer#5177d2af:252<[Immutable]:org.picocontainer.DefaultPicoContainer#4f265869:23<[Immutable]:org.picocontainer.DefaultPicoContainer#6760353c:107<|
at org.codehaus.mojo.sonar.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:41)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:139)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:132)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 20 more
For now the last available version of the SonarQube Design Plugin is 4.5.6.
Plugin pom.xml file contains text
<parent>
<groupId>org.codehaus.sonar</groupId>
<artifactId>sonar</artifactId>
<version>4.5.6</version>
<relativePath>../..</relativePath>
</parent>
which mean that this plugin is compatible with SonarQube 4.5.6 LTS. So unfortunately you cannot use this plugin with SonarQube 5.2.
After updating Sonar from 5.1 to 5.2 the Jenkins-Build failed.
My Jenkins Sonar-Plugin is version 2.3 and the Maven-Plugin 2.6 (I tried also 2.7.1 but it failed too).
I use Maven 3.0.4 and Jenkins 1.629.
Here is my error:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project module.fakturierung: org.sonar.api.resources.Project.getPom()Lorg/apache/maven/project/MavenProject; -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project module.fakturierung: org.sonar.api.resources.Project.getPom()Lorg/apache/maven/project/MavenProject;
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: org.sonar.api.resources.Project.getPom()Lorg/apache/maven/project/MavenProject;
at org.codehaus.mojo.sonar.bootstrap.ExceptionHandling.handle(ExceptionHandling.java:41)
at org.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:139)
at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:132)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: java.lang.NoSuchMethodError: org.sonar.api.resources.Project.getPom()Lorg/apache/maven/project/MavenProject;
at org.sonar.plugins.findbugs.FindbugsMavenInitializer.getExcludesFiltersFromPluginConfiguration(FindbugsMavenInitializer.java:57)
at org.sonar.plugins.findbugs.FindbugsMavenInitializer.execute(FindbugsMavenInitializer.java:52)
at org.sonar.batch.phases.InitializersExecutor.execute(InitializersExecutor.java:59)
at org.sonar.batch.phases.PhaseExecutor.executeInitializersPhase(PhaseExecutor.java:156)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:87)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:192)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:258)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:253)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:251)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:243)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:100)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:85)
at org.sonar.batch.bootstrap.GlobalContainer.executeAnalysis(GlobalContainer.java:153)
at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:110)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:76)
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)
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.codehaus.mojo.sonar.bootstrap.RunnerBootstraper.execute(RunnerBootstraper.java:135)
... 22 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR] mvn <goals> -rf :module.fakturierung
Has anyone an idea or a solution?
Because of the log fragment:
Caused by: java.lang.NoSuchMethodError: org.sonar.api.resources.Project.getPom()Lorg/apache/maven/project/MavenProject;
at
org.sonar.plugins.findbugs.FindbugsMavenInitializer.getExcludesFiltersFromPluginConfiguration(FindbugsMavenInitializer.java:57)
I guess your problem is related to the SonarQube embedded Findbugs plugin: you might find useful SonarQube embedded Findbugs plugin compatibility.