Could not initialize class liquibase.sqlgenerator.core.LockDatabaseChangeLogGenerator

Getting this issue when I try to run maven test. Not sure what’s causing the issue as these test ran before without issues. My dependencies are being managed by maven    

  1.     Caused by: java.lang.NoClassDefFoundError: Could not initialize class liquibase.sqlgenerator.core.LockDatabaseChangeLogGenerator
  2. at sun.reflect.GeneratedConstructorAccessor379.newInstance(Unknown Source)
  3. at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(
  4. at java.lang.reflect.Constructor.newInstance(
  5. at liquibase.sqlgenerator.SqlGeneratorFactory.(
  6. at liquibase.sqlgenerator.SqlGeneratorFactory.getInstance(
  7. at liquibase.executor.AbstractExecutor.applyVisitors(
  8. at liquibase.executor.jvm.JdbcExecutor.access$500(
  9. at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(
  10. at liquibase.executor.jvm.JdbcExecutor.execute(
  11. at liquibase.executor.jvm.JdbcExecutor.execute(
  12. at liquibase.executor.jvm.JdbcExecutor.execute(
  13. at liquibase.lockservice.StandardLockService.init(
  14. at liquibase.lockservice.StandardLockService.acquireLock(
  15. at liquibase.lockservice.StandardLockService.waitForLock(
  16. at liquibase.Liquibase.update(
  17. at liquibase.Liquibase.update(
  18. at liquibase.integration.spring.SpringLiquibase.performUpdate(
  19. at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(
  20. at
  21. at

Ok so I added the -X flag but, still unsure what is causing this issue. See link for stacktrace. 

Any time you see a NoClassDefFound error, the problem is almost certainly an issue with the classpath. You can diagnoze the issue further by running maven with the -X switch to enable debug output. 

Steve Donie
Principal Software Engineer
Datical, Inc.

OK so I debugged my maven test and found that the static method in LockDatabaseChangeLogGenerator was throwing the error. I am getting this error: DEAN:DEAN.

When I check my hosts file, I’m seeing this:

localhost name resolution is handled within DNS itself.

  1.       localhost
  2. ::1


Not sure what is causing this at this point. Can someone assist?

Looks like some sort of networking issue. Somewhere in your config you are asking for a connection to DEAN:DEAN, but that is not resolving. If that is your own machine, you might try changing the name to localhost rather than DEAN. 

Steve Donie
Principal Software Engineer
Datical, Inc.