Springboot常见错误汇总

1、SQL报错

SQL Error: 0, SQLState: 42601
o.h.engine.jdbc.spi.SqlExceptionHelper : ERROR: syntax error at or near order
org.hibernate.exception.SQLGrammarException: could not execute statement] with root cause

解决方法:column order为数据库保留字,不能作为列名,修改后解决。

2、thymeleaf导入html文件报错

Error resolving template [table.basic_table], template might not exist or might not be accessible
报错原因:没有找到对应的html文件,thymeleaf默认查找html的文件夹是templates,如果没有放在这个文件夹下面可以通过application.yaml文件修改prefix为对应html文件所在位置。
解决方法1:修改prefix

spring:
  thymeleaf:
    prefix: classpath:/templates/

解决方法2:当有多层文件夹嵌套的时候,子文件夹的表示形式决定了是否能找到对应html文件,如果directory.table的方式报错,就尝试使用directory/table,反之亦然。

持续更新中…

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值