zoukankan      html  css  js  c++  java
  • Springboot异常汇总

    pom文件的 spring-boot-maven-plugin报红

    版本号需要和springboot的版本号一致

    image

    初步搭建springboot应用,报错:Failed to configure a DataSource: 'url' attribute is not specified and no embedd

    版本号需要和springboot的版本号一致

    Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.

    翻译就是:无法配置DataSource:未指定'url'属性,也无法配置嵌入数据源。
    很明显,就是你在应用中没有配置datasource的一些相关属性,例如:地址值啊,数据库驱动啊,用户名啊,密码啊,
    SpringBoot的最大一个好处就是自动配置:所以我们只是需要给他配置文件的值,它就会自动配置。配置在application.properties文件中

    #访问根路径
    
    #应用名称
    spring.application.name=flowable
    
    #访问端口号
    server.port=8080
    
    #编码格式
    server.tomcat.uri-encoding=utf-8
    
    #数据库相关配置
    spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
    spring.datasource.url=jdbc:mysql://localhost:3306/flowable
    spring.datasource.username=root
    spring.datasource.password=123456
    spring.datasource.max-idle=10
    spring.datasource.max-wait=10000
    spring.datasource.min-idle=5
    spring.datasource.initial-size=5
    
    #session生命周期
    server.servlet.session.timeout=30m
    

    当然,也可以不配置,但是你需要声明一下启动类头部声明就可以了:
    @SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})

  • 相关阅读:
    C++头文件相互引用,最好一个#include,另一个class C;
    Git 安装配置
    loadrunner字符串赋值
    loadrunner 调用外部dll
    redis启动、清缓存命令
    solr-6.4.1 学习安装与配置 和 Elasticsearch(1.5.2)学习文档
    分页
    JS原型理解
    angular2 依赖注入新坑。
    javascript数组传值与地址。
  • 原文地址:https://www.cnblogs.com/mjtabu/p/15732670.html
Copyright © 2011-2022 走看看