zoukankan      html  css  js  c++  java
  • SpringCloud搭建项目遇到的问题

    mybatis+postgresql+jpa搭建项目

    使用RestTemplate调用API

    1.报错:

    Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
    2020-12-28 22:55:14.693 ERROR 5072 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 
    
    ***************************
    APPLICATION FAILED TO START
    ***************************
    
    Description:
    
    Cannot determine embedded database driver class for database type NONE
    
    Action:
    
    If you want an embedded database please put a supported one on the classpath. If you have database settings to be loaded from a particular profile you may need to active it (no profiles are currently active).

    2.问题代码

     

    3,解决方法,

      方案1:在启动类的注解加上exclude={DataSourceAutoConfiguration.class,HibernateJpaAutoConfiguration.class}

      方案2:在pom文件中加入database的包

     4.原因:

    spring boot默认会加载
    org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration

    类,DataSourceAutoConfiguration类使用了@Configuration注解向spring注入了dataSource bean。因为工程中没有关于dataSource相关的配置信息,当spring创建dataSource bean因缺少相关的信息就会报错

  • 相关阅读:
    bzoj2728
    bzoj4574
    loj2554
    bzoj1068
    bzoj2554
    Exception in thread "main" java.lang.AbstractMethodError
    java方法重载,java方法练习题
    java面向对象
    java编辑器 IntelliJ IDEA 安装——放弃过程;eclipse,Notepad++
    java二维数组
  • 原文地址:https://www.cnblogs.com/zhaomin08240115/p/14204236.html
Copyright © 2011-2022 走看看