Could not create and/or set value back on to object .
严重: Error building bean
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'cn.it.shop.model.Category': Unsatisfied dependency expressed through constructor argument with index 0 of type [java.lang.String]: : No qualifying bean of type [java.lang.String] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [java.lang.String] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [java.lang.String] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {
}
严重: Could not create and/or set value back on to object
java.lang.InstantiationException: cn.it.shop.model.Category
at java.lang.Class.newInstance(Class.java:359)
at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:158)
at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:204)
at com.opensymphony.xwork2.conversion.impl.InstantiatingNullHandler.createObject(InstantiatingNullHandler.java:163)
严重: Exception occurred during processing request: attempt to create saveOrUpdate event with null entity
java.lang.IllegalArgumentException: attempt to create saveOrUpdate event with null entity
at org.hibernate.event.spi.SaveOrUpdateEvent.<init>(SaveOrUpdateEvent.java:62)
at org.hibernate.event.spi.SaveOrUpdateEvent.<init>(SaveOrUpdateEvent.java:45)
at org.hibernate.internal.SessionImpl.update(SessionImpl.java:731)
at org.hibernate.internal.SessionImpl.update(SessionImpl.java:726)
at cn.it.shop.service.impl.CategoryServiceImpl.update(CategoryServiceImpl.java:46)
- 原因:
struts2的model driven机制采用了反射机制
反射机制要求用户类必须要有无参构造方法
当一个类没有构造方法时,java缺省为其加一个无参构造方法
当你为一个类添加构造方法时,实际上就禁掉了java缺省为类添加无参构造方法这个动作.
也就是说当你为类添加构造方法后,你的类实际上就没有无参构造方法了,也就不支持反射机制了
Could not create and/or set value back on to object .的更多相关文章
- js Object.create 初探
1.作用 Object.create()方法创建一个新对象,使用现有的对象来提供新创建的对象的__proto__. https://developer.mozilla.org/zh-CN/docs/W ...
- How to create PDF files in a Python/Django application using ReportLab
https://assist-software.net/blog/how-create-pdf-files-python-django-application-using-reportlab CONT ...
- Create Fiori List App Report with ABAP CDS view – PART 2
In the Part 1 blog, we have discussed below topics CDS annotations for Fiori List Report. How to cre ...
- Object.create 以及 Object.setPrototypeOf
第一部分 Object.crate() 方法是es5中的关于原型的方法, 这个方法会使用指定的原型对象以及属性去创建一个新的对象. 语法 Object.create(proto, [ properti ...
- [Ramda] Create a Query String from an Object using Ramda's toPairs function
In this lesson, we'll use Ramda's toPairs function, along with map, join, concatand compose to creat ...
- Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class org.apache.catalina.connector.CoyoteWriter and no properties discovered to create BeanSerializer
一.什么是序列化In computer science, in the context of data storage, serialization is the process of transla ...
- Django中的Model.objects.create() 和 Model() 的区别?
Django 官方文档说明 objects.create 是 A convenience method for creating an object and saving it all in one ...
- 多线程爬坑之路-Thread和Runable源码解析
多线程:(百度百科借一波定义) 多线程(英语:multithreading),是指从软件或者硬件上实现多个线程并发执行的技术.具有多线程能力的计算机因有硬件支持而能够在同一时间执行多于一个线程,进而提 ...
- 前端开发:面向对象与javascript中的面向对象实现(二)构造函数与原型
前端开发:面向对象与javascript中的面向对象实现(二)构造函数与原型 前言(题外话): 有人说拖延症是一个绝症,哎呀治不好了.先不说这是一个每个人都多多少少会有的,也不管它究竟对生活有多么大的 ...
随机推荐
- Educational Codeforces Round 8 F. Bear and Fair Set 最大流
F. Bear and Fair Set 题目连接: http://www.codeforces.com/contest/628/problem/F Description Limak is a gr ...
- iOS 带箭头菜单选项弹窗LFPopupMenu
一.效果图 由于是模拟器缩得比较小,一些细线可能显示不出来,不是bug哈. 二.用法 LFPopupMenuItem *item1 = [LFPopupMenuItem createWithTitle ...
- mysql memory存储引擎简单测试
Auth: jin Date: 20140423 mysql> CREATE TABLE `t4` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` ...
- 移动应用安全开发指南(Android)--数据传输
概述 移动应用很多时候并非孤立存在,在多数场景下存在前.后台以及第三方服务之间进行数据交互,因此,在网络中传输敏感数据在所难免,如果不使用正确安全的传输方式,有可能存在敏感信息泄漏的风险. 安全准则 ...
- FORM动态LIST ITEM
DECLARE rg_list_item recordgroup; ret_code NUMBER; BEGIN --SQL里必做是以值键两个字段顺序,并且都要为字符串类型 rg_list_item ...
- 【java】java中替换中括号[ ]操作
String aa ="[1,2,3]"; aa = aa.replaceAll("[\\[\\]]",""); 结果为 1,2,3
- 【JSP EL】使用EL表达式比较 动态选中 select中的option
<option value="${k.key }" ${KPIThis.parent.parent.thisId == k.key ? "selected" ...
- java >>> 和 >>>=的区别
java >> 和 >>> 以及 >>>= 的区别 可能大家都知道java中>> 和 >>> 的区别,那这里我也啰嗦一下, ...
- img转base64的两种方式的比较
关于图片转base64然后提交后台,项目中一直用的是canvas的toDataUrl方法,但是之前看HTML5 API文档的时候,一直记得好像有个叫fileReader的东西也可以做到.于是过年无事的 ...
- Kubernetes应用迁移问题定位
这个帖子记录所有的应用迁移中遇到的问题. 关于镜像无法启动后无法定位问题 在原有的Dockerfile中修改,加入 RUN echo "aaa" > /etc/a.log C ...