springboot 启动报错
问题:java.nio.charset.malformedinputexception: input length = 1
原因:配置文件中存在中文
解决:先删除中文注释,运行程序;成功运行后再重新粘贴中文注释,程序正常运行
springboot 启动后访问报错
问题:org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):
原因:mybatis 的全局配置文件和 sql 映射文件没有写
解决:在 application.yml 中添加 mybatis 配置
mybatis:
# 全局配置文件
config-location: classpath:mybatis/mybatisConf.xml
# sql 映射文件
mapper-locations: classpath:mybatis/mapper/*.xml
# configuration:
# # 开启驼峰命名
# map-underscore-to-camel-case: true
application.yml 问题整合(application.properties)
问题:driver-class-name: com.mysql.cj.jdbc.Driver
爆红
解决:在 pom.xml 中添加 mysql 依赖
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
</dependency>
问题:Invalid DataSize: cannot convert ‘30Kb’ to Long
解决:单词大写,统一 KB
、MB
等
maven package jar 包相关问题
问题:.\target\demo-0.0.1-SNAPSHOT.jar中没有主清单属性
解决:将 pom 文件中的这段 skip 注释调