复制代码

为懒人提供无限可能,生命不息,code不止

人类感性的情绪,让我们知难行难
我思故我在
日拱一卒,功不唐捐
  • 首页
  • 前端
  • 后台
  • 数据库
  • 运维
  • 资源下载
  • 实用工具
  • 接口文档工具
  • 登录
  • 注册

其它

【原创】openfeign's interface get error org.springframework.web.servlet.resource.NoResourceFoundException: No static resource

作者: whooyun发表于: 2025-03-07 17:00

Back-end Stack: 
1、java21
2、springboot3,spring-cloud2023

Issue Background:
Service A calls Service B’s OpenFeign interface, the interface call is successful, but there is abnormal log output in the console.
Exception:
org.springframework.web.servlet.resource.NoResourceFoundException: No static resource  /damageClaimForm/damageClaimForm/formExport


Reason of this problem:

the return value of Service B’s OpenFeign interface must be json,and the code is formdata. 

the way of solving the problem:

1、modify @Controller to @RestController 
2、add @ResponseBody on method of interface