org.hsqldb.HsqlException: user lacks privilege or object not found: DATABASECHANGELOGLOCK











up vote
1
down vote

favorite
2












How can this happen.



Isn't liquibase supposed to create this table for itself...



This is an in memory database created for unit testing.




public void setUp(String contexts) {
try {
ResourceAccessor resourceAccessor = new FileSystemResourceAccessor();
Class.forName("org.hsqldb.jdbcDriver");
holdingConnection = getConnectionImpl();
HsqlConnection hsconn = new HsqlConnection(holdingConnection);
liquibase = new Liquibase(CHANGE_LOG, resourceAccessor, hsconn);
liquibase.dropAll();
liquibase.update(contexts);
hsconn.close();
} catch (Exception ex) {
LOG.error("Error during database initialization", ex);
throw new RuntimeException("Error during database initialization", ex);
}
}
private Connection getConnectionImpl() throws SQLException {
return DriverManager.getConnection(CONNECTION_STRING, USER_NAME, PASSWORD);
}



Same as in the hsqldb examples



The stacktrace:




 2014-06-15 21:50:34,195 [DEBUG] [PropertySourcesPropertyResolver,getProperty(),103] - Could not find key 'spring.liveBeansView.mbeanDomain' in any property source. Returning [null]
2014-06-15 21:50:34,195 [DEBUG] [CacheAwareContextLoaderDelegate,loadContext(),93] - Storing ApplicationContext in cache under key [[MergedContextConfiguration@5879ff89 testClass = SampleUnitTest, locations = '{}', classes = '{class context.RepositoryContextConfig, class context.repoConfig}', contextInitializerClasses = '', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]].
2014-06-15 21:50:34,198 [DEBUG] [AbstractBeanFactory,doGetBean(),249] - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
INFO 21:50 15/06/14: liquibase: Successfully acquired change log lock
INFO 21:50 15/06/14: liquibase: Dropping Database Objects in schema: PUBLIC.PUBLIC
INFO 21:50 15/06/14: liquibase: Creating database history table with name: PUBLIC.DATABASECHANGELOG
INFO 21:50 15/06/14: liquibase: Successfully released change log lock
2014-06-15 21:51:17,842 [ERROR] [HsqlDatabase,setUp(),41] - Error during database initialization
liquibase.exception.LockException: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error executing SQL select count(*) from PUBLIC.DATABASECHANGELOGLOCK: user lacks privilege or object not found: DATABASECHANGELOGLOCK
at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:214)
at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:153)
at liquibase.Liquibase.update(Liquibase.java:182)
at liquibase.Liquibase.update(Liquibase.java:174)
at context.HsqlDatabase.setUp(HsqlDatabase.java:38)
at context.SampleUnitTest.onlyOnce(SampleUnitTest.java:19)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
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.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87)
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.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error executing SQL select count(*) from PUBLIC.DATABASECHANGELOGLOCK: user lacks privilege or object not found: DATABASECHANGELOGLOCK
at liquibase.lockservice.StandardLockService.isDatabaseChangeLogLockTableInitialized(StandardLockService.java:121)
at liquibase.lockservice.StandardLockService.init(StandardLockService.java:95)
at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:187)










