Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-31907

Fix unit tests with 2021.36 on H2 with schema named rights

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2021.36
    • Fix Version/s: 2021.40, 2023.1
    • Component/s: Tests
    • Release Notes Summary:
      H2 reserved table names are now avoided in Nuxeo.
    • Backlog priority:
      900
    • Sprint:
      nxplatform #90, nxplatform #91
    • Story Points:
      2

      Description

      When a schema is defined with name rights, unit tests fail with 2021.36, but not with 2021.35.

      19:02:49,221 WARN  [RepositoryImpl] Adding missing column in database: "RIGHTS"."ID"
      19:02:49,221 WARN  [RepositoryImpl] Adding missing column in database: "RIGHTS"."PROP1"
      19:02:49,268 ERROR [RegistrationInfoImpl] Component service:org.nuxeo.ecm.core.repository.RepositoryServiceComponent notification of application started failed: java.sql.SQLException: Error executing: ALTER TABLE "RIGHTS" ADD COLUMN "ID" VARCHAR(36) NOT NULL : Table "RIGHTS" not found; SQL statement:
      ALTER TABLE "RIGHTS" ADD COLUMN "ID" VARCHAR(36) NOT NULL [42102-214]
      org.nuxeo.ecm.core.api.NuxeoException: java.sql.SQLException: Error executing: ALTER TABLE "RIGHTS" ADD COLUMN "ID" VARCHAR(36) NOT NULL : Table "RIGHTS" not found; SQL statement:
      ALTER TABLE "RIGHTS" ADD COLUMN "ID" VARCHAR(36) NOT NULL [42102-214]
      	at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.createDatabaseNoTx(RepositoryImpl.java:560) ~[nuxeo-core-storage-sql-2021.36.9.jar:?]
      	at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.lambda$createDatabase$0(RepositoryImpl.java:545) ~[nuxeo-core-storage-sql-2021.36.9.jar:?]
      	at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.runWithoutTransaction(RepositoryImpl.java:808) ~[nuxeo-core-storage-sql-2021.36.9.jar:?]
      	at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.createDatabase(RepositoryImpl.java:545) ~[nuxeo-core-storage-sql-2021.36.9.jar:?]
      	at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.initRepository(RepositoryImpl.java:322) ~[nuxeo-core-storage-sql-2021.36.9.jar:?]
      	at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.<init>(RepositoryImpl.java:143) ~[nuxeo-core-storage-sql-2021.36.9.jar:?]
      	at org.nuxeo.ecm.core.storage.sql.VCSRepositoryFactory.call(VCSRepositoryFactory.java:42) ~[nuxeo-core-storage-sql-2021.36.9.jar:?]
      	at org.nuxeo.ecm.core.repository.RepositoryService.lambda$createRepository$0(RepositoryService.java:192) ~[nuxeo-core-2021.36.9.jar:?]
      	at org.nuxeo.runtime.cluster.ClusterServiceImpl.runAtomically(ClusterServiceImpl.java:145) ~[nuxeo-runtime-cluster-2021.36.9.jar:?]
      	at org.nuxeo.ecm.core.repository.RepositoryService.createRepository(RepositoryService.java:191) ~[nuxeo-core-2021.36.9.jar:?]
      	at org.nuxeo.ecm.core.repository.RepositoryService.doCreateRepositories(RepositoryService.java:182) ~[nuxeo-core-2021.36.9.jar:?]
      	at org.nuxeo.runtime.transaction.TransactionHelper.lambda$runInTransaction$4(TransactionHelper.java:642) ~[nuxeo-runtime-jtajca-2021.36.9.jar:?]
      	at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:675) ~[nuxeo-runtime-jtajca-2021.36.9.jar:?]
      	at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:642) ~[nuxeo-runtime-jtajca-2021.36.9.jar:?]
      	at org.nuxeo.runtime.transaction.TransactionHelper.runInTransaction(TransactionHelper.java:630) ~[nuxeo-runtime-jtajca-2021.36.9.jar:?]
      	at org.nuxeo.ecm.core.repository.RepositoryService.start(RepositoryService.java:99) ~[nuxeo-core-2021.36.9.jar:?]
      	at org.nuxeo.runtime.model.impl.RegistrationInfoImpl.start(RegistrationInfoImpl.java:372) ~[nuxeo-runtime-2021.36.9.jar:?]
      	at org.nuxeo.runtime.model.impl.ComponentManagerImpl.startComponent(ComponentManagerImpl.java:758) ~[nuxeo-runtime-2021.36.9.jar:?]
      	at org.nuxeo.runtime.model.impl.ComponentManagerImpl.startComponents(ComponentManagerImpl.java:740) ~[nuxeo-runtime-2021.36.9.jar:?]
      	at org.nuxeo.runtime.model.impl.ComponentManagerImpl.start(ComponentManagerImpl.java:841) ~[nuxeo-runtime-2021.36.9.jar:?]
      	at org.nuxeo.runtime.osgi.OSGiRuntimeService.startComponents(OSGiRuntimeService.java:470) ~[nuxeo-runtime-2021.36.9.jar:?]
      	at org.nuxeo.runtime.osgi.OSGiRuntimeService.frameworkEvent(OSGiRuntimeService.java:485) ~[nuxeo-runtime-2021.36.9.jar:?]
      	at org.nuxeo.osgi.OSGiAdapter.fireFrameworkEvent(OSGiAdapter.java:223) ~[nuxeo-runtime-osgi-2021.36.9.jar:?]
      	at org.nuxeo.runtime.test.RuntimeHarnessImpl.fireFrameworkStarted(RuntimeHarnessImpl.java:215) ~[nuxeo-runtime-test-2021.36.9.jar:?]
      	at org.nuxeo.runtime.test.runner.RuntimeFeature.beforeRun(RuntimeFeature.java:144) ~[nuxeo-runtime-test-2021.36.9.jar:?]
      	at org.nuxeo.runtime.test.runner.FeaturesRunner.lambda$beforeRun$2(FeaturesRunner.java:250) ~[nuxeo-runtime-test-2021.36.9.jar:?]
      	at org.nuxeo.runtime.test.runner.FeaturesRunner.apply(FeaturesRunner.java:300) [nuxeo-runtime-test-2021.36.9.jar:?]
      	at org.nuxeo.runtime.test.runner.FeaturesRunner.apply(FeaturesRunner.java:286) [nuxeo-runtime-test-2021.36.9.jar:?]
      	at org.nuxeo.runtime.test.runner.FeaturesRunner.beforeRun(FeaturesRunner.java:250) [nuxeo-runtime-test-2021.36.9.jar:?]
      	at org.nuxeo.runtime.test.runner.FeaturesRunner$BeforeClassStatement.evaluate(FeaturesRunner.java:384) [nuxeo-runtime-test-2021.36.9.jar:?]
      	at org.junit.rules.RunRules.evaluate(RunRules.java:20) [junit-4.13.1.jar:4.13.1]
      	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) [junit-4.13.1.jar:4.13.1]
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:413) [junit-4.13.1.jar:4.13.1]
      	at org.junit.runners.Suite.runChild(Suite.java:128) [junit-4.13.1.jar:4.13.1]
      	at org.junit.runners.Suite.runChild(Suite.java:27) [junit-4.13.1.jar:4.13.1]
      	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) [junit-4.13.1.jar:4.13.1]
      	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) [junit-4.13.1.jar:4.13.1]
      	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) [junit-4.13.1.jar:4.13.1]
      	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) [junit-4.13.1.jar:4.13.1]
      	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) [junit-4.13.1.jar:4.13.1]
      	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306) [junit-4.13.1.jar:4.13.1]
      	at org.junit.runners.ParentRunner.run(ParentRunner.java:413) [junit-4.13.1.jar:4.13.1]
      	at org.apache.maven.surefire.junitcore.JUnitCore.run(JUnitCore.java:55) [surefire-junit47-2.22.2.jar:2.22.2]
      	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.createRequestAndRun(JUnitCoreWrapper.java:137) [surefire-junit47-2.22.2.jar:2.22.2]
      	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.executeEager(JUnitCoreWrapper.java:107) [surefire-junit47-2.22.2.jar:2.22.2]
      	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:83) [surefire-junit47-2.22.2.jar:2.22.2]
      	at org.apache.maven.surefire.junitcore.JUnitCoreWrapper.execute(JUnitCoreWrapper.java:75) [surefire-junit47-2.22.2.jar:2.22.2]
      	at org.apache.maven.surefire.junitcore.JUnitCoreProvider.invoke(JUnitCoreProvider.java:158) [surefire-junit47-2.22.2.jar:2.22.2]
      	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384) [surefire-booter-2.22.2.jar:2.22.2]
      	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345) [surefire-booter-2.22.2.jar:2.22.2]
      	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126) [surefire-booter-2.22.2.jar:2.22.2]
      	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418) [surefire-booter-2.22.2.jar:2.22.2]
      Caused by: java.sql.SQLException: Error executing: ALTER TABLE "RIGHTS" ADD COLUMN "ID" VARCHAR(36) NOT NULL : Table "RIGHTS" not found; SQL statement:
      ALTER TABLE "RIGHTS" ADD COLUMN "ID" VARCHAR(36) NOT NULL [42102-214]
      	at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.createTables(RepositoryImpl.java:756) ~[nuxeo-core-storage-sql-2021.36.9.jar:?]
      	at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.createDatabaseNoTx(RepositoryImpl.java:557) ~[nuxeo-core-storage-sql-2021.36.9.jar:?]
      	... 51 more
      Caused by: org.h2.jdbc.JdbcSQLSyntaxErrorException: Table "RIGHTS" not found; SQL statement:
      ALTER TABLE "RIGHTS" ADD COLUMN "ID" VARCHAR(36) NOT NULL [42102-214]
      	at org.h2.message.DbException.getJdbcSQLException(DbException.java:502) ~[h2-2.1.214.jar:2.1.214]
      	at org.h2.message.DbException.getJdbcSQLException(DbException.java:477) ~[h2-2.1.214.jar:2.1.214]
      	at org.h2.message.DbException.get(DbException.java:223) ~[h2-2.1.214.jar:2.1.214]
      	at org.h2.message.DbException.get(DbException.java:199) ~[h2-2.1.214.jar:2.1.214]
      	at org.h2.command.ddl.AlterTableAlterColumn.update(AlterTableAlterColumn.java:116) ~[h2-2.1.214.jar:2.1.214]
      	at org.h2.command.CommandContainer.update(CommandContainer.java:169) ~[h2-2.1.214.jar:2.1.214]
      	at org.h2.command.Command.executeUpdate(Command.java:252) ~[h2-2.1.214.jar:2.1.214]
      	at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:252) ~[h2-2.1.214.jar:2.1.214]
      	at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:223) ~[h2-2.1.214.jar:2.1.214]
      	at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:194) ~[commons-dbcp2-2.8.0.jar:2.8.0]
      	at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:194) ~[commons-dbcp2-2.8.0.jar:2.8.0]
      	at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.createTables(RepositoryImpl.java:754) ~[nuxeo-core-storage-sql-2021.36.9.jar:?]
      	at org.nuxeo.ecm.core.storage.sql.RepositoryImpl.createDatabaseNoTx(RepositoryImpl.java:557) ~[nuxeo-core-storage-sql-2021.36.9.jar:?]
      	... 51 more
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: