提示的错误信息如下:

org.hibernate.MappingException: Unknown entity: com.ossez.reoc.common.crm.DoNotCall
at org.hibernate.metamodel.internal.MetamodelImpl.entityPersister(MetamodelImpl.java:670)
at org.hibernate.internal.SessionImpl.getEntityPersister(SessionImpl.java:1721)
at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:118)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:192)
at org.hibernate.event.internal.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:38)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:177)
at org.hibernate.event.internal.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:32)
at org.hibernate.event.internal.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:73)
at org.hibernate.internal.SessionImpl.fireSave(SessionImpl.java:713)
at org.hibernate.internal.SessionImpl.save(SessionImpl.java:705)
at org.hibernate.internal.SessionImpl.save(SessionImpl.java:700)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.hibernate.context.internal.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:350)
at com.sun.proxy.$Proxy51.save(Unknown Source)
at com.ossez.reoc.common.Factory.save(Factory.java:159)
at com.ossez.reoc.common.crm.factories.DoNotCallFactory.save(DoNotCallFactory.java:27)
at com.ossez.reoc.common.tests.DoNotCallTest.testCreate(DoNotCallTest.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:252)
at junit.framework.TestSuite.run(TestSuite.java:247)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:86)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

这个错误很有可能是你的 SessionFactory 在初始化的时候出现了错误。

导致了 Hibernate 不能找到正确的实体配置。

请参考: Hibernate 4 升级到 Hibernate 5 的时候 SessionFactory 不能使用 中的内容。

Hibernate 4 升级到 5 后显示未知实体错误的更多相关文章

  1. xcode7.3 升级 xcode8.0 后权限设置问题(升级xcode 8.0 后构建版本不显示问题)

    xcode7.3 升级 xcode8.0 后权限设置问题(升级xcode 8.0 后构建版本不显示问题) 前两天为了适配 iOS10 的系统 我将xcode 7.3 升级到了 xcode 8.0 但是 ...

  2. Hibernate 5 升级后 getProperties 错误

    升级到 Hibernate 5 后,提示有错误: org.hibernate.engine.spi.SessionFactoryImplementor.getProperties()Ljava/uti ...

  3. Mac升级到Yosemite后默认的php版本不支持imagetfftext函数问题解决

    Mac升级到yosemite后,php也自动升级,运行项目的时候发现后台验证码显示不出来.调试一下发现imagetfftext这个函数不存在,应该gd没有安装完全,因为Mac上的php实现系统自带的, ...

  4. 运行ipython后显示WARNING: IPython History requires SQLite, your history will not be saved

    在CentOS6.5下将自带的python2.6升级到python2.7,并安装了ipython,启动ipython后显示如下信息: WARNING: IPython History requires ...

  5. windows升级到1607后操作很卡顿的解决办法

    CPU I5,固态128G,win7主系统,WIN10和WIN7都安装在固态硬盘上. 未升级之前,操作很流畅,以至于把家里的老古董电脑也换固态,系统换WIN10了.自从升级了1607后这个问题就出现了 ...

  6. phpwind9.0升级到php7后出现的问题修复

    最近将一个两年多以前的用phpwind9.0搭建的论坛升级到php7,遇到了页面无法打开,显示为500错误,排查了一整天时间,终于解决! 1.打开文件:src/applications/appcent ...

  7. Thinkpad X220 升级 Windows 10 后无线网卡消失问题

    11年购买的Thinkpad X220从Win7升级到Win10后,用着还是挺顺手的,网络显示等一切正常,直到今天合上盖子电脑睡眠以后再次打开,wifi消失不见.重启,关机再开机,都没用,只显示有线网 ...

  8. 升级为iOS9后,默认请求类型为https,如何使用http进行请求会报错(引用他人的)

    升级为iOS9后,默认请求类型为https,如何使用http进行请求会报错 The resource could not be loaded because the App Transport Sec ...

  9. javascript超过容器后显示省略号效果(兼容一行或者多行)

    javascript超过容器后显示省略号效果       在实际的项目中,由于文字内容的长度不确定性和页面布局的固定性,难免会出现文字内容超过div(或其他标签,下同)区域的情况,此时比较好的做法就是 ...

随机推荐

  1. vue—生命周期的基本介绍

    Vue生命周期: 什么是生命周期: Vue 实例从创建到销毁的过程,就是生命周期.也就是从开始创建.初始化数据.编译模板.挂载Dom→渲染.更新→渲染.卸载等一系列过程,我们称这是 Vue 的生命周期 ...

  2. python colormap

    from colormap import rgb2hex import numpy as np from matplotlib import pyplot as plt color_names = [ ...

  3. rabbitmq消息队列,消息发送失败,消息持久化,消费者处理失败相关

    转:https://blog.csdn.net/u014373554/article/details/92686063 项目是使用springboot项目开发的,前是代码实现,后面有分析发送消息失败. ...

  4. Springboot使用外置tomcat的同时使用websocket通信遇到的坑

    随意门:https://blog.csdn.net/qq_43323720/article/details/99660430 另外,使用了nginx的话,需要注意开放websocket支持 serve ...

  5. Python 正则表达模块详解

    Python 的创始人为吉多·范罗苏姆(Guido van Rossum).1989年的圣诞节期间,吉多·范罗苏姆为了在阿姆斯特丹打发时间,决心开发一个新的脚本解释程序,作为ABC语言的一种继承.Py ...

  6. skywalking-agent 与docker组合使用

    docker部署 公司有使用docker部署的微服务 可以直接使用  仓库/java:8-jdk-alpine-asla-shanghai-1-skyagent-2作为基础镜像 这个镜像包是java8 ...

  7. 怎样使当前cookie只有在加密协议https环境下才能将它发送到服务器

    使用 Secure 属性. 注意, 这个属性基本是"自动"的, 也就是说, 如果当前网页是https请求的, 那里面的各种HTTP请求的cookie都会自定加上这个属性, 如果当前 ...

  8. C语言快速判断素数——不超时

    这属于算法上的问题,好好考虑一下算法,还要考虑一下素数的定义. 素数是只有1和本身能整除的整数.所以在求素数的时候,要将素数与1到素数本身中间的所有整数都相除,看是否有整除的数,如果有,那肯定不是素数 ...

  9. http 协议相关问题

    http 协议相关问题 来源 https://www.cnblogs.com/lingyejun/p/7148756.html 1.说一下什么是Http协议? 对器客户端和 服务器端之间数据传输的格式 ...

  10. 【Struts2】文件上传与下载

    一.上传 1.1 Struts2实现步骤 浏览器端 服务器端 1.2 关于Struts2中文件上传细节: 1.3 示例 jsp文件 Action类 struts.xml文件配置 二.下载 2.1 文件 ...