spring boot 笔记

  • 内容
  • 评论
  • 相关

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

spring boot需要配置好datasource才可以正常运行,在properties中

spring.datasource.url=jdbc:mysql://localhost:3306/mysql 
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
 

@RestController

这个标签是@Controller 和@ResponseBody的组合

如果遇到8080端口被占用,The Tomcat connector configured to listen on port 8080 failed to start intellij idea

1 netstat -ao |find /i "listening",查看8080端口被哪个进程占用

TCP 0.0.0.0:7981 machinename:0 LISTENING 2428 

TCP 0.0.0.0:7982 machinename:0 LISTENING 2428 

TCP 0.0.0.0:8080 machinename:0 LISTENING 12704 

TCP 0.0.0.0:8500 machinename:0 LISTENING 2428

2 Taskkill /F /IM 12704 (Note: Mention correct Process Id),杀掉此进程

评论

0条评论

发表评论

电子邮件地址不会被公开。 必填项已用*标注