【spring mvc】后台spring mvc接收List参数报错如下:org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.util.List]: Specified class is an interface

时间:2021-12-15 10:23:07

后台spring mvc接收List参数报错如下:org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.util.List]: Specified class is an interface

org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.util.List]: Specified class is an interface
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:)
at org.springframework.web.method.annotation.ModelAttributeMethodProcessor.createAttribute(ModelAttributeMethodProcessor.java:)
at org.springframework.web.servlet.mvc.method.annotation.ServletModelAttributeMethodProcessor.createAttribute(ServletModelAttributeMethodProcessor.java:)
at org.springframework.web.method.annotation.ModelAttributeMethodProcessor.resolveArgument(ModelAttributeMethodProcessor.java:)
at org.springframework.web.method.support.HandlerMethodArgumentResolverComposite.resolveArgument(HandlerMethodArgumentResolverComposite.java:)
at org.springframework.web.method.support.InvocableHandlerMethod.getMethodArgumentValues(InvocableHandlerMethod.java:)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:)
at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:)
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:)
at java.lang.Thread.run(Thread.java:)

解决方案:

前台需要传入JSON格式的对象数组,后台即可正常接收

最简单的解决方法:

后台接收List<Object>参数的时候,使用注解@RequestBody即可

【spring mvc】后台spring mvc接收List参数报错如下:org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.util.List]: Specified class is an interface

【spring mvc】后台spring mvc接收List参数报错如下:org.springframework.beans.BeanInstantiationException: Failed to instantiate [java.util.List]: Specified class is an interface的更多相关文章

  1. Sturts2整合Spring报错:org&period;springframework&period;beans&period;factory&period;BeanDefinitionStoreException&colon; IOException parsing XML document from ServletContext resource &lbrack;&sol;WEB-INF&sol;applicationContext&period;xml&rsqb;&semi;

    十一月 17, 2019 1:11:44 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin警告: [SetPropertiesRul ...

  2. Spring报错: org&period;springframework&period;beans&period;factory&period;support&period;BeanDefinitionValidationException&colon; Couldn&&num;39&semi;t find an init method named &&num;39&semi;init&&num;39&semi; on bean with name &&num;39&semi;car&&num;39&semi;&lpar;待解答&rpar;

    在Spring工程里,有一个Car类的bean,Main.java主程序,MyBeanPostProcessor.java是Bean后置处理器. 文件目录结构如下: Car.java package ...

  3. Spring&colon;解决因&commat;Async引起的循环依赖报错

    最近项目中使用@Async注解在方法上引起了循环依赖报错: org.springframework.beans.factory.BeanCurrentlyInCreationException: Er ...

  4. Spring 整合 Flex (BlazeDS)无法从as对象 到 Java对象转换的异常:org&period;springframework&period;beans&period;ConversionNotSupportedException&colon; Failed to convert property value of type 'java&period;util&period;Date' to required type 'java&period;sql&period;Timestamp' for property 'wfsj'&semi; nested exception is java&period;lang&period;Ill

    异常信息如下: org.springframework.beans.ConversionNotSupportedException: Failed to convert property value ...

  5. 【spring data jpa】jpa中使用in查询或删除 在&commat;Query中怎么写 ,报错:org&period;springframework&period;expression&period;spel&period;SpelEvaluationException&colon; EL1007E&colon; Property or field &&num;39&semi;goodsConfigUid&&num;39&semi; cannot be found on null 怎么处理

    示例代码如下: @Modifying @Transactional @Query("delete from GoodsBindConfigMapping gbc " + &quot ...

  6. 单元测试时候使用&lbrack;ClassInitialize&rsqb;会该方法必须是静态的公共方法,不返回值并且应采用一个TestContext类型的参数报错的解决办法

    using Microsoft.VisualStudio.TestTools.UnitTesting; 如果该DLL应用的是 C:\Program Files\Microsoft Visual Stu ...

  7. 解决Spring MVC报No converter found for return value of type&colon;class java&period;util&period;ArrayList问题

    一.背景 在搭建一套Spring+SpringMVC+Mybatis(SSM)的环境(搭建步骤会在以后博客中给出),结果运行 程序时,适用@ResponseBody注解进行返回List<对象&g ...

  8. spring 的 ApplicationContext&period;getBean&lpar;type&rpar; 无法获取bean&comma;报错

    具体问题请看   https://q.cnblogs.com/q/108101/ 研究了两天: 经过上文中的排除法: 造成问题的原因是要获取的bean 中 有被切入的方法.. 就是可能该类会使用反射生 ...

  9. spring Boot异步操作报错误: org&period;springframework&period;beans&period;factory&period;NoSuchBeanDefinitionException&colon; No qualifying bean of type &&num;39&semi;com&period;self&period;spring&period;springboot&period;Jeep&&num;39&semi; available

    我也是最近开始学习Spring Boot,在执行异步操作的时候总是汇报如下的错误: Exception in thread "main" org.springframework.b ...

随机推荐

  1. Js 遍历json对象所有key及根据动态key获取值

    var obj = {}; for(var k in obj) { //遍历对象,k即为key,obj[k]为当前k对应的值 console.log(obj[k]); } 文章来自:https://z ...

  2. 用超链接提交表单,实现在动态网页的url中隐藏参数

    动态网页中怎么隐藏url参数传递 我们在做动态网站的时候往往会在各个页面之间传递参数,而这些参数的名称和值都会在url地址栏中被暴露出来,这样一方面不安全,另一方面也不便于搜索引擎的收录,有的时候还有 ...

  3. C&plus;&plus;复数类对除法运算符 &sol; 的重载

    C8-1 复数加减乘除 (100.0/100.0 points) 题目描述 求两个复数的加减乘除. 输入描述 第一行两个double类型数,表示第一个复数的实部虚部 第二行两个double类型数,表示 ...

  4. &lbrack;转&rsqb;面向过程的分析&lpar;POA&rpar;,和面向对象的分析&lpar;OOA&rpar;

    欢迎转载本文,转载地址: http://www.juliantec.info/articles/basic-concept/poa-and-ooa.html 软件开发方法论概述 在60年代的软件开发行 ...

  5. Codeforces Round &num;370 &lpar;Div&period; 2&rpar;(简单逻辑,比较水)

    C. Memory and De-Evolution time limit per test 2 seconds memory limit per test 256 megabytes input s ...

  6. IO输入输出 3

    编写BinIoDemo.java的Java应用程序,程序完成的功能是:完成1.doc文件的复制,复制以后的文件的名称为自己的学号姓名.doc. package com.hanqi.test; impo ...

  7. NDK 开发中,各种指令集的坑,arm64

          最近在NDK开发中遇到了一个奇怪的问题,希望记录下,可以帮到大家:         我编译了一些 .so 动态库,只编译了armeabi-v7a.armeabi 指令集,其它指令集编译不了 ...

  8. windows7 java环境配置

    最近在工作碰到了在ie浏览器调用java程序时,出现了一些问题,所以在这里整理一下: jdk的下载地址为:http://666dx.pc6.com/wwb3/jdkx6417.zip 正对于windo ...

  9. 【转载】 C&num;读写注册表

    文章地址:https://blog.csdn.net/younghaiqing/article/details/61918968 自Windows95以来的所有Windows版本中,注册表是包含Win ...

  10. 集群瓶颈为什么是磁盘io

    阅读本文思考: 1.对磁盘IO了解多少 2.为什么是磁盘IO是瓶颈,有没有自己的答案 想了解磁盘io可以查看此帖:集群瓶颈:磁盘IO必读 (磁盘IO:磁盘输出输出) 集群的瓶颈提出多种看法,其中网络和 ...