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中的面向对象实现(二)构造函数与原型 前言(题外话): 有人说拖延症是一个绝症,哎呀治不好了.先不说这是一个每个人都多多少少会有的,也不管它究竟对生活有多么大的 ...
随机推荐
- 【数论】nefu119 组合素数
算组合数中的素因子p的个数,基本同这题 http://www.cnblogs.com/autsky-jadek/p/6592194.html #include<cstdio> using ...
- python3-开发进阶Django中序列化以及rest_framework的序列化
一.django框架的序列化 直接上代码 1.这是app下的models.py from django.db import models # Create your models here. clas ...
- html在线美化网站
Html在线美化压缩/转js - 在线工具 地址:http://tool.lu/html/ 1.美化效果: 2.转化字符串拼接
- EASYUI DATAGRID加合计
想达到的效果(计算当前展示的20条的合计数量(一言难尽)): 参考http://www.jb51.net/article/85645.htm(万分感谢该文的作者) 相关代码: function onL ...
- UIButton中的三个UIEdgeInsets属性
接着昨天的 UIButton中的三个UIEdgeInsets属性 ,今天我们具体谈谈UIButton的contentEdgeInsets.titleEdgeInsets.imageEdgeInsets ...
- 《Word排版艺术》读后感,兼谈LaTeX
我有两年多的LaTeX使用经验,用它排实验报告.毕业论文和书籍(半本):Word的使用时间长一些,但真正用好也不过是近一两年的事.这两个软件我都 用得很熟,我想我可以一边谈谈读<Word排版艺术 ...
- InternalError: (pymysql.err.InternalError) (1205, u'Lock wait timeout exceeded; try restarting transaction')
在mysql innodb中使用事务,如果插入或者更新出错,一定要主动显式地执行rollback,否则可能产生不必要的锁而锁住其他的操作 我们在使用数据库的时候,可以使用contextlib,这样异常 ...
- [Guava] EventBus
1. 发布-订阅模式 发布-订阅模式(publish-subscribe)是一种编程范式,发布方不发布消息给特定的接收方,而是由订阅方选择性接收.这使得发布方和订阅方相对独立,减少了耦合性. 在发布 ...
- Android媒体扫描详细解析之一(MediaScanner & MediaProvider)
用过Android手机的同学都知道,每次开机的时候系统会先扫描sdcard,sdcard重新插拔(挂载)也会扫描一次sdcard. 为什么要扫描sdcard,其实是为了给系统的其他应用提供便利,比如, ...
- [PHP]如何使用Mobile_Detect来判断访问网站的设备:安卓,平板,电脑
Mobile_Detect 是一个轻量级的开源移动设备(手机)检测的 PHP Class, 它使用 User-Agent 中的字符串,并结合 HTTP Header,来检测移动设备环境. 这个设备检测 ...