概述
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后面有空格,这样的属性配置和数据库里的属性不相符,于是我改过来了。
再次运行,终于成功了。
通过以上错误我觉得应该更认真点,属性名和数据库里面的字段名,最好是粘贴复制的,这样才不容易出错。
最后
以上就是高兴板栗为你收集整理的Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [的全部内容,希望文章能够帮你解决Invocation of init method failed; nested exception is org.hibernate.HibernateException: Unable to instantiate default tuplizer [所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复