org.springframework.beans.factory.BeanCreationException
2016-09-19 10:57
483 查看
这要么就是applicationcontext.xml的bean属性配错了,要么就是*.hbm.xml映射文件属性配错了,下面就是我遇到的问题
Error creating bean with name 'transactionManager' defined in file [E:\myproject\.metadata\.me_tcat\webapps\Verycd-Movie\WEB-INF\classes\applicationContext.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 file [E:\myproject\.metadata\.me_tcat\webapps\Verycd-Movie\WEB-INF\classes\applicationContext.xml]: Invocation of init method
failed; nested exception is org.hibernate.MappingException: Could not determine type for: Integer, at table: VERYCD_COMMENT, for columns: [org.hibernate.mapping.Column(COMMENT_ID)]
很明显就是comment_id的类型不明确,所以我先检查实体类属性和映射文件对应列是否类型一致,发现我的是一致的,经过很久的排查,竟然发现是映射文件列类型是Integer,表面上没什么错,然而当我试着改成java.lang.Integer后,错误就消失了,我也是有点想骂娘。。。下面是截图
Error creating bean with name 'transactionManager' defined in file [E:\myproject\.metadata\.me_tcat\webapps\Verycd-Movie\WEB-INF\classes\applicationContext.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 file [E:\myproject\.metadata\.me_tcat\webapps\Verycd-Movie\WEB-INF\classes\applicationContext.xml]: Invocation of init method
failed; nested exception is org.hibernate.MappingException: Could not determine type for: Integer, at table: VERYCD_COMMENT, for columns: [org.hibernate.mapping.Column(COMMENT_ID)]
很明显就是comment_id的类型不明确,所以我先检查实体类属性和映射文件对应列是否类型一致,发现我的是一致的,经过很久的排查,竟然发现是映射文件列类型是Integer,表面上没什么错,然而当我试着改成java.lang.Integer后,错误就消失了,我也是有点想骂娘。。。下面是截图
相关文章推荐
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'homeurl' def
- 题目:org.springframework.beans.factory.BeanCreationException(hibernate中的jar包和spring中的jar包冲突)异常产生的原因和解决方案。
- org.springframework.beans.factory.BeanCreationException的问题所在!!
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFacto
- org.springframework.beans.factory.BeanCreationException
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'selectcommoninfo' defined in ServletCont
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContex
- 解决org.springframework.beans.factory.BeanCreationException: Error creating bean with name
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContex
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name
- ssh2 整合 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in Servl
- org.springframework.beans.factory.BeanCreationException(spring注入问题)
- org.springframework.beans.factory.BeanCreationException
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lanagerServi
- org.springframework.beans.factory.BeanCreationException: 某个错误
- org.springframework.beans.factory.BeanCreationException:
- org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFacto
- org.springframework.beans.factory.BeanCreationException
- 求答案:org.springframework.beans.factory.BeanCreationException
- org.springframework.beans.factory.BeanCreationException