小编bl4*_*ird的帖子

spring-boot,spring-boot-starter-data-jpa:数据库类型为NONE或找不到更改日志位置

我再次,现在有一个spring-boot-starter-data-jpa问题.我使用spring-boot来访问多个数据库.MongoDB是正确的,也是Cassandra,最后一个PostgreSQL和JPA有一些问题.我认为我的配置可能有误.你能帮我解决一下吗?我使用了spring-boot,spring-data-jpa引用和spring-boot-starter-data-jpa引用.什么都没有帮助.我发现一些线程在stakeoverflow,使用jdbc与hsql依赖,因为jpa将无法正常工作链接.我自己尝试了这个,但是我得到了一个没有合格的bean错误.

所以我退后一步,包括jpa和hsql,写一个PostgresConfig类没有任何帮助.如果我使用@EnableJpaRepositories Annotation,我会收到有线错误.请参阅Stacktrace Para 67.5.2错误...我没有使用这个liquibase thingy,idk为什么会出现错误...否则,如果我不使用DataSourceBuilder,我的application.properties将无法读取,我得到了数据库键入NONE错误.

一些来源:堆栈跟踪:

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration$LiquibaseConfiguration': Invocation of init method failed; nested exception is java.lang.IllegalStateException: Cannot find changelog location: class path resource [db/changelog/db.changelog-master.yaml] (please add changelog or check your Liquibase configuration)
    at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:408)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
    at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:368)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1119)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1014)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299) …
Run Code Online (Sandbox Code Playgroud)

spring spring-data-jpa spring-boot

3
推荐指数
1
解决办法
8628
查看次数

标签 统计

spring ×1

spring-boot ×1

spring-data-jpa ×1