当前位置: 代码迷 >> Java Web开发 >> 各位帮看看这是什么错啊解决思路
  详细解决方案

各位帮看看这是什么错啊解决思路

热度:106   发布时间:2016-04-17 10:25:51.0
各位帮看看这是什么错啊
我打开tomcat5.5是就报这个错啊, 我用的是ssh框架

Error creating bean with name 'sessionFactory' defined in file [C:\Program Files\Java\Tomcat 5.5\webapps\ROOT\WEB-INF\classes\applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.MappingException: An association from the table user_role refers to an unmapped class: com.oa01.entity.Roles

------解决方案--------------------
An association from the table user_role refers to an unmapped class: com.oa01.entity.Roles

先确定是否有这个实体 : com.oa01.entity.Roles
看里面是不是对应错了,本身为com.oa02.entity.Roles 的,却成了 com.oa01.entity.Roles

其次看你user_role实体的映射文件,看字段和属性是否对应,然后在实体里看属性名和映射文件的属性名是否对应!
------解决方案--------------------
你的角色表role.hbm.xml没有在配置文件里面配置,所以找不到!
  相关解决方案