请求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,异常问题,java

no primary or single unique,异常问题,java

错误:No primary or single unique constructor found for interface java.util.List(没有为List接口找到主要的或唯一的构造函数)

原因:请求的参数没有匹配上处理函数的参数

no primary or single unique,异常问题,java

解决:为List参数添加@RequestParam("strList")指定参数名称即可

附加:本接口为测试异常接口,一般多个参数会封装为一个入参VO对象,使用JSON格式解析传入对象文章来源地址https://www.toymoban.com/news/detail-526339.html

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

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

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

相关文章

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

    在项目中添加如上配置文件,主要是重写 addArgumentResolvers 方法,如果还是报同样的错误,请确保项目中只有一个类 继承了 WebMvcConfigurationSupport,在这个类中重写 addArgumentResolvers 方法。

    2024年02月13日
    浏览(34)
  • 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日
    浏览(14)
  • 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日
    浏览(10)
  • 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日
    浏览(11)
  • 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日
    浏览(11)
  • C#12中的Primary Constructors(主构造函数)

    什么是主构造函数 把参数添加到class与record的类声明中就是主构造函数。例如 这种写法与以下代码写法一样 需要注意的是,类的所有其他构造函数都必须通过 this() 构造函数调用直接或间接调用主构造函数。 主构造函数参数的最常见用途包括但不限于以下几个方面: 初始化

    2024年02月05日
    浏览(8)
  • liunx nginx配置ssl 配置https 及访问失败问题排查(fopen:No such file or )([emerg] the “ssl“ parameter requires)

    liunx nginx配置ssl 配置https 及访问失败问题排查(fopen:No such file or )([emerg] the “ssl“ parameter requires)

    1.ssl证书下载 比如腾讯云下载目录: 首先在网址(阿里云、腾讯云等)找到域名ssl下载,下载后解压里面有xxx.yey、xxx.pem、xxx.crt等文件 在服务器nginx配置里新建个文件夹,如我的nginx 在 /usr/local/nginx这个目录 2.将ssl证书文件拷贝至服务器 如: 3.检查有没有ssl插件(nginx -V 中V大写

    2024年02月13日
    浏览(11)
  • 报错TypeError: Class extends value undefined is not a constructor or null

    在执行npm run build的时候遇到了错误:TypeError: Class extends value undefined is not a constructor or null;而执行npm run serve是可以正常执行的,报错如下: Building for production... ERROR  TypeError: Class extends value undefined is not a constructor or null TypeError: Class extends value undefined is not a constructor or null

    2024年02月16日
    浏览(9)
  • [Unity] No.1 Single单例模式

    定义 :单例模式是指在内存中只会 创建且仅创建一次对象的设计模式 。在程序中 多次使用同一个对象且作用相同 时,为了 防止频繁地创建对象使得内存飙升 ,单例模式可以让程序仅在内存中创建一个对象,让所有需要调用的地方都共享这一单例对象。在Unity的编程中比如

    2024年02月01日
    浏览(6)
  • java.lang.IllegalArgumentException: Cannot pass null or empty values to constructor at org.springf

    java.lang.IllegalArgumentException: Cannot pass null or empty values to constructor at org.springf

      java.lang.IllegalArgumentException: Cannot pass null or empty values to constructor     at org.springframework.security.core.userdetails.User.init(User.java:113)     at org.springframework.security.core.userdetails.User$UserBuilder.build(User.java:535)     at com.example.mz.spingsecurity_jwt_deepstudy.SpingsecurityJwtDeepstudyApplicationTests.tes

    2024年02月04日
    浏览(9)

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

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

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

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

二维码1

领取红包

二维码2

领红包