java.lang.IllegalStateException: No primary or single unique constructor found for interface org.spr

这篇具有很好参考价值的文章主要介绍了java.lang.IllegalStateException: No primary or single unique constructor found for interface org.spr。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

@Configuration
public class WebMvcConfig extends WebMvcConfigurationSupport {
    
    @Override
        public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
            argumentResolvers.add( new PageableHandlerMethodArgumentResolver());
        }
    }
}

在项目中添加如上配置文件,主要是重写 addArgumentResolvers 方法,如果还是报同样的错误,请确保项目中只有一个类 继承了 WebMvcConfigurationSupport,在这个类中重写 addArgumentResolvers 方法。文章来源地址https://www.toymoban.com/news/detail-536083.html

到了这里,关于java.lang.IllegalStateException: No primary or single unique constructor found for interface org.spr的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包赞助服务器费用

相关文章

  • springboot传递List类型参数报错 No primary or single unique constructor found for interface java.util.List

    springboot传递List类型参数报错 No primary or single unique constructor found for interface java.util.List

    昨天在做毕设进行一对多插入的时候 出现了500错误 先看代码 mapper层代码 这里我是list集合进行一对多插入 控制层 前端  页面展示 然后页面显示500错误  查看控制台   报错:No primary or single unique constructor found for interface java.util.List     at org.springframework.beans.BeanUtils.getResol

    2024年02月11日
    浏览(13)
  • 请求500失败-No primary or single unique constructor found for interface xxx

    请求500失败-No primary or single unique constructor found for interface xxx

    错误:No primary or single unique constructor found for interface java.util.List(没有为List接口找到主要的或唯一的构造函数) 原因:请求的参数没有匹配上处理函数的参数 解决:为List参数添加@RequestParam(\\\"strList\\\")指定参数名称即可 附加:本接口为测试异常接口,一般多个参数会封装为一个入

    2024年02月12日
    浏览(13)
  • spring boot kotlin webflux 或 web 多文件上传 报错400 415 No primary or single unique constructor found for

    spring boot kotlin webflux 或 web 多文件上传 报错400 415 No primary or single unique constructor found for

    #当我们使用Kotlin编写Spring Boot进行多文件上传的时候,传统的方法如下: 此时会有如下几种情况: 以上是第一种情况,直接报错,并提示无主构造函数。这时我们通过互联网搜索可能会在形参上加上: @RequestParam (web)或者 @RequestPart (webflux)。如下: 然后后端没报错了,返回值

    2024年02月15日
    浏览(16)
  • Caused by: java.lang.IllegalStateException: No DataSource set

    如果Nacos连不上数据库,还哪都配置正确,请注意时区 serverTimezone=Asia/Shanghai

    2024年02月11日
    浏览(79)
  • No primary or default constructor found for interface java.util.List

    No primary or default constructor found for interface java.util.List

    有时候我们前端会传一些 list 集合的参数,如果 list 集合的存储的类型是对象,通过 json 就可以封装,后端使用注解 @RequestBody 可以接收。如果是想传递通过装箱后的基本类型的 list ,需要使用到注解 @RequestParam。 后端没有使用 @RequestParam,swagger和postman传参数就会报这个错误

    2024年02月12日
    浏览(13)
  • No primary or default constructor found for interface javax.servlet.http.HttpServletRequest

    前言: 前不久在写开放平台项目中,想直接在微服务网关Gateway中写对外接口,并想通过传统的HttpServlet方式去拿请求里面的数据,在Controller的方法参数上加上HttpServerRequest却发现报错。 1、问题复现 在我们使用spring-boot-starter-web依赖的时候,我们可以在controller的接口类的方法

    2024年02月16日
    浏览(14)
  • 深入解析java.lang.IllegalStateException异常

    异常是程序在执行过程中遇到的错误或异常情况。在Java中,异常是指在程序运行期间发生的错误,它可以打破程序的正常流程,并且可能导致程序终止。 异常分为两种类型:受检异常(checked exception)和非受检异常(unchecked exception)。 受检异常:在方法声明中必须显式地声

    2024年02月10日
    浏览(17)
  • java.lang.IllegalStateException异常原因和解决

    Iterator.remove() 迭代删除 引发 1. Iterator.remove() 迭代删除 引发 场景示例 问题分析

    2024年02月16日
    浏览(83)
  • 解决Caused by: java.lang.IllegalStateException:

    目录 问题描述 解决方案 1. 修改JVM的-Xss参数 2. 检查循环继承依赖项 3. 更新相关库和依赖 总结 在使用Java开发Web应用程序时,我们有时会遇到​ ​Caused by: java.lang.IllegalStateException​ ​​异常,其中包含一个关于StackOverflow错误的描述。这种错误可能会导致无法完成对Web应用程

    2024年02月03日
    浏览(251)
  • java连接redis,日志报错java.lang.IllegalStateException

    java连接redis,日志报错java.lang.IllegalStateException

    日志具体报错如下,无法启动应用 pom.xml java程序 出现这种问题的原因是版本不合适,使用springboot版本2.7.6,但是使用spring-boot-date的版本是1.7.2.RELEASE 注释版本 重新启动java程序,启动成功

    2024年01月23日
    浏览(12)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包