`
v5browser
  • 浏览: 1140246 次
社区版块
存档分类
最新评论

Hibernate:开发中遇到的异常以及异常分析 - 定期更新

 
阅读更多

1.hql语句的问题:

from customer where name='中国大厦'
其实这个错误并没有错
因为hibernate操作的是对象而不是数据库
所以
此hql语句应该修改如下
from Customer where name='中国大厦'

2.Error creating bean with name 'getCustomer' defined in file [C:\Green\Develop\apache-tomcat-7.0.26\webapps\CRM_3\WEB-INF\classes\com\sdu\crm\applicationContext\applicationContext-customer-lzm.xml]: Cannot resolve reference to bean 'atService' while setting bean property 'atService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'atService' defined in file [C:\Green\Develop\apache-tomcat-7.0.26\webapps\CRM_3\WEB-INF\classes\com\sdu\crm\applicationContext\applicationContext-customer-zjc.xml]: Cannot resolve reference to bean 'atDao' while setting bean property 'atDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'atDao' defined in file [C:\Green\Develop\apache-tomcat-7.0.26\webapps\CRM_3\WEB-INF\classes\com\sdu\crm\applicationContext\applicationContext-customer-zjc.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 [C:\Green\Develop\apache-tomcat-7.0.26\webapps\CRM_3\WEB-INF\classes\com\sdu\crm\applicationContext\applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: Could not determine type for: String, for columns: [org.hibernate.mapping.Column(remark)]

解决该异常:
<property name="remark" column="remark" type="String" length="200"></property>
注意:type:的值应该是string 而不是 String

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics