首页   注册   登录
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
GeekHub
wk1563396689
V2EX  ›  Java

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

  •  
  •   wk1563396689 · 115 天前 · 2230 次点击
    这是一个创建于 115 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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

    6 条回复    2019-12-20 10:04:50 +08:00
    jeffh
        1
    jeffh   115 天前
    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
        2
    airfling   114 天前
    数据库的表名大小写区分了,你把数据库的大小写区分关了
    wk1563396689
        3
    wk1563396689   114 天前
    @jeffh 这个是在给别人安装系统,会先装一遍数据库
    wk1563396689
        4
    wk1563396689   114 天前
    @airfling 安装系统的时候是 linux 的可以安装成功,mac 上就出现这样的问题了,linux 上是区分大小写的,mac 不区分,这个问题该怎么解决啊大佬
    airfling
        5
    airfling   114 天前
    @wk1563396689 你数据库连接的时候统一关闭数据库大小写就可以了
    wk1563396689
        6
    wk1563396689   112 天前
    该问题已经解决,主要是 mac 上读取表名问题,大小写不敏感,我们在创建表的时候没有在 create table 表名,这个表名上加上引号,导致 mac 随意读取,读取的表名变成全小写,而实际的表名为全大写,读取失败
    关于   ·   FAQ   ·   API   ·   我们的愿景   ·   广告投放   ·   感谢   ·   实用小工具   ·   1111 人在线   最高记录 5168   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 19ms · UTC 19:35 · PVG 03:35 · LAX 12:35 · JFK 15:35
    ♥ Do have faith in what you're doing.