java: 无法访问org.springframework.context.ConfigurableApplicationContext

在这里插入图片描述

目前我的项目版本:

  • Spring版本:5.3.15
  • SpringBoot版本:2.6.3

完整错误:

java: 无法访问org.springframework.context.ConfigurableApplicationContext
  错误的类文件: /E:/apache-maven-3.6.3/repository/org/springframework/spring-context/6.1.7/spring-context-6.1.7.jar!/org/springframework/context/ConfigurableApplicationContext.class
    类文件具有错误的版本 61.0, 应为 52.0
    请删除该文件或确保该文件位于正确的类路径子目录中。

错误原因:引入的依赖版本和Spring版本或者SpringBoot版本不适配(大白话讲:你引入的版本太高了)
我最开始的依赖版本用的是最新的,因为习惯性添加依赖就会莫名添加最新的,结果问题就是它导致的。

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-ldap</artifactId>
    <version>3.3.0</version>
</dependency>
<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-ldap</artifactId>
    <version>3.3.0</version>
</dependency>

解决方案:选择适配的即可,最终可以使用的版本

<dependency>
   <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-ldap</artifactId>
    <version>2.6.3</version>
</dependency>
<dependency>
    <groupId>org.springframework.data</groupId>
    <artifactId>spring-data-ldap</artifactId>
    <version>2.6.3</version>
</dependency>

本人其他相关文章链接

1.Centos7.9安装openldap和phpldapadmin
2.java连接ldap实现查询
3.LDAP: error code 32 - No Such Object
4.[LDAP: error code 34 - invalid DN]
5.java: 无法访问org.springframework.context.ConfigurableApplicationContext
6.java: 无法访问org.springframework.ldap.core.LdapTemplate

  • 4
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
无法访问org.springframework.context.ConfigurableApplicationContext是因为不到该类文件。这个问题通常发生在IDEA运行Springboot项目时。 要解决这个问题,你可以尝试以下几个步骤: 1. 确保你的项目中包含了正确的Spring依赖。你可以在pom.xml文件中检查依赖是否正确。 2. 检查你的项目的Java版本是否与Spring框架兼容。确保你使用的Java版本符合Spring框架的要求。 3. 清理和重建你的项目。在IDEA中,你可以尝试点击"Build" -> "Rebuild Project"来清理和重建项目。 4. 确保你的项目的classpath设置正确。你可以在IDEA中检查项目的配置,确保所有需要的类路径都正确配置了。 如果以上步骤没有解决问题,你可以尝试在Stack Overflow等开发者社区搜索类似的问题,或者向Spring社区寻求帮助。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [新建 springboot项目启动报错:不到org.springframework.context.ConfigurableApplicationContext的类文件](https://blog.csdn.net/a704397849/article/details/117075337)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* *3* [IDEA运行SpringBoot报错,不到org.springframework.context.ConfigurableApplicationContext类](https://blog.csdn.net/YHTyht123/article/details/86287716)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

刘大猫.

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值