SSH 问题解决部分方案

 

 

严重: 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书写是否有错误/.

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值