Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xm

来源:互联网 发布:北京学历提升 知乎 编辑:程序博客网 时间:2024/05/22 03:52

在编写ssh框架项目的时候出现了“Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from input stream”的错误信息。一般都会按照提示来找错误,于是去找Spring的配置文件,但是始终是没有发现错误是什么。然后重新检查了一边实体类的映射文件找到了问题。

实体类:

public class Product {private Integer pid;private String pname;private Double market_price;private Double shop_price;private String pdesc;private Integer is_hot;private Date pdate;        // set get}

然后我去我数据库里面找了找。

发现我实体里面少了“image”这个字段,添加上就好了。平时写代码一定要注意下细节,避免犯重复简单的错误。

阅读全文
0 0
原创粉丝点击