ResponseBodyAdvice (Spring Framework 6.2.0 API)
不到或无法加载主类
springboot启动时报错 错误: 找不到或无法加载主类 com.xxx.xxx.Application
从svn上拉下来一个自动生成代码的小项目,遇到一个贼大的坑,运行提示找不到或无法加载主类 com.xxx.xxx.Application,找了很多方法才解决,解决方法就是打开idea的控制台,输入以下三行命令
mvn clean compile
mvn install
mvn spring-boot:run
启动WARN:This primary key of “id“ is primitive !不建议如此请使用包装类 in Class
解决方案
将对象中的主键改为非原始类型即可。
如:
@Data
public class UserPO {
@TableId(value = "id", type = IdType.AUTO)
private int id;
private String userId;
}
改为:@Data
public class UserPO {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private String userId;
}