您的位置:首页 > 大数据 > 人工智能

Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [

2010-11-30 17:11 766 查看
2010-11-30 15:47:28,328 ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed
org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'YonghushuxingAction' defined in ServletContext resource
[/WEB-INF/context/applicationContext-action.xml]: Cannot resolve reference to bean 'YonghushuxingService'
while setting bean property 'yonghushuxingService';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'YonghushuxingService' defined in ServletContext resource
[/WEB-INF/context/applicationContext-service.xml]:
Cannot resolve reference to bean 'YonghushuxingDAO'
while setting bean property 'yonghushuxingDAO';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'YonghushuxingDAO' defined in ServletContext resource
[/WEB-INF/context/applicationContext-dao.xml]:
Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory';
nested exception is org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'sessionFactory' defined in ServletContext resource
[/WEB-INF/context/applicationContext-hibernate.xml]:
Invocation of init method failed; nested exception is org.hibernate.HibernateException:
Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTuplizer]

我在部署好项目之后,出现了如此多的错误,百度,谷歌了一下,没有找到具体的解决办法,于是只能自己解决了。

在控制台里,上面错误的后边还有好多错误,我找到了最后的一条。

Caused by: org.hibernate.PropertyNotFoundException: Could not find a getter for flag in class cn.com.hanker.fengdian.model.Yonghushuxing
at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:306)
at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:299)
at org.hibernate.mapping.Property.getGetter(Property.java:294)
at org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertyGetter(PojoEntityTuplizer.java:300)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:141)
at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:78)
... 87 more

看一下字体放大的部分,我就从配置文件里找到了 flag这个属性,

原来在Hibernate的映射配置文件里,我的flag后面有空格,这样的属性配置和数据库里的属性不相符,于是我改过来了。

再次运行,终于成功了。

通过以上错误我觉得应该更认真点,属性名和数据库里面的字段名,最好是粘贴复制的,这样才不容易出错。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