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

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

  •  
  •   wk1563396689 · 2019-12-17 23:40:12 +08:00 · 3215 次点击
    这是一个创建于 1804 天前的主题,其中的信息可能已经有所发展或是发生改变。

    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  
       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
        2
    airfling  
       2019-12-18 08:18:09 +08:00
    数据库的表名大小写区分了,你把数据库的大小写区分关了
    wk1563396689
        3
    wk1563396689  
    OP
       2019-12-18 09:48:33 +08:00
    @jeffh 这个是在给别人安装系统,会先装一遍数据库
    wk1563396689
        4
    wk1563396689  
    OP
       2019-12-18 14:30:22 +08:00
    @airfling 安装系统的时候是 linux 的可以安装成功,mac 上就出现这样的问题了,linux 上是区分大小写的,mac 不区分,这个问题该怎么解决啊大佬
    airfling
        5
    airfling  
       2019-12-18 15:54:26 +08:00
    @wk1563396689 你数据库连接的时候统一关闭数据库大小写就可以了
    wk1563396689
        6
    wk1563396689  
    OP
       2019-12-20 10:04:50 +08:00
    该问题已经解决,主要是 mac 上读取表名问题,大小写不敏感,我们在创建表的时候没有在 create table 表名,这个表名上加上引号,导致 mac 随意读取,读取的表名变成全小写,而实际的表名为全大写,读取失败
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5889 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 06:26 · PVG 14:26 · LAX 22:26 · JFK 01:26
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.