严重: Exception sending context initialized event to listener instanceof class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException:Error creating bean with name 'sessionFactory' defined in ServletContextresource [/WEB-INF/applicationContext.xml]: Invocation of init method failed;nested exception is org.hibernate.MappingNotFoundException: resource:com/hwb/entity/Money.hbm.xml not found
atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1403)
。。。。
解决方案:
这问题是指hibernate.Cfg.xml文件的索引写的有问题即
Error creating bean with name 'moneyDao' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NoClassDefFoundError: net/sf/hibernate/Session
版本问题:
解决方案:daoimpl中
org.springframework.dao.DataIntegrityViolationException:not-null property references a null or transient value:com.bank.entity.Money.user; nested exception isorg.hibernate.PropertyValueException: not-null property references a null ortransient value: com.bank.entity.Money.user
解决方案:user中没有值;
3、关于对数据的修改,当在页面进行修改操作时当返回成功页面,控制台输出sql语句,但数据库数据没有进行修改时,说明在applicationContext.xml中事物方法书写有问题,需进行检测。或直接在Basdao中进行明码输入即
Session session = getHibernateTemplate().getSessionFactory().openSession();
Transactiontran = session.beginTransaction();
session.update(money);
tran.commit();
Error creating bean with name 'usersevice'defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Errorsetting property values; nested exception isorg.springframework.beans.NotWritablePropertyException: Invalid property'userDao' of bean class [com.bank.sevice.impl.Userseviceimpl]: Bean property'userDao' is not writable or has an invalid setter method. Does the parametertype of the setter match the return type of the getter?
两个必须相同否则就报错
严重: Exception sending context initialized event tolistener instance of classorg.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creatingbean with name 'regionalDao' defined in ServletContext resource[/WEB-INF/applicationContext.xml]: Error setting property values; nestedexception is org.springframework.beans.NotWritablePropertyException: Invalidproperty 'sessionFactory' of bean class [com.sshrsms.dao.impl.RegionalDaoImpl]:Bean property 'sessionFactory' is not writable or has an invalid setter method.Does the parameter type of the setter match the return type of the getter?
atorg.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1344)
解决方案:
500-Invalid action class configuration thatreferences an unknown class named [userAction]
解决方法:
Form表单name元素书写错误,导致无法自动创建Action所以检测表单传值是否有问题name书写是否有错误/.