MappingException: Unknown entity

原因是:hibernate配置文件里面没加载!!!!!

在配置文件中加上报错的entity的.hbm.xml的配置即可;

加上<value>classpath*:/mappings/*.hbm.xml</value>

加之前

<!-- 批量加载系统配置管理相关hbm.xml -->

<property name="mappingLocations">

<list>

<value>classpath*:/com/ist/configure/management/vo/*.hbm.xml</value>

<value>classpath*:/com/ist/hbm/*.hbm.xml</value>

<value>classpath*:/mappings/bcms/*.hbm.xml</value>

<value>classpath*:/mappings/api/http/*.hbm.xml</value>

</list>

</property>

加之后

<!-- 批量加载系统配置管理相关hbm.xml -->

<property name="mappingLocations">

<list>

<value>classpath*:/com/ist/configure/management/vo/*.hbm.xml</value>

<value>classpath*:/com/ist/hbm/*.hbm.xml</value>

<value>classpath*:/mappings/bcms/*.hbm.xml</value>

<value>classpath*:/mappings/api/http/*.hbm.xml</value>

<value>classpath*:/mappings/*.hbm.xml</value>

</list>

</property>

时间: 2024-08-25 08:15:00

MappingException: Unknown entity的相关文章

令人哭笑不得的org.hibernate.MappingException: Unknown entity

今天处理的任务是从一套系统中分离出微信易信功能代码添加到另一套系统中..本来是一个很简单的任务,但是分离移植过去后,一运行报了个错: nested exception is org.hibernate.MappingException: Unknown entity 一看错误提示,看来是hibernate的映射出问题了,看了一下po类存在,又看了一下映射的.hbm.xml配置文件也在,看了一下内容也没问题,也不可能有问题本来就是现成系统中分离出来的..有点迷惑了,百度了一下,有说@Entity注

org.hibernate.MappingException: Unknown entity:

严重: Exception occurred during processing request: Unknown entity: com.hf.gfr.dao.impl.GfTeamPositionDaoImpl org.hibernate.MappingException: Unknown entity: com.hf.gfr.dao.impl.GfTeamPositionDaoImpl at org.hibernate.internal.SessionFactoryImpl.getEnti

Hibernate 5.X 版本中Exception in thread &quot;main&quot; org.hibernate.MappingException: Unknown entity: cn.xxx.p

最近开始使用最新版本的Hibernate5,所有的配置感觉都正确却还是没有结果. 使用如下: public static void main(String[] args) throws Exception { Configuration cfg = new Configuration().configure(); ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder().applySettings(cfg.get

org.hibernate.MappingException:Unknown entity:java.util.ArrayList

1.错误描述 [CQ] ERROR [http-apr-8888-exec-3] com.opensymphony.xwork2.util.logging.commons.CommonsLogger.error (38)|Exception occurred during processing request:Unknown entity:java.util.ArrayList 2.错误描述 3.解决办法

Hibernate报错org.hibernate.MappingException: Unknown entity: 。。。。

这是因为Hibernate 4.x和5.x中的ServiceRegistry写法不同造成的Hibernate 4.x  //1.创建一个SessionFactory对象  SessionFactory sessionFactory=null;  //2.创建一个configuration对象,必须要根据你基本配置信息和映射关系  Configuration config=new Configuration().configure();  //3.要创建session对象  Session ses

hibernate Unknown entity异常解决方案

org.hibernate.MappingException: Unknown entity异常详细信息如下: org.hibernate.MappingException: Unknown entity: com.gis520.model.Emp_emp at org.hibernate.impl.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:628) at org.hibernate.impl.SessionImp

Mingyang.net:注解配置Hibernate时报错Unknown Entity

注解配置时报错:org.hibernate.MappingException: Unknown entity: net.mingyang.cms.bean.User org.hibernate.MappingException: Unknown entity: net.mingyang.cms.bean.User at org.hibernate.internal.SessionFactoryImpl.getEntityPersister(SessionFactoryImpl.java:1096

Unknown entity: org.jbpm.services.task.audit.TaskEventImpl

1. use this persistence.xml - simply copy it into src/main/resources/META-INF <persistence version="2.0" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd http://java.su

springMVC问题XXX is not mapped [from XX]或者Unknown entity: com.spring.main.pojo.Person

这个问题搞了一天到凌晨才发现一个地方没有配置 期初以为是 hql语句写错,但是发现没有,网上搜来搜去都是说pojo的类名写成表名 ,这样低级错误可能会有,审视了n遍,发现不是,可是为什么还是会报同样的错误呢 当我改用get方法获取 数据库记录时发现 出现此错误Unknown entity: com.spring.main.pojo.Person ,后来发现也不是映射注解写错了,那怎么回事呢,郁闷了很久很久很久.................. 最后开始行一行看spring配置文件,靠居然发现了