No active profile set, falling back to default profiles: default

No active profile set, falling back to default profiles: default
springboot启动报了上述错误。

:: Spring Boot ::        (v2.2.5.RELEASE)
2020-03-15 11:56:05.675 [main] INFO  com.Application - Starting Application on soliced with PID 6648 (E:\IDEA_Workspace\web_mybaits\target\classes started by solice in E:\IDEA_Workspace\web_mybaits)
2020-03-15 11:56:05.679 [main] INFO  com.Application - No active profile set, falling back to default profiles: default
2020-03-15 11:56:08.570 [main] INFO  o.s.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 8080 (http)
2020-03-15 11:56:08.580 [main] INFO  org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8080"]
2020-03-15 11:56:08.582 [main] INFO  org.apache.catalina.core.StandardService - Starting service [Tomcat]

解决方法:
新建application.yml,配置信息如下:

spring:
  profiles:
    active: dev

新建application-dev.yml文件作为开发时的配置文件,错误消失。

server:
  port: 8080

spring:
  datasource:
    username: root
    password: 123456
    url: jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=utf-8&useSSL=true&serverTimezone=UTC
    driver-class-name: com.mysql.cj.jdbc.Driver              #com.mysql.jdbc.Driver

mybatis:
  mapper-locations: classpath:mapping/*Mapper.xml
  type-aliases-package: com.entity
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值