Error creating bean with name 'sessionFactory' defined in class path resource 。nested exception is java.io.FileNotFoundException: class path resource [com/test/domain/Department.bhm.xml]

原错误大意为 : Spring初始化 applicationContext 失败,在初始化 sessionFactory 时 失败,因为没有找到 *.hbm.xml 文件。

原因是:编译后的文件中确实没找到 *.hbm.xml 文件。

解决方法:

1.  手动复制 *.hbm.xml 文件到编译后的目标目录(治标不治本,但较为简单)

2. 在 pom.xml 中文件中增加一段代码。

<resources><resource><directory>src/main/java</directory><includes><include>**/*.hbm.xml</include></includes></resource><resource><directory>src/main/resources</directory><includes><include>**/*.xml</include><include>**/*.properties</include></includes></resource></resources>

添加的时候注意有没有这些标签,没有的话直接放在 <build></build>中即可,如果有,放在相对应的位置,如<resources></resources>中,此时注释掉这段代码的<resources></resources>

转载于:https://www.cnblogs.com/guodao/p/9702447.html

Meavn 搭建项目遇到Error creating bean with name 'sessionFactory' defined in class path resource...相关推荐

  1. Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xm

    报错信息如下: <span style="font-size:24px;">17:18:32,245 ERROR ContextLoader:307 - Context ...

  2. BeanCreationException: Error creating bean with name 'dataSource' defined in class path resource [

    现场情景: 初次搭建springboot工程,原本要搭建一个springboot+mybatis的maven工程,听说springboot会把一切给配置好,天真的在执行完mybatis自动生成mapp ...

  3. 解决Error creating bean with name ‘redisConnectionFactory‘ defined in class path resource...问题

    文章目录 1. 复现问题 2. 分析问题 3. 解决问题 1. 复现问题 今天在启动spring boot项目时,出现如下错误: org.springframework.beans.factory.B ...

  4. 报错:Error creating bean with name ‘serverEndpointExporter‘ defined in class path resource [group/oneo

    背景 启动springboot项目测试类时报错: Error creating bean with name 'serverEndpointExporter' defined in class pat ...

  5. Error creating bean with name ‘configurationPropertiesBeans‘ defined in class path resource异常分析

    Error creating bean with name 'configurationPropertiesBeans' defined in class path resource异常分析 在学习使 ...

  6. 【J】BeanCreationException: Error creating bean with name 'shiroFilter' defined in class path resource

    在做SSM博客系统的时候遇到以下报错:org.springframework.beans.factory.BeanCreationException: Error creating bean with ...

  7. Error creating bean with name ‘endpoint‘ defined in class path resource [.../CxfConfig.class]

    Spring boot项目整合webservice后,引入阿里云短信包,项目启动报错. 问题描述: 最近一个老项目发送短信的接口需要由网易换成阿里云的,本来其它项目引入都没什么问题,但这个项目之前使用 ...

  8. Error creating bean with name ‘servletEndpointRegistrar‘ defined in class path resource

    记录一下 今天在写为服务项目碰到的错误,如下面所示,只知道创建Error creating bean with name 'servletEndpointRegistrar' defined in c ...

  9. SpringBoot启动报错: Error creating bean with name ‘“XXXX‘ defined in class path resource

    报错信息: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'reques ...

最新文章

  1. weblogic 的一些说明
  2. c++17(17)-异常try catch,operator[],vector at
  3. linux批量过去5小时前文件名,Linux批量修改文件名
  4. java word转图片tiff_Word 2010中将文档保存为TIFF图片的方法
  5. js 跳转传递汉字参数
  6. 带标签的 break 和 continue (Java)
  7. 元胞自动机-附代码注释
  8. IBus输入法安装和设置
  9. 零数开放许可链入选《互联网周刊》2021区块链应用创新TOP50
  10. 局域网传文件_跨平台传输文件方案大汇总(中篇)——可能全网最全的传输方案了...
  11. Unity,Sketchfab和Verge3D对比
  12. 【游戏运营】【推荐阅读】
  13. mapgis矢量化怎么打分数_MapGIS矢量化基本流程.doc
  14. trans系列是sci几区_如何看SCI期刊属于几区
  15. uniapp接入支付宝支付详细申请流程2021.6.1
  16. ERP系统常用SQL集锦
  17. C语言--确定到底谁是凶手
  18. 剑灵力士卡刀ahk_技术宅分享 剑灵召唤一键卡刀代码使用教程
  19. 反超7-11!中国新的“便利店之王”即将诞生!
  20. 介绍Spring Boot 启动时,自动执行指定方法的 7 种方法

热门文章

  1. 关于clientWidth、offsetWidth、clientHeight、offsetHeigh
  2. 关于js私钥加密公钥解密的问题
  3. 纯CSS实现多级菜单,兼容IE6
  4. Android:客户端和服务器之间传输数据加密
  5. 【29.42%】【POJ 1182】食物链
  6. [存储过程]中的事务(rollback)回滚
  7. spring 链接池
  8. 一张图系列——为什么在DllMain里面创建了线程并Wait会卡死
  9. 最近用unity5弄的一些渲染
  10. php curl基本操作