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