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后面有空格,这样的属性配置和数据库里的属性不相符,于是我改过来了。
再次运行,终于成功了。
通过以上错误我觉得应该更认真点,属性名和数据库里面的字段名,最好是粘贴复制的,这样才不容易出错。
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后面有空格,这样的属性配置和数据库里的属性不相符,于是我改过来了。
再次运行,终于成功了。
通过以上错误我觉得应该更认真点,属性名和数据库里面的字段名,最好是粘贴复制的,这样才不容易出错。
相关文章推荐
- ssh框架: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException:
- Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/hibernate/
- Invocation of init method failed; nested exception is org.hibernate.PropertyAccessException: Illegal
- Invocation of init method failed; nested exception is org.hibernate.MappingException
- Invocation of init method failed; nested exception is org.activiti.engine.ActivitiException: couldn'
- Initial SessionFactory creation failed.org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.t
- Invocation of init method failed; nested exception is org.apache.ibatis.binding.BindingException: In
- MyBatis笔记----报错:Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/ij34/mybatis/applicationContext.xml]: Invocation of init method failed; nested exception is org.sp
- org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity
- Invocation of init method failed; nested exception is java.lang.NoSuchMethodError:问题解决
- Hibernate 异常org.hibernate.HibernateException: Unable to instantiate default tuplizer
- CXF2.7.0配置REST和spring时报错:Error creating bean with name '***': Invocation of init method failed; nested exception is ***.ServiceConstructionException
- org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity
- nested exception is org.hibernate.HibernateException: Unable to get the default Bean Validation fact
- Caused by: org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.t
- MyBatis与Spring MVC结合时,使用DAO注入出现:Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sqlSessionFactory' or 'sqlSessionTemplate' are required
- Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Not a mana
- Invocation of init method failed; nested exception is java.io.FileNotFoundException: class path reso
- org.hibernate.HibernateException: Unable to instantiate default tuplizer [org.hibernate.tuple.entity
- Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: