警告: Exception encountered during context initialization - cancelling refresh attempt: org.springfram

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

org.springframework.context.support.AbstractApplicationContext refresh
警告: Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'accountService': Unsatisfied dependency expressed through field 'accountMapper': Error creating bean with name 'org.mybatis.spring.SqlSessionFactoryBean#0': Lookup method resolution failed

出现这个异常,大部分原因是因为jar包的版本问题导致的,如果你是参考别人的代码进行配置的jar包,导入同样的依赖版本也会出现这个问题

使用百度翻译一下:

org.springframework.context支持。AbstractApplicationContext刷新
警告: 上下文初始化期间遇到异常-取消刷新尝试:org.springframework.beans.factory。UnsatisfiedDependencyException:创建名为“accountService”的bean时出错:通过字段“accountMapper”表示的依赖关系不满意:创建名为”org.mybatis.spring“的bean时发生错误。SqlSessionFactoryBean#0”:查找方法解析失败

翻译解析

根据上面的翻译我们可以判断出来,是依赖关系的问题,通过使用必应的搜索,搜到了两篇文章关于这个问题的解决,大部分说的是依赖问题,主要是mybatis-spring依赖

问题复刻

<dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis</artifactId>
      <version>3.5.10</version>
      <!--2022 年 5 月 23 日-->
    </dependency>
    <dependency>
      <groupId>org.mybatis</groupId>
      <artifactId>mybatis-spring</artifactId>
      <version>2.0.7</version>
      <!--	2022 年 1 月 29 日-->
    </dependency>

通过上面的代码块可以看出来,mybatis-spring的版本是2.0.7对比3.5.10的版本差了一个版本,通过maven仓库可以看到mybatis-spring已经有3.0.0的版本了我们换上最新版本就可以了

<dependency>
    <groupId>org.mybatis</groupId>
    <artifactId>mybatis-spring</artifactId>
    <version>3.0.0</version>
</dependency>

解决方法

就是把mybatis-spring依赖换成最新版本的就行了

参考
链接A
链接B文章来源地址https://www.toymoban.com/news/detail-559330.html

到了这里,关于警告: Exception encountered during context initialization - cancelling refresh attempt: org.springfram的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索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

领红包