Loading

Cursor开发SpringBoot Java项目初体验

Java项目的配置失败心得:

情况-1:页面请求体中包含中文时,后端接不到,页面报:ILLEGAL_REQUEST JSON parse error: Invalid UTF-8 middle byte 0xee

解决方法是在配置文件中添加如下配置

spring:
  jackson:
    date-format: yyyy-MM-dd HH:mm:ss
    time-zone: GMT+8
    default-property-inclusion: non_null
    # 确保 JSON 解析和序列化使用 UTF-8
    mapper:
      accept-case-insensitive-enums: true

  

情况0:添加完vm参数后启动还是报:Failed to bind properties under 'spring.cloud.nacos.config.password' to java.lang.String:

直接在配置文件中添加

jasypt:
  encryptor:
    password: xxx

  

情况1:没找到启动主类的参数配置,比如启动时需要添加vm参数和环境变量

 https://zhuanlan.zhihu.com/p/1920842927908815772

 

情况2:没有把项目作为Java项目

 

情况3:项目启动不了并遇到 "Main method not found in the file, please define the main method as: public static void main(String] args)" 这个错误

https://blog.csdn.net/fengwh18/article/details/132873126

posted @ 2026-01-15 13:12  Jicing  阅读(2)  评论(0)    收藏  举报