Application run failedjava.lang.NoClassDefFoundError: org/springframework/boot/bind/RelaxedPropert

Application run failed

java.lang.NoClassDefFoundError: org/springframework/boot/bind/RelaxedPropertyResolver
    at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.getExcludeAutoConfigurationsProperty(AutoConfigurationImportSelector.java:215) ~[spring-boot-autoconfigure-1.5.12.RELEASE.jar:1.5.12.RELEASE]
    at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.getExclusions(AutoConfigurationImportSelector.java:209) ~[spring-boot-autoconfigure-1.5.12.RELEASE.jar:1.5.12.RELEASE]
    at org.springframework.boot.autoconfigure.AutoConfigurationImportSelector.selectImports(AutoConfigurationImportSelector.java:99) ~[spring-boot-autoconfigure-1.5.12.RELEASE.jar:1.5.12.RELEASE]
    at org.springframework.context.annotation.ConfigurationClassParser$DefaultDeferredImportSelectorGroup.process(ConfigurationClassParser.java:904) ~[spring-context-5.3.16.jar:5.3.16]
    at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGrouping.getImports(ConfigurationClassParser.java:879) ~[spring-context-5.3.16.jar:5.3.16]
    at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorGroupingHandler.processGroupImports(ConfigurationClassParser.java:809) ~[spring-context-5.3.16.jar:5.3.16]
    at org.springframework.context.annotation.ConfigurationClassParser$DeferredImportSelectorHandler.process(ConfigurationClassParser.java:780) ~[spring-context-5.3.16.jar:5.3.16]
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:193) ~[spring-context-5.3.16.jar:5.3.16]
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331) ~[spring-context-5.3.16.jar:5.3.16]
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247) ~[spring-context-5.3.16.jar:5.3.16]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311) ~[spring-context-5.3.16.jar:5.3.16]
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112) ~[spring-context-5.3.16.jar:5.3.16]
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746) ~[spring-context-5.3.16.jar:5.3.16]
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564) ~[spring-context-5.3.16.jar:5.3.16]
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145) ~[spring-boot-2.6.4.jar:2.6.4]
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:740) [spring-boot-2.6.4.jar:2.6.4]
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:415) [spring-boot-2.6.4.jar:2.6.4]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:303) [spring-boot-2.6.4.jar:2.6.4]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1312) [spring-boot-2.6.4.jar:2.6.4]
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301) [spring-boot-2.6.4.jar:2.6.4]
    at com.example.demo.MybatisRootApplication.main(MybatisRootApplication.java:18) [classes/:na]
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.bind.RelaxedPropertyResolver
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[na:1.8.0_201]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_201]
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[na:1.8.0_201]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_201]
    ... 21 common frames omitted
 

记录记录

spring boot 2.6.4+ mybatis2.0.1+durid1.1.23 +mysql 1.0.28 项目启动异常解决:

jar包冲突,排除掉spring-boot-autoconfigure.jar

<dependency>
    <groupId>com.alibaba</groupId>
    <artifactId>druid-spring-boot-starter</artifactId>
    <version>${druid.version}</version>
    <exclusions>
        <exclusion>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
        </exclusion>
    </exclusions>
</dependency>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
java.lang.NoClassDefFoundError: org/springframework/boot/jdbc/DataSourceInitializationMode是一个Java异常,表示在运行时找不到org.springframework.boot.jdbc.DataSourceInitializationMode类。这通常是由于缺少相关的依赖库或类路径配置错误引起的。 解决这个异常的方法有以下几种: 1. 确保相关的依赖库已经正确添加到项目中。在这种情况下,你需要确保你的项目中包含了Spring Boot的相关依赖库,特别是与DataSourceInitializationMode相关的依赖库。你可以通过在项目的构建文件(如pom.xml或build.gradle)中添加正确的依赖来解决这个问题。 2. 检查类路径配置。如果你已经添加了正确的依赖库,但仍然遇到这个异常,那么可能是类路径配置错误导致的。你可以检查你的项目的类路径配置,确保它包含了正确的依赖库。 3. 检查版本兼容性。有时候,这个异常可能是由于不兼容的版本导致的。你可以尝试升级或降级相关的依赖库,以解决版本兼容性问题。 4. 检查编译环境。如果你在编译时遇到这个异常,那么可能是由于编译环境不正确导致的。你可以检查你的编译环境,确保它与你的项目的要求相匹配。 5. 检查类名拼写错误。有时候,这个异常可能是由于类名拼写错误导致的。你可以检查你的代码,确保你正确地引用了org.springframework.boot.jdbc.DataSourceInitializationMode类。 希望以上解决方法能够帮助你解决java.lang.NoClassDefFoundError: org/springframework/boot/jdbc/DataSourceInitializationMode异常。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值