在给别人安装系统的时候,更新数据库,出现以下问题,求助啊,这是什么情况,debug 都不好弄

2019-12-17 23:40:12 +08:00
 wk1563396689

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'liquibase' defined in class path resource [org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration$LiquibaseConfiguration.class]: Invocation of init method failed; nested exception is liquibase.exception.LockException: liquibase.exception.DatabaseException: Table 'aurorabackend.databasechangeloglock' doesn't exist [Failed SQL: CREATE TABLE AuroraBackend.DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BIT(1) NOT NULL, LOCKGRANTED datetime NULL, LOCKEDBY VARCHAR(255) NULL, CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1745) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:576) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:498) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:307) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1083) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:853) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:546) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) at com.aurora.backend.Application.main(Application.java:22) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:48) at org.springframework.boot.loader.Launcher.launch(Launcher.java:87) at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51)

Caused by: liquibase.exception.LockException: liquibase.exception.DatabaseException: Table 'aurorabackend.databasechangeloglock' doesn't exist [Failed SQL: CREATE TABLE AuroraBackend.DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BIT(1) NOT NULL, LOCKGRANTED datetime NULL, LOCKEDBY VARCHAR(255) NULL, CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))] at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:289) at liquibase.lockservice.StandardLockService.waitForLock(StandardLockService.java:207) at liquibase.Liquibase.update(Liquibase.java:184) at liquibase.Liquibase.update(Liquibase.java:179) at liquibase.integration.spring.SpringLiquibase.performUpdate(SpringLiquibase.java:353) at liquibase.integration.spring.SpringLiquibase.afterPropertiesSet(SpringLiquibase.java:305) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1804) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1741) ... 26 common frames omitted

Caused by: liquibase.exception.DatabaseException: Table 'aurorabackend.databasechangeloglock' doesn't exist [Failed SQL: CREATE TABLE AuroraBackend.DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BIT(1) NOT NULL, LOCKGRANTED datetime NULL, LOCKEDBY VARCHAR(255) NULL, CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))] at liquibase.executor.jvm.JdbcExecutor$ExecuteStatementCallback.doInStatement(JdbcExecutor.java:356) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:57) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:125) at liquibase.executor.jvm.JdbcExecutor.execute(JdbcExecutor.java:109) at liquibase.lockservice.StandardLockService.init(StandardLockService.java:97) at liquibase.lockservice.StandardLockService.acquireLock(StandardLockService.java:246) ... 33 common frames omitted

3238 次点击
所在节点    Java
6 条回复
jeffh
2019-12-18 00:01:50 +08:00
Failed SQL: CREATE TABLE AuroraBackend.DATABASECHANGELOGLOCK (ID INT NOT NULL, LOCKED BIT(1) NOT NULL, LOCKGRANTED datetime NULL, LOCKEDBY VARCHAR(255) NULL, CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID))

怎么会在代码中出现建表语句,不应该是先建好表吗
airfling
2019-12-18 08:18:09 +08:00
数据库的表名大小写区分了,你把数据库的大小写区分关了
wk1563396689
2019-12-18 09:48:33 +08:00
@jeffh 这个是在给别人安装系统,会先装一遍数据库
wk1563396689
2019-12-18 14:30:22 +08:00
@airfling 安装系统的时候是 linux 的可以安装成功,mac 上就出现这样的问题了,linux 上是区分大小写的,mac 不区分,这个问题该怎么解决啊大佬
airfling
2019-12-18 15:54:26 +08:00
@wk1563396689 你数据库连接的时候统一关闭数据库大小写就可以了
wk1563396689
2019-12-20 10:04:50 +08:00
该问题已经解决,主要是 mac 上读取表名问题,大小写不敏感,我们在创建表的时候没有在 create table 表名,这个表名上加上引号,导致 mac 随意读取,读取的表名变成全小写,而实际的表名为全大写,读取失败

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/629975

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX