Context initialization failedorg.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘liquibase’ defined in ServletContext resource [/WEB-INF/classes/spring.xml]: Invocation of init method failed; nested exception is liquibase.exception.LockException: Could not acquire change log lock.
If you are having issues after an upgrade or after a server has been rebooted and logs are showing liquibase.exception.LockException: Could not acquire change log lock. Below are the steps to resolve this error.
(Linux commands in brackets)
- Stop Variphy service – (sudo service variphy stop)
- Make sure there are no Insight pids running – (service variphy status) – (ps aux | grep tomcat)
- Connect to h2 – (cd /opt/variphy/apps/insight) to browse to directory. Then run – (sudo ./jre/bin/java -cp app/tomcat/webapps/insight/WEB-INF/lib/h2-1.4.196.jar org.h2.tools.Shell -user Variphy -password V@riphy -url jdbc:h2://opt/variphy/apps/insight/db/h2/insight)
- You should now be in sql command line. Run the list command – (list)
- Run the select command to show status of lock – (SELECT * FROM DATABASECHANGELOGLOCK;)
You should see the output as lock=true
- Next you will run this command to unlock – (update DATABASECHANGELOGLOCK set locked = FALSE, LOCKGRANTED=null, LOCKEDBY=null;)
- Exit sql – (exit)
- Start Variphy service – (sudo service variphy start)