Exception encountered during context initialization - cancelling refresh attempt

这篇具有很好参考价值的文章主要介绍了Exception encountered during context initialization - cancelling refresh attempt。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

Exception encountered during context initialization - cancelling refresh attempt

💗wei_shuo的个人主页

💫wei_shuo的学习社区

🌐Hello World !


Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory

Exception encountered during context initialization - cancelling refresh attempt

  • 默认类路径在spring-dao.xml

Error creating bean with name ‘sqlSessionFactory’ defined in class path resource [spring-dao.xml]

  • 上下文初始化期间遇到异常 - 取消刷新尝试:

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory

  • 看报错信息让我检查 com/wei/Mapper/UserMapper.xml

please check com/wei/Mapper/UserMapper.xml and file [D:\Java\Spring_Projects\Spring-10-mybatis\target\classes\com\wei\Mapper\UserMapper.xml]

总结:

得出错误出现在com/wei/Mapper/UserMapper.xml 中

检查UserMapper.xml 发现没有错误,只能去检查映射文件mybatis-config.xml 发现

  • UserMapper.xml中写了映射文件class加载方式
<mappers>
    <mapper class="com.wei.Mapper.UserMapper"/>
</mappers>
  • 而spring-dao.xml中也书写了映射文件加载方式
<property name="mapperLocations" value="classpath:com/wei/Mapper/*.xml"/>

总结:

两处的映射文件加载方式冲突了,所以系统报错信息才会说defined in class path resource [spring-dao.xml]

Exception encountered during context initialization - cancelling refresh attempt
Exception encountered during context initialization - cancelling refresh attempt


🌼 结语:创作不易,如果觉得博主的文章赏心悦目,还请——点赞👍收藏⭐️评论📝冲冲冲🤞


Exception encountered during context initialization - cancelling refresh attempt文章来源地址https://www.toymoban.com/news/detail-419328.html

到了这里,关于Exception encountered during context initialization - cancelling refresh attempt的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • 已解决:Unexpected exception during bean creation; nested exception is java.lang.IllegalStateException:

    这个异常通常是由于在使用 Spring Cloud Feign 客户端进行负载均衡时缺少相关的依赖引起的。具体来说,它提示你忘记在项目的依赖中包含  spring-cloud-starter-loadbalancer 。 spring-cloud-starter-loadbalancer  是用于支持负载均衡功能的 Spring Cloud Starter 组件之一。它提供了负责将请求分发

    2024年02月08日
    浏览(31)
  • 【Eclipse】Error occurred during initialization of boot layer.报错解决方法

    个人记录日志: 根本原因:Java9相较于Java8(JDK8、JDK1.8)引进了模块,此时无法进行单独的类。 (在Java8和更早的应用程序中,顶级组件是包  package  。它将一组相关类型放入一个组中。它还包含一组资源。 java9应用程序与java8没有太大区别;它引入了一个新组件  module  ,

    2024年02月01日
    浏览(30)
  • Spring-boot context.initializer.classes 配置的使用

    在Spring Boot中, context.initializer.classes 是一个属性,允许你在 application.properties 或 application.yml 配置文件中指定一个或多个实现 ApplicationContextInitializer 接口的类。这些类可以在Spring应用上下文初始化之前执行一些自定义的初始化逻辑。 以下是一个使用 context.initializer.classes 属性

    2024年04月11日
    浏览(32)
  • 异常Exception in thread “main“ feign.FeignException$InternalServerError: [500] during [POST] to [http:

    最近在一个微服务练习项目中出现以下异常 Exception in thread \\\"main\\\" feign.FeignException$InternalServerError: [500] during [POST] to [http://trip-article-server/strategies/statisDataInit] [IStrategyFeginService#statisDataInits()]: [{\\\"timestamp\\\":\\\"2023-09-19T12:47:42.749+00:00\\\",\\\"status\\\":500,\\\"error\\\":\\\"Internal Server Error\\\",\\\"message\\\":\\\"\\\",\\\"path\\\":\\\"

    2024年03月19日
    浏览(34)
  • Error occurred during initialization of VM Could not reserve enough space for 2097152KB object heap

    在启动elasticsearch.bat时会直接闪退,大概率是因为内存分配不足导致直接打不开elasticsearch。 于是我直接在终端运行,想看问题出在哪,此时报错如题所示 找到elasticsearch文件夹下config子文件夹,打开找到 jvm.options ,对内存分配进行调整 使用记事本或者Notepad++打开,如图: 这

    2024年02月07日
    浏览(31)
  • IDEA双击打不开,Error opening zip file or JAR manifest missing ,Error occurred during initialization问题分析

    有次我感觉我的IDEA有些许卡顿,于是我修改了我的IDEA内存配置(修改方式)在我修改完后,发现双击我的IDEA打不开了,这把我吓坏了,别人给出的方案是去C盘下找到 idea64.exe.vmoptions文件 ,将配置改到之前的数值,我在C盘里确实也找到了IDEA的文件夹,但是没有这个文件,情

    2024年02月07日
    浏览(30)
  • [Labtools 27-3733] Error during cs_server initialization: Failed to connect cs_server at TCP:localho

    记录遇到过的问题: [Labtools 27-3733] Error during cs_server initialization: Failed to connect cs_server at TCP:localhost:3042 to hw_server at TCP:localhost:3121. 烧录程序时,打开硬件目标找不到JTAG。 (此链接可见详情)xilinx vivado 2019 驱动问题,Connecting to hw_server url TCP:localhost:3121,jtag连接不上 | 码农家园

    2024年02月02日
    浏览(31)
  • Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyExc

    Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name ‘org.apache.shiro.spring.config.web.autoconfigure.ShiroWebFilterConfiguration’: Unsatisfied dependency expressed through field ‘filterMap’; nested exception is org.springframework.beans.factory.BeanCreatio

    2024年02月07日
    浏览(29)
  • spark grpc 在master运行报错 exitcode13 User did not initialize spark context

    ApplicationMaster: Final app status: FAILED, exitCode: 13, (reason: Uncaught exception: java.lang.IllegalStateException: User did not initialize spark context! 1.使用了不具备权限的用户,spark运行环境有缺失 2.protobuf 需要使用指定操作系统进行编译 未使用 os.detected.classifier=windows-x86_64 或 linux-x86_64,或者把windo

    2024年02月10日
    浏览(27)
  • Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception (已解决)

    后端:springboot mybatis 异常: 1.controller层没有加@ResponseBody 2.Service层实现类未添加注解@Autowired 3.@RestController使用成了@Controller 全网基本上都是这种解决方案,这种解决方案其他博主说有详细说明 这种错误如果都试过了还是报异常,这个也是我经常犯的错误 那必然是jar包多导了

    2023年04月14日
    浏览(25)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包