java.sql.SQLException: Flyway migration error occurred

Sakai JIRA | Gerrit Hübbers | 11 months ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    I am writing unit tests for a customized DSpace distribution. I have noticed that many unit tests fail once I activate the XMLWorkflow in file {{workflow.cfg}} with property {{workflow.framework=xmlworkflow}}: {code} 2016-05-18 15:05:12,710 INFO org.dspace.storage.rdbms.DatabaseManager @ DBMS is 'H2' 2016-05-18 15:05:12,710 INFO org.dspace.storage.rdbms.DatabaseManager @ DBMS driver version is '1.4.180 (2014-07-13)' 2016-05-18 15:05:12,740 INFO org.dspace.storage.rdbms.DatabaseUtils @ Loading Flyway DB migrations from: classpath:org.dspace.storage.rdbms.sqlmigration.h2, classpath:org.dspace.storage.rdbms.migration, classpath:org.dspace.storage.rdbms.xmlworkflow 2016-05-18 15:05:12,791 INFO org.flywaydb.core.internal.dbsupport.DbSupportFactory @ Database: jdbc:h2:mem:test (H2 1.4) 2016-05-18 15:05:12,891 INFO org.flywaydb.core.internal.metadatatable.MetaDataTableImpl @ Creating Metadata table: "PUBLIC"."schema_version" 2016-05-18 15:05:12,980 INFO org.flywaydb.core.internal.command.DbInit @ Schema initialized with version: 1 2016-05-18 15:05:13,157 INFO org.dspace.storage.rdbms.DatabaseUtils @ Pending DSpace database schema migrations: 2016-05-18 15:05:13,157 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.2 Initial DSpace 1.2 Oracle database schema SQL PENDING 2016-05-18 15:05:13,157 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.3 Upgrade to DSpace 1.3 schema SQL PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.3.9 Drop constraint for DSpace 1 4 schema JDBC PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.4 Upgrade to DSpace 1.4 schema SQL PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.4.2 Upgrade to DSpace 1.4.2 schema SQL PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.5 Upgrade to DSpace 1.5 schema SQL PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.5.9 Drop constraint for DSpace 1 6 schema JDBC PENDING 2016-05-18 15:05:13,159 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.6 Upgrade to DSpace 1.6 schema SQL PENDING 2016-05-18 15:05:13,159 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.7 Upgrade to DSpace 1.7 schema SQL PENDING 2016-05-18 15:05:13,160 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.8 Upgrade to DSpace 1.8 schema SQL PENDING 2016-05-18 15:05:13,161 INFO org.dspace.storage.rdbms.DatabaseUtils @ 3.0 Upgrade to DSpace 3.x schema SQL PENDING 2016-05-18 15:05:13,162 INFO org.dspace.storage.rdbms.DatabaseUtils @ 4.0 Upgrade to DSpace 4.x schema SQL PENDING 2016-05-18 15:05:13,163 INFO org.dspace.storage.rdbms.DatabaseUtils @ 5.0.2014.08.08 DS-1945 Helpdesk Request a Copy SQL PENDING 2016-05-18 15:05:13,163 INFO org.dspace.storage.rdbms.DatabaseUtils @ 5.0.2014.09.25 DS 1582 Metadata For All Objects drop constraint JDBC PENDING 2016-05-18 15:05:13,163 INFO org.dspace.storage.rdbms.DatabaseUtils @ 5.0.2014.09.26 DS-1582 Metadata For All Objects SQL PENDING 2016-05-18 15:05:13,163 INFO org.dspace.storage.rdbms.DatabaseUtils @ 5.0.2014.11.04 Enable XMLWorkflow Migration JDBC PENDING 2016-05-18 15:05:13,234 INFO org.flywaydb.core.internal.command.DbValidate @ Validated 17 migrations (execution time 00:00.061s) 2016-05-18 15:05:13,310 INFO org.flywaydb.core.internal.command.DbMigrate @ Current version of schema "PUBLIC": 1 2016-05-18 15:05:13,310 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.2 2016-05-18 15:05:13,723 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.3 2016-05-18 15:05:14,054 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.3.9 2016-05-18 15:05:14,119 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.4 2016-05-18 15:05:14,273 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.4.2 2016-05-18 15:05:14,390 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.5 2016-05-18 15:05:14,578 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.5.9 2016-05-18 15:05:14,636 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.6 2016-05-18 15:05:14,887 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.7 2016-05-18 15:05:14,920 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.8 2016-05-18 15:05:14,958 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 3.0 2016-05-18 15:05:15,050 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 4.0 2016-05-18 15:05:15,086 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 5.0.2014.08.08 2016-05-18 15:05:15,105 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 5.0.2014.09.25 2016-05-18 15:05:15,127 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 5.0.2014.09.26 2016-05-18 15:05:15,509 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 5.0.2014.11.04 2016-05-18 15:05:15,514 ERROR org.flywaydb.core.internal.command.DbMigrate @ Migration of schema "PUBLIC" to version 5.0.2014.11.04 failed! Please restore backups and roll back database and code! 2016-05-18 15:05:15,518 ERROR org.dspace.storage.rdbms.DatabaseManager @ SQL getDataSource Error - java.sql.SQLException: Flyway migration error occurred at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:430) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:338) at org.dspace.storage.rdbms.DatabaseManager.initialize(DatabaseManager.java:1373) at org.dspace.storage.rdbms.DatabaseManager.getDataSource(DatabaseManager.java:650) at org.dspace.storage.rdbms.DatabaseManager.getConnection(DatabaseManager.java:629) at org.dspace.core.Context.init(Context.java:121) at org.dspace.core.Context.<init>(Context.java:95) at org.dspace.AbstractUnitTest.init(AbstractUnitTest.java:139) 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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103) Caused by: org.flywaydb.core.api.FlywayException: Migration failed ! at org.flywaydb.core.internal.resolver.jdbc.JdbcMigrationExecutor.execute(JdbcMigrationExecutor.java:47) at org.flywaydb.core.internal.command.DbMigrate$5.doInTransaction(DbMigrate.java:287) at org.flywaydb.core.internal.command.DbMigrate$5.doInTransaction(DbMigrate.java:285) at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72) at org.flywaydb.core.internal.command.DbMigrate.applyMigration(DbMigrate.java:285) at org.flywaydb.core.internal.command.DbMigrate.access$800(DbMigrate.java:46) at org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:207) at org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:156) at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72) at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:156) at org.flywaydb.core.Flyway$1.execute(Flyway.java:864) at org.flywaydb.core.Flyway$1.execute(Flyway.java:811) at org.flywaydb.core.Flyway.execute(Flyway.java:1171) at org.flywaydb.core.Flyway.migrate(Flyway.java:811) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:419) ... 33 more Caused by: org.flywaydb.core.api.FlywayException: Unable to obtain inputstream for resource: org/dspace/storage/rdbms/xmlworkflow/h2/xml_workflow_migration.sql at org.flywaydb.core.internal.util.scanner.classpath.ClassPathResource.loadAsString(ClassPathResource.java:83) at org.dspace.storage.rdbms.xmlworkflow.V5_0_2014_11_04__Enable_XMLWorkflow_Migration.migrate(V5_0_2014_11_04__Enable_XMLWorkflow_Migration.java:70) at org.flywaydb.core.internal.resolver.jdbc.JdbcMigrationExecutor.execute(JdbcMigrationExecutor.java:45) ... 47 more {code} So the reason is there does not exist a file {{h2/xml_workflow_migration.sql}}, taking care of setting up H2 database tables for any XMLWorkflow-specific database migrations. Probably, a file {{h2/data_workflow_migration.sql}} also will be required. There do exist files {{postgres/xml_workflow_migration.sql}} and {{oracle/xml_workflow_migration.sql}}. Is there a way to automatically generate {{xml_workflow_migration.sql}} for H2 and add it to DSpace's source code repository?

    Sakai JIRA | 11 months ago | Gerrit Hübbers
    java.sql.SQLException: Flyway migration error occurred
  2. 0

    I am writing unit tests for a customized DSpace distribution. I have noticed that many unit tests fail once I activate the XMLWorkflow in file {{workflow.cfg}} with property {{workflow.framework=xmlworkflow}}: {code} 2016-05-18 15:05:12,710 INFO org.dspace.storage.rdbms.DatabaseManager @ DBMS is 'H2' 2016-05-18 15:05:12,710 INFO org.dspace.storage.rdbms.DatabaseManager @ DBMS driver version is '1.4.180 (2014-07-13)' 2016-05-18 15:05:12,740 INFO org.dspace.storage.rdbms.DatabaseUtils @ Loading Flyway DB migrations from: classpath:org.dspace.storage.rdbms.sqlmigration.h2, classpath:org.dspace.storage.rdbms.migration, classpath:org.dspace.storage.rdbms.xmlworkflow 2016-05-18 15:05:12,791 INFO org.flywaydb.core.internal.dbsupport.DbSupportFactory @ Database: jdbc:h2:mem:test (H2 1.4) 2016-05-18 15:05:12,891 INFO org.flywaydb.core.internal.metadatatable.MetaDataTableImpl @ Creating Metadata table: "PUBLIC"."schema_version" 2016-05-18 15:05:12,980 INFO org.flywaydb.core.internal.command.DbInit @ Schema initialized with version: 1 2016-05-18 15:05:13,157 INFO org.dspace.storage.rdbms.DatabaseUtils @ Pending DSpace database schema migrations: 2016-05-18 15:05:13,157 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.2 Initial DSpace 1.2 Oracle database schema SQL PENDING 2016-05-18 15:05:13,157 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.3 Upgrade to DSpace 1.3 schema SQL PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.3.9 Drop constraint for DSpace 1 4 schema JDBC PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.4 Upgrade to DSpace 1.4 schema SQL PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.4.2 Upgrade to DSpace 1.4.2 schema SQL PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.5 Upgrade to DSpace 1.5 schema SQL PENDING 2016-05-18 15:05:13,158 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.5.9 Drop constraint for DSpace 1 6 schema JDBC PENDING 2016-05-18 15:05:13,159 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.6 Upgrade to DSpace 1.6 schema SQL PENDING 2016-05-18 15:05:13,159 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.7 Upgrade to DSpace 1.7 schema SQL PENDING 2016-05-18 15:05:13,160 INFO org.dspace.storage.rdbms.DatabaseUtils @ 1.8 Upgrade to DSpace 1.8 schema SQL PENDING 2016-05-18 15:05:13,161 INFO org.dspace.storage.rdbms.DatabaseUtils @ 3.0 Upgrade to DSpace 3.x schema SQL PENDING 2016-05-18 15:05:13,162 INFO org.dspace.storage.rdbms.DatabaseUtils @ 4.0 Upgrade to DSpace 4.x schema SQL PENDING 2016-05-18 15:05:13,163 INFO org.dspace.storage.rdbms.DatabaseUtils @ 5.0.2014.08.08 DS-1945 Helpdesk Request a Copy SQL PENDING 2016-05-18 15:05:13,163 INFO org.dspace.storage.rdbms.DatabaseUtils @ 5.0.2014.09.25 DS 1582 Metadata For All Objects drop constraint JDBC PENDING 2016-05-18 15:05:13,163 INFO org.dspace.storage.rdbms.DatabaseUtils @ 5.0.2014.09.26 DS-1582 Metadata For All Objects SQL PENDING 2016-05-18 15:05:13,163 INFO org.dspace.storage.rdbms.DatabaseUtils @ 5.0.2014.11.04 Enable XMLWorkflow Migration JDBC PENDING 2016-05-18 15:05:13,234 INFO org.flywaydb.core.internal.command.DbValidate @ Validated 17 migrations (execution time 00:00.061s) 2016-05-18 15:05:13,310 INFO org.flywaydb.core.internal.command.DbMigrate @ Current version of schema "PUBLIC": 1 2016-05-18 15:05:13,310 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.2 2016-05-18 15:05:13,723 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.3 2016-05-18 15:05:14,054 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.3.9 2016-05-18 15:05:14,119 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.4 2016-05-18 15:05:14,273 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.4.2 2016-05-18 15:05:14,390 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.5 2016-05-18 15:05:14,578 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.5.9 2016-05-18 15:05:14,636 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.6 2016-05-18 15:05:14,887 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.7 2016-05-18 15:05:14,920 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 1.8 2016-05-18 15:05:14,958 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 3.0 2016-05-18 15:05:15,050 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 4.0 2016-05-18 15:05:15,086 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 5.0.2014.08.08 2016-05-18 15:05:15,105 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 5.0.2014.09.25 2016-05-18 15:05:15,127 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 5.0.2014.09.26 2016-05-18 15:05:15,509 INFO org.flywaydb.core.internal.command.DbMigrate @ Migrating schema "PUBLIC" to version 5.0.2014.11.04 2016-05-18 15:05:15,514 ERROR org.flywaydb.core.internal.command.DbMigrate @ Migration of schema "PUBLIC" to version 5.0.2014.11.04 failed! Please restore backups and roll back database and code! 2016-05-18 15:05:15,518 ERROR org.dspace.storage.rdbms.DatabaseManager @ SQL getDataSource Error - java.sql.SQLException: Flyway migration error occurred at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:430) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:338) at org.dspace.storage.rdbms.DatabaseManager.initialize(DatabaseManager.java:1373) at org.dspace.storage.rdbms.DatabaseManager.getDataSource(DatabaseManager.java:650) at org.dspace.storage.rdbms.DatabaseManager.getConnection(DatabaseManager.java:629) at org.dspace.core.Context.init(Context.java:121) at org.dspace.core.Context.<init>(Context.java:95) at org.dspace.AbstractUnitTest.init(AbstractUnitTest.java:139) 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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103) Caused by: org.flywaydb.core.api.FlywayException: Migration failed ! at org.flywaydb.core.internal.resolver.jdbc.JdbcMigrationExecutor.execute(JdbcMigrationExecutor.java:47) at org.flywaydb.core.internal.command.DbMigrate$5.doInTransaction(DbMigrate.java:287) at org.flywaydb.core.internal.command.DbMigrate$5.doInTransaction(DbMigrate.java:285) at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72) at org.flywaydb.core.internal.command.DbMigrate.applyMigration(DbMigrate.java:285) at org.flywaydb.core.internal.command.DbMigrate.access$800(DbMigrate.java:46) at org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:207) at org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:156) at org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72) at org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:156) at org.flywaydb.core.Flyway$1.execute(Flyway.java:864) at org.flywaydb.core.Flyway$1.execute(Flyway.java:811) at org.flywaydb.core.Flyway.execute(Flyway.java:1171) at org.flywaydb.core.Flyway.migrate(Flyway.java:811) at org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:419) ... 33 more Caused by: org.flywaydb.core.api.FlywayException: Unable to obtain inputstream for resource: org/dspace/storage/rdbms/xmlworkflow/h2/xml_workflow_migration.sql at org.flywaydb.core.internal.util.scanner.classpath.ClassPathResource.loadAsString(ClassPathResource.java:83) at org.dspace.storage.rdbms.xmlworkflow.V5_0_2014_11_04__Enable_XMLWorkflow_Migration.migrate(V5_0_2014_11_04__Enable_XMLWorkflow_Migration.java:70) at org.flywaydb.core.internal.resolver.jdbc.JdbcMigrationExecutor.execute(JdbcMigrationExecutor.java:45) ... 47 more {code} So the reason is there does not exist a file {{h2/xml_workflow_migration.sql}}, taking care of setting up H2 database tables for any XMLWorkflow-specific database migrations. Probably, a file {{h2/data_workflow_migration.sql}} also will be required. There do exist files {{postgres/xml_workflow_migration.sql}} and {{oracle/xml_workflow_migration.sql}}. Is there a way to automatically generate {{xml_workflow_migration.sql}} for H2 and add it to DSpace's source code repository?

    Sakai JIRA | 11 months ago | Gerrit Hübbers
    java.sql.SQLException: Flyway migration error occurred

    Root Cause Analysis

    1. org.flywaydb.core.api.FlywayException

      Unable to obtain inputstream for resource: org/dspace/storage/rdbms/xmlworkflow/h2/xml_workflow_migration.sql

      at org.flywaydb.core.internal.util.scanner.classpath.ClassPathResource.loadAsString()
    2. ${project.artifactId}
      ClassPathResource.loadAsString
      1. org.flywaydb.core.internal.util.scanner.classpath.ClassPathResource.loadAsString(ClassPathResource.java:83)
      1 frame
    3. DSpace Kernel :: API and Implementation
      V5_0_2014_11_04__Enable_XMLWorkflow_Migration.migrate
      1. org.dspace.storage.rdbms.xmlworkflow.V5_0_2014_11_04__Enable_XMLWorkflow_Migration.migrate(V5_0_2014_11_04__Enable_XMLWorkflow_Migration.java:70)
      1 frame
    4. ${project.artifactId}
      Flyway.migrate
      1. org.flywaydb.core.internal.resolver.jdbc.JdbcMigrationExecutor.execute(JdbcMigrationExecutor.java:45)
      2. org.flywaydb.core.internal.command.DbMigrate$5.doInTransaction(DbMigrate.java:287)
      3. org.flywaydb.core.internal.command.DbMigrate$5.doInTransaction(DbMigrate.java:285)
      4. org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72)
      5. org.flywaydb.core.internal.command.DbMigrate.applyMigration(DbMigrate.java:285)
      6. org.flywaydb.core.internal.command.DbMigrate.access$800(DbMigrate.java:46)
      7. org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:207)
      8. org.flywaydb.core.internal.command.DbMigrate$2.doInTransaction(DbMigrate.java:156)
      9. org.flywaydb.core.internal.util.jdbc.TransactionTemplate.execute(TransactionTemplate.java:72)
      10. org.flywaydb.core.internal.command.DbMigrate.migrate(DbMigrate.java:156)
      11. org.flywaydb.core.Flyway$1.execute(Flyway.java:864)
      12. org.flywaydb.core.Flyway$1.execute(Flyway.java:811)
      13. org.flywaydb.core.Flyway.execute(Flyway.java:1171)
      14. org.flywaydb.core.Flyway.migrate(Flyway.java:811)
      14 frames
    5. DSpace Kernel :: API and Implementation
      Context.<init>
      1. org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:419)
      2. org.dspace.storage.rdbms.DatabaseUtils.updateDatabase(DatabaseUtils.java:338)
      3. org.dspace.storage.rdbms.DatabaseManager.initialize(DatabaseManager.java:1373)
      4. org.dspace.storage.rdbms.DatabaseManager.getDataSource(DatabaseManager.java:650)
      5. org.dspace.storage.rdbms.DatabaseManager.getConnection(DatabaseManager.java:629)
      6. org.dspace.core.Context.init(Context.java:121)
      7. org.dspace.core.Context.<init>(Context.java:95)
      7 frames
    6. org.dspace
      AbstractUnitTest.init
      1. org.dspace.AbstractUnitTest.init(AbstractUnitTest.java:139)
      1 frame
    7. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      4. java.lang.reflect.Method.invoke(Method.java:497)
      4 frames
    8. JUnit
      ParentRunner.run
      1. org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      2. org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      3. org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      4. org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
      5. org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      6. org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
      7. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
      8. org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
      9. org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
      10. org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
      11. org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
      12. org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
      13. org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
      14. org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
      15. org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
      16. org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      16 frames
    9. JUnit4 Provider
      JUnit4Provider.invoke
      1. org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
      2. org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
      3. org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
      3 frames
    10. SureFire
      ForkedBooter.main
      1. org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
      2. org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
      3. org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
      3 frames