idea:2018
环境:springboot+Hibernate
问题1:ava.net.BindException: Address already in use: bind
解决:端口被占用,一般是tomcat的端口被占用,找出占用端口的程序结束任务即可。如端口是8080,win+r→takcmd→netstat -ano|findstr "8080"→tasklist|findstr "上一步的结果pid"→xx.exe,结束这个进程即可。
问题2:启动项目的时候回弹出一个警告spring.jpa.open-in-view is enabled by default
解决:在application.yml中的配置
jpa:
hibernate:
ddl-auto: update
show-sql: true
open-in-view: false //设为false则不会出现警告
问题3:com.mysql.jdbc.Driver→com.mysql.cj.jdbc.Driver
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver//改变
url: jdbc:mysql://localhost:3306/qikan?useSSL=false&serverTimezone=UTC
username: root
password: 123456