org.hibernate.MappingException: Unknown entity: dxm.com.vo.User
2015-04-01 16:00
232 查看
struts+hibernate 搭的框架,what‘s wrong?
org.hibernate.MappingException: Unknown entity: dxm.com.vo.User ??
ok 在hibernate配置文件中没有配置。对象mapping。
原代码如下:
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql:///test</property>
<property name="hibernate.connection.user">root</property>
<property name="hibernate.connection.password">123###</property>
</session-factory>
</hibernate-configuration>
修改之后
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql:///test</property>
<property name="hibernate.connection.user">root</property>
<property name="hibernate.connection.password">123###</property>
<mapping resource="user.xml" />
</session-factory>
</hibernate-configuration>
org.hibernate.MappingException: Unknown entity: dxm.com.vo.User ??
ok 在hibernate配置文件中没有配置。对象mapping。
原代码如下:
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql:///test</property>
<property name="hibernate.connection.user">root</property>
<property name="hibernate.connection.password">123###</property>
</session-factory>
</hibernate-configuration>
修改之后
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql:///test</property>
<property name="hibernate.connection.user">root</property>
<property name="hibernate.connection.password">123###</property>
<mapping resource="user.xml" />
</session-factory>
</hibernate-configuration>
相关文章推荐
- org.hibernate.MappingException: Unknown entity: com.zhou.web.entity.User
- org.hibernate.MappingException: Unknown entity: com.pkms.entity.User
- org.hibernate.MappingException:unknown entity:com.lmy.model.User
- org.hibernate.MappingException: Unknown entity: com.test.xbt.entity.User
- Exception in thread "main" org.hibernate.MappingNotFoundException: resource: com.xzhl.user.model/Stu
- Exception in thread "main" org.hibernate.MappingException: Unknown entity: com.pojo.User
- org.hibernate.MappingException:unknown entity:com.lmy.model.User
- Hibernate 5;org.hibernate.MappingException: Unknown entity: com.my.model.User
- 求助!第一个hibernate程序报错 org.hibernate.MappingException: Unknown entity: com.pojo.User
- Exception in thread "main" org.hibernate.MappingException: Unknown entity: com.hibernate.domain.User
- (注解方式持久化类报错解决方案-仅供参考)org.hibernate.MappingException: Unknown entity: com.rx.entity.po.User
- myeclipse中出现 org.hibernate.MappingException: Unknown entity: cn.itcast.hibernate.domain.User
- Hibernate运行错误:org.hibernate.MappingException: An association from the table Teacher_user
- org.hibernate.MappingException: Unknown entity: java.lang.Class
- Hibernate 5 :- org.hibernate.MappingException: Unknown entity
- Hibernate错误 org.hibernate.MappingNotFoundException: resource: com/com/Person.hbm.xml not found
- org.hibernate.InvalidMappingException: Could not parse mapping document from resource com/**/**.hbm
- Caused by: org.hibernate.boot.MappingNotFoundException: Mapping (RESOURCE) not found : com/itcast/j
- Rhyme/ Hibernate5.x SessionFactory创建方式 以及org.hibernate.MappingException: Unknown entity异常
- 注解配置时报错:org.hibernate.MappingException: Unknown entity: