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(DelegatingConstructorAccessorImpl.java:45)
  4. at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
  5. at liquibase.sqlgenerator.SqlGeneratorFactory.(SqlGeneratorFactory.java:39)
  6. at liquibase.sqlgenerator.SqlGeneratorFactory.getInstance(SqlGeneratorFactory.java:53)
  7. at liquibase.executor.AbstractExecutor.applyVisitors(AbstractExecutor.java:22)
  8. at liquibase.executor.jvm.JdbcExecutor.access$500(JdbcExecutor.java:35)
  9. at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:284)
  10. at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:54)
  11. at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:106)
  12. at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:96)
  13. at liquibase.lockservice.StandardLockService.init(StandardLockService.java:83)
  14. at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:182)
  15. at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:148)
  16. at liquibase.Liquibase.update(Liquibase.java:189)
  17. at liquibase.Liquibase.update(Liquibase.java:181)
  18. at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:342)
  19. at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:299)
  20. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571)
  21. at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)

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. http://www.datical.com/

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

java.net.UnknownHostException: DEAN:DEAN.

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

localhost name resolution is handled within DNS itself.

  1. 127.0.0.1       localhost
  2. ::1

                localhost

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. http://www.datical.com/