当前位置: 首页 > news >正文

springboot多模块报错分析(一) - f

  1. Lombok 注解与 Jackson 序列化冲突
2025-11-13 [http-nio-8089-exec-1] INFO  org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/]- Initializing Spring DispatcherServlet 'dispatcherServlet'
2025-11-13 [http-nio-8089-exec-1] INFO  org.springframework.web.servlet.DispatcherServlet- Initializing Servlet 'dispatcherServlet'
2025-11-13 [http-nio-8089-exec-1] INFO  org.springframework.web.servlet.DispatcherServlet- Completed initialization in 1 ms
2025-11-13 [http-nio-8089-exec-9] WARN  org.springframework.http.converter.json.MappingJackson2HttpMessageConverter- Failed to evaluate Jackson deserialization for type [[simple type, class com.xq.web.sys_role.entity.SysRole]]: com.fasterxml.jackson.databind.JsonMappingException: Cannot deserialize Class lombok.Data (of type annotation) as a Bean
2025-11-13 [http-nio-8089-exec-9] WARN  org.springframework.http.converter.json.MappingJackson2HttpMessageConverter- Failed to evaluate Jackson deserialization for type [[simple type, class com.xq.web.sys_role.entity.SysRole]]: com.fasterxml.jackson.databind.JsonMappingException: Cannot deserialize Class lombok.Data (of type annotation) as a Bean
2025-11-13 [http-nio-8089-exec-9] WARN  org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver- Resolved [org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json;charset=UTF-8' not supported]
2025-11-13 [http-nio-8089-exec-10] WARN  org.springframework.http.converter.json.MappingJackson2HttpMessageConverter- Failed to evaluate Jackson deserialization for type [[simple type, class com.xq.web.sys_role.entity.SysRole]]: com.fasterxml.jackson.databind.JsonMappingException: Cannot deserialize Class lombok.Data (of type annotation) as a Bean
2025-11-13 [http-nio-8089-exec-10] WARN  org.springframework.http.converter.json.MappingJackson2HttpMessageConverter- Failed to evaluate Jackson deserialization for type [[simple type, class com.xq.web.sys_role.entity.SysRole]]: com.fasterxml.jackson.databind.JsonMappingException: Cannot deserialize Class lombok.Data (of type annotation) as a Bean
2025-11-13 [http-nio-8089-exec-10] WARN  org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver- Resolved [org.springframework.web.HttpMediaTypeNotSupportedException: Content type 'application/json;charset=UTF-8' not supported]

image
原因:我在SysRole实体类中使用了lombox的Data数据类型
解决:导入import java.util.Date;,日期类型使用的是该类
2.运行时候用到其他模块的资源怎么办:Spring 无法创建 SysRoleController 实例,根源是无法解析该类(通常因依赖缺失、类加载失败或注解冲突导致)

[main] ERROR org.springframework.boot.SpringApplication- Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sysRoleController': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [com.xq.web.sys_role.controller.SysRoleController] from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPos

解决:进入其他模块,执行命令mvn clean install,之后正常运行程序

http://www.jsqmd.com/news/41310/

相关文章:

  • 身为大厂前端的你,不能不知道Babel + Polyfill!
  • 跨域问题解决方案汇总
  • Access-Control-Allow-Origin 在企业中的用法
  • VUE_basic - Ref
  • 详细介绍:像素退场,曲线登场:现代响应式 CSS 全家桶 | 领码课堂
  • HTTPS 究竟比 HTTP 好在哪?
  • 小苯的因子查询
  • 详细介绍:MongoDB 自动化脚本安装方案
  • Linux网络--6、网络层 - 详解
  • 原型理解从入门到精通
  • 2025-11-15
  • 2025.11.15博客
  • Pandas - read_html()
  • 实用指南:Linux企业级解决方案架构:字节跳动短视频推荐系统全链路实践
  • 实用指南:PyTorch DataLoader 高级用法
  • 简单做一个舒尔特方格小游戏
  • C语言新手怎么快速掌握
  • RSS and Atom
  • Wi-Fi FTM(Fine Timing Measurement)简介
  • 通用会话控制方案
  • LISTAGG 用于将多行数据聚合为单行字符串(拼接),而与其功能相反的需求是 将单行字符串按指定分隔符拆分为多行数据
  • ESP32 I2S音频总线学习笔记(八):添加按键控制功能 - 详解
  • 2025年8款AI论文写作神器推荐:轻松搞定毕业论文查重
  • 基于python的酒店管理系统_36rhk752(Pycharm Flask Django成品源码LW) - 详解
  • pythontip 从字典中删除一组键
  • Softmax 函数全面而详细的解读,原理、图像、应用 - 详解
  • 中级前端工程师详细技能清单
  • Atcoder FPS 24 记录
  • 扩展单调栈扫描线维护历史信息
  • 酵母单杂交 (Y1H):蛋白质 - DNA 互作研究的 基因解码器