gpt4 book ai didi

java - 无法初始化类 liquibase.sqlgenerator.core.LockDatabaseChangeLogGenerator

转载 作者:行者123 更新时间:2023-12-01 18:27:33 26 4
gpt4 key购买 nike

当我尝试运行 Maven 测试时遇到此问题。不确定是什么导致了问题,因为这些测试之前运行时没有出现问题。我的依赖项由 maven 管理

Caused by: java.lang.NoClassDefFoundError: Could not initialize class liquibase.sqlgenerator.core.LockDatabaseChangeLogGenerator
at sun.reflect.GeneratedConstructorAccessor379.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:408)
at liquibase.sqlgenerator.SqlGeneratorFactory.<init>(SqlGeneratorFactory.java:39)
at liquibase.sqlgenerator.SqlGeneratorFactory.getInstance(SqlGeneratorFactory.java:53)
at liquibase.executor.AbstractExecutor.applyVisitors(AbstractExecutor.java:22)
at liquibase.executor.jvm.JdbcExecutor.access$500(JdbcExecutor.java:35)
at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:284)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:54)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:106)
at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:96)
at liquibase.lockservice.StandardLockService.init(StandardLockService.java:83)
at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:182)
at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:148)
at liquibase.Liquibase.update(Liquibase.java:189)
at liquibase.Liquibase.update(Liquibase.java:181)
at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:342)
at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:299)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1571)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1509)

最佳答案

在 OSX 上测试的快速修复:

在控制台中输入:

$ hostname -f   

输出应该看起来像这样:

MAC008.local

将其作为本地主机添加到您的主机文件中:

$ sudo vi /etc/hosts 

看起来有点像这样:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
fe80::1%lo0 localhost
127.0.0.1 MAC008.local

更改网络后重复此操作。

关于java - 无法初始化类 liquibase.sqlgenerator.core.LockDatabaseChangeLogGenerator,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25544993/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com