share|improve this question


























    up vote
    1
    down vote

    favorite
    2












    How can this happen.



    Isn't liquibase supposed to create this table for itself...



    This is an in memory database created for unit testing.




    public void setUp(String contexts) {
    try {
    ResourceAccessor resourceAccessor = new FileSystemResourceAccessor();
    Class.forName("org.hsqldb.jdbcDriver");
    holdingConnection = getConnectionImpl();
    HsqlConnection hsconn = new HsqlConnection(holdingConnection);
    liquibase = new Liquibase(CHANGE_LOG, resourceAccessor, hsconn);
    liquibase.dropAll();
    liquibase.update(contexts);
    hsconn.close();
    } catch (Exception ex) {
    LOG.error("Error during database initialization", ex);
    throw new RuntimeException("Error during database initialization", ex);
    }
    }
    private Connection getConnectionImpl() throws SQLException {
    return DriverManager.getConnection(CONNECTION_STRING, USER_NAME, PASSWORD);
    }



    Same as in the hsqldb examples



    The stacktrace:




     2014-06-15 21:50:34,195 [DEBUG] [PropertySourcesPropertyResolver,getProperty(),103] - Could not find key 'spring.liveBeansView.mbeanDomain' in any property source. Returning [null]
    2014-06-15 21:50:34,195 [DEBUG] [CacheAwareContextLoaderDelegate,loadContext(),93] - Storing ApplicationContext in cache under key [[MergedContextConfiguration@5879ff89 testClass = SampleUnitTest, locations = '{}', classes = '{class context.RepositoryContextConfig, class context.repoConfig}', contextInitializerClasses = '', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]].
    2014-06-15 21:50:34,198 [DEBUG] [AbstractBeanFactory,doGetBean(),249] - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
    INFO 21:50 15/06/14: liquibase: Successfully acquired change log lock
    INFO 21:50 15/06/14: liquibase: Dropping Database Objects in schema: PUBLIC.PUBLIC
    INFO 21:50 15/06/14: liquibase: Creating database history table with name: PUBLIC.DATABASECHANGELOG
    INFO 21:50 15/06/14: liquibase: Successfully released change log lock
    2014-06-15 21:51:17,842 [ERROR] [HsqlDatabase,setUp(),41] - Error during database initialization
    liquibase.exception.LockException: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error executing SQL select count(*) from PUBLIC.DATABASECHANGELOGLOCK: user lacks privilege or object not found: DATABASECHANGELOGLOCK
    at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:214)
    at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:153)
    at liquibase.Liquibase.update(Liquibase.java:182)
    at liquibase.Liquibase.update(Liquibase.java:174)
    at context.HsqlDatabase.setUp(HsqlDatabase.java:38)
    at context.SampleUnitTest.onlyOnce(SampleUnitTest.java:19)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    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.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
    at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
    at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87)
    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.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
    Caused by: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error executing SQL select count(*) from PUBLIC.DATABASECHANGELOGLOCK: user lacks privilege or object not found: DATABASECHANGELOGLOCK
    at liquibase.lockservice.StandardLockService.isDatabaseChangeLogLockTableInitialized(StandardLockService.java:121)
    at liquibase.lockservice.StandardLockService.init(StandardLockService.java:95)
    at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:187)










    share|improve this question
























      up vote
      1
      down vote

      favorite
      2









      up vote
      1
      down vote

      favorite
      2






      2





      How can this happen.



      Isn't liquibase supposed to create this table for itself...



      This is an in memory database created for unit testing.




      public void setUp(String contexts) {
      try {
      ResourceAccessor resourceAccessor = new FileSystemResourceAccessor();
      Class.forName("org.hsqldb.jdbcDriver");
      holdingConnection = getConnectionImpl();
      HsqlConnection hsconn = new HsqlConnection(holdingConnection);
      liquibase = new Liquibase(CHANGE_LOG, resourceAccessor, hsconn);
      liquibase.dropAll();
      liquibase.update(contexts);
      hsconn.close();
      } catch (Exception ex) {
      LOG.error("Error during database initialization", ex);
      throw new RuntimeException("Error during database initialization", ex);
      }
      }
      private Connection getConnectionImpl() throws SQLException {
      return DriverManager.getConnection(CONNECTION_STRING, USER_NAME, PASSWORD);
      }



      Same as in the hsqldb examples



      The stacktrace:




       2014-06-15 21:50:34,195 [DEBUG] [PropertySourcesPropertyResolver,getProperty(),103] - Could not find key 'spring.liveBeansView.mbeanDomain' in any property source. Returning [null]
      2014-06-15 21:50:34,195 [DEBUG] [CacheAwareContextLoaderDelegate,loadContext(),93] - Storing ApplicationContext in cache under key [[MergedContextConfiguration@5879ff89 testClass = SampleUnitTest, locations = '{}', classes = '{class context.RepositoryContextConfig, class context.repoConfig}', contextInitializerClasses = '', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]].
      2014-06-15 21:50:34,198 [DEBUG] [AbstractBeanFactory,doGetBean(),249] - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
      INFO 21:50 15/06/14: liquibase: Successfully acquired change log lock
      INFO 21:50 15/06/14: liquibase: Dropping Database Objects in schema: PUBLIC.PUBLIC
      INFO 21:50 15/06/14: liquibase: Creating database history table with name: PUBLIC.DATABASECHANGELOG
      INFO 21:50 15/06/14: liquibase: Successfully released change log lock
      2014-06-15 21:51:17,842 [ERROR] [HsqlDatabase,setUp(),41] - Error during database initialization
      liquibase.exception.LockException: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error executing SQL select count(*) from PUBLIC.DATABASECHANGELOGLOCK: user lacks privilege or object not found: DATABASECHANGELOGLOCK
      at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:214)
      at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:153)
      at liquibase.Liquibase.update(Liquibase.java:182)
      at liquibase.Liquibase.update(Liquibase.java:174)
      at context.HsqlDatabase.setUp(HsqlDatabase.java:38)
      at context.SampleUnitTest.onlyOnce(SampleUnitTest.java:19)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      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.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
      at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
      at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87)
      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.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
      at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
      Caused by: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error executing SQL select count(*) from PUBLIC.DATABASECHANGELOGLOCK: user lacks privilege or object not found: DATABASECHANGELOGLOCK
      at liquibase.lockservice.StandardLockService.isDatabaseChangeLogLockTableInitialized(StandardLockService.java:121)
      at liquibase.lockservice.StandardLockService.init(StandardLockService.java:95)
      at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:187)










      share|improve this question













      How can this happen.



      Isn't liquibase supposed to create this table for itself...



      This is an in memory database created for unit testing.




      public void setUp(String contexts) {
      try {
      ResourceAccessor resourceAccessor = new FileSystemResourceAccessor();
      Class.forName("org.hsqldb.jdbcDriver");
      holdingConnection = getConnectionImpl();
      HsqlConnection hsconn = new HsqlConnection(holdingConnection);
      liquibase = new Liquibase(CHANGE_LOG, resourceAccessor, hsconn);
      liquibase.dropAll();
      liquibase.update(contexts);
      hsconn.close();
      } catch (Exception ex) {
      LOG.error("Error during database initialization", ex);
      throw new RuntimeException("Error during database initialization", ex);
      }
      }
      private Connection getConnectionImpl() throws SQLException {
      return DriverManager.getConnection(CONNECTION_STRING, USER_NAME, PASSWORD);
      }



      Same as in the hsqldb examples



      The stacktrace:




       2014-06-15 21:50:34,195 [DEBUG] [PropertySourcesPropertyResolver,getProperty(),103] - Could not find key 'spring.liveBeansView.mbeanDomain' in any property source. Returning [null]
      2014-06-15 21:50:34,195 [DEBUG] [CacheAwareContextLoaderDelegate,loadContext(),93] - Storing ApplicationContext in cache under key [[MergedContextConfiguration@5879ff89 testClass = SampleUnitTest, locations = '{}', classes = '{class context.RepositoryContextConfig, class context.repoConfig}', contextInitializerClasses = '', activeProfiles = '{}', contextLoader = 'org.springframework.test.context.support.DelegatingSmartContextLoader', parent = [null]]].
      2014-06-15 21:50:34,198 [DEBUG] [AbstractBeanFactory,doGetBean(),249] - Returning cached instance of singleton bean 'org.springframework.transaction.config.internalTransactionAdvisor'
      INFO 21:50 15/06/14: liquibase: Successfully acquired change log lock
      INFO 21:50 15/06/14: liquibase: Dropping Database Objects in schema: PUBLIC.PUBLIC
      INFO 21:50 15/06/14: liquibase: Creating database history table with name: PUBLIC.DATABASECHANGELOG
      INFO 21:50 15/06/14: liquibase: Successfully released change log lock
      2014-06-15 21:51:17,842 [ERROR] [HsqlDatabase,setUp(),41] - Error during database initialization
      liquibase.exception.LockException: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error executing SQL select count(*) from PUBLIC.DATABASECHANGELOGLOCK: user lacks privilege or object not found: DATABASECHANGELOGLOCK
      at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:214)
      at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:153)
      at liquibase.Liquibase.update(Liquibase.java:182)
      at liquibase.Liquibase.update(Liquibase.java:174)
      at context.HsqlDatabase.setUp(HsqlDatabase.java:38)
      at context.SampleUnitTest.onlyOnce(SampleUnitTest.java:19)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      at java.lang.reflect.Method.invoke(Unknown Source)
      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.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
      at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
      at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87)
      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.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
      at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
      at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
      at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176)
      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
      Caused by: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: Error executing SQL select count(*) from PUBLIC.DATABASECHANGELOGLOCK: user lacks privilege or object not found: DATABASECHANGELOGLOCK
      at liquibase.lockservice.StandardLockService.isDatabaseChangeLogLockTableInitialized(StandardLockService.java:121)
      at liquibase.lockservice.StandardLockService.init(StandardLockService.java:95)
      at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:187)







      testing hsqldb liquibase






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jun 15 '14 at 18:59









      Gleeb

      3,7831056110




      3,7831056110
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          0
          down vote













          That error on hsqldb usually means the table doesn't exist. The "does the databasechangelog table exist" caching mechanism can become incorrect if you drop the databasechangelog table after it has been checked.



          There is a fix for that in an the upcoming liquibase 3.3 version, but for now if you add ChangeLogHistoryServiceFactory.getInstance().reset() where you clear out your database it should fix the problem.






          share|improve this answer




























            up vote
            0
            down vote













            I believe this error can occur, when your connection is closed or invalid.



            I get the same error when using Hsqldb-2.3.2 with a connection pool (like dbcp) and a validationQuery. Once a validationQuery has invalidated the connection the error is thrown on next database access.



            Since your in a test, this will not be your Problem, but you could debug the connection and see if it is open at the time of error.






            share|improve this answer





















              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f24233037%2forg-hsqldb-hsqlexception-user-lacks-privilege-or-object-not-found-databasechan%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              0
              down vote













              That error on hsqldb usually means the table doesn't exist. The "does the databasechangelog table exist" caching mechanism can become incorrect if you drop the databasechangelog table after it has been checked.



              There is a fix for that in an the upcoming liquibase 3.3 version, but for now if you add ChangeLogHistoryServiceFactory.getInstance().reset() where you clear out your database it should fix the problem.






              share|improve this answer

























                up vote
                0
                down vote













                That error on hsqldb usually means the table doesn't exist. The "does the databasechangelog table exist" caching mechanism can become incorrect if you drop the databasechangelog table after it has been checked.



                There is a fix for that in an the upcoming liquibase 3.3 version, but for now if you add ChangeLogHistoryServiceFactory.getInstance().reset() where you clear out your database it should fix the problem.






                share|improve this answer























                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  That error on hsqldb usually means the table doesn't exist. The "does the databasechangelog table exist" caching mechanism can become incorrect if you drop the databasechangelog table after it has been checked.



                  There is a fix for that in an the upcoming liquibase 3.3 version, but for now if you add ChangeLogHistoryServiceFactory.getInstance().reset() where you clear out your database it should fix the problem.






                  share|improve this answer












                  That error on hsqldb usually means the table doesn't exist. The "does the databasechangelog table exist" caching mechanism can become incorrect if you drop the databasechangelog table after it has been checked.



                  There is a fix for that in an the upcoming liquibase 3.3 version, but for now if you add ChangeLogHistoryServiceFactory.getInstance().reset() where you clear out your database it should fix the problem.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jun 18 '14 at 13:46









                  Nathan Voxland

                  10.3k13148




                  10.3k13148
























                      up vote
                      0
                      down vote













                      I believe this error can occur, when your connection is closed or invalid.



                      I get the same error when using Hsqldb-2.3.2 with a connection pool (like dbcp) and a validationQuery. Once a validationQuery has invalidated the connection the error is thrown on next database access.



                      Since your in a test, this will not be your Problem, but you could debug the connection and see if it is open at the time of error.






                      share|improve this answer

























                        up vote
                        0
                        down vote













                        I believe this error can occur, when your connection is closed or invalid.



                        I get the same error when using Hsqldb-2.3.2 with a connection pool (like dbcp) and a validationQuery. Once a validationQuery has invalidated the connection the error is thrown on next database access.



                        Since your in a test, this will not be your Problem, but you could debug the connection and see if it is open at the time of error.






                        share|improve this answer























                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          I believe this error can occur, when your connection is closed or invalid.



                          I get the same error when using Hsqldb-2.3.2 with a connection pool (like dbcp) and a validationQuery. Once a validationQuery has invalidated the connection the error is thrown on next database access.



                          Since your in a test, this will not be your Problem, but you could debug the connection and see if it is open at the time of error.






                          share|improve this answer












                          I believe this error can occur, when your connection is closed or invalid.



                          I get the same error when using Hsqldb-2.3.2 with a connection pool (like dbcp) and a validationQuery. Once a validationQuery has invalidated the connection the error is thrown on next database access.



                          Since your in a test, this will not be your Problem, but you could debug the connection and see if it is open at the time of error.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Aug 5 '14 at 7:31









                          felvhage

                          57746




                          57746






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f24233037%2forg-hsqldb-hsqlexception-user-lacks-privilege-or-object-not-found-databasechan%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              The Sandy Post

                              Danny Elfman

                              Pages that link to "Head v. Amoskeag Manufacturing Co."