解决org.springframework.core.convert.support.DefaultConversionService.getSharedI

本文解决了一个在使用Maven与MySQL结合时出现的NoSuchMethodError问题,通过统一pom.xml文件中springframework的jar包版本到4.1.2解决了此错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

lang.NoSuchMethodError: org.springframework.core.convert.support.DefaultConversionService.getSharedI

在使用maven结合mysql使用时报错
解决方法
查看pom.xml文档找到springframework的jar配置吧每个版本都统一
在这里插入图片描述在这里插入图片描述这里修改为4.1.2就好了

src\main\resources\bootstrap.yml 文件中有以下配置,已知src\main\resources\logback-spring.xml这个文件是有的。 logging: level: root: DEBUG config: classpath:logback-spring.xml 项目启动失败,报以下错误,什么原因导致的,怎么解决org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'logging.level.config' to org.springframework.boot.logging.LogLevel at org.springframework.boot.context.properties.bind.Binder.handleBindError(Binder.java:387) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:347) at org.springframework.boot.context.properties.bind.Binder.lambda$null$1(Binder.java:435) at org.springframework.boot.context.properties.bind.Binder$Context.withSource(Binder.java:561) at org.springframework.boot.context.properties.bind.Binder$Context.access$700(Binder.java:537) at org.springframework.boot.context.properties.bind.Binder.lambda$bindAggregate$2(Binder.java:436) at org.springframework.boot.context.properties.bind.AggregateElementBinder.bind(AggregateElementBinder.java:39) at org.springframework.boot.context.properties.bind.MapBinder$EntryBinder.lambda$bindEntries$0(MapBinder.java:158) at java.util.HashMap.computeIfAbsent(HashMap.java:1126) at org.springframework.boot.context.properties.bind.MapBinder$EntryBinder.bindEntries(MapBinder.java:158) at org.springframework.boot.context.properties.bind.MapBinder.bindAggregate(MapBinder.java:69) at org.springframework.boot.context.properties.bind.AggregateBinder.bind(AggregateBinder.java:56) at org.springframework.boot.context.properties.bind.Binder.lambda$bindAggregate$3(Binder.java:438) at org.springframework.boot.context.properties.bind.Binder$Context.withIncreasedDepth(Binder.java:590) at org.springframework.boot.context.properties.bind.Binder$Context.access$100(Binder.java:537) at org.springframework.boot.context.properties.bind.Binder.bindAggregate(Binder.java:438) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:399) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:343) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:332) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:262) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:236) at org.springframework.boot.context.logging.LoggingApplicationListener.setLogLevels(LoggingApplicationListener.java:390) at org.springframework.boot.context.logging.LoggingApplicationListener.initializeFinalLoggingLevels(LoggingApplicationListener.java:357) at org.springframework.boot.context.logging.LoggingApplicationListener.initialize(LoggingApplicationListener.java:299) at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEnvironmentPreparedEvent(LoggingApplicationListener.java:246) at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:223) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85) at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66) at java.util.ArrayList.forEach(ArrayList.java:1249) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:343) at org.springframework.boot.SpringApplication.run(SpringApplication.java:301) at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:164) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.bootstrapServiceContext(BootstrapApplicationListener.java:195) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:114) at org.springframework.cloud.bootstrap.BootstrapApplicationListener.onApplicationEvent(BootstrapApplicationListener.java:77) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:131) at org.springframework.boot.context.event.EventPublishingRunListener.environmentPrepared(EventPublishingRunListener.java:85) at org.springframework.boot.SpringApplicationRunListeners.lambda$environmentPrepared$2(SpringApplicationRunListeners.java:66) at java.util.ArrayList.forEach(ArrayList.java:1249) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:120) at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:114) at org.springframework.boot.SpringApplicationRunListeners.environmentPrepared(SpringApplicationRunListeners.java:65) at org.springframework.boot.SpringApplication.prepareEnvironment(SpringApplication.java:343) at org.springframework.boot.SpringApplication.run(SpringApplication.java:301) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1317) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) at com.bonc.activityGenerate.ActivityGenerateApplication.main(ActivityGenerateApplication.java:40) Caused by: org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [org.springframework.boot.logging.LogLevel] for value 'classpath:logback-spring.xml'; nested exception is java.lang.IllegalArgumentException: No enum constant org.springframework.boot.logging.LogLevel.classpath:logback-spring.xml at org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:47) at org.springframework.core.convert.support.GenericConversionService.convert(GenericConversionService.java:192) at org.springframework.boot.context.properties.bind.BindConverter.convert(BindConverter.java:109) at org.springframework.boot.context.properties.bind.BindConverter.convert(BindConverter.java:100) at org.springframework.boot.context.properties.bind.BindConverter.convert(BindConverter.java:92) at org.springframework.boot.context.properties.bind.Binder.bindProperty(Binder.java:459) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:403) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:343) ... 55 more Caused by: java.lang.IllegalArgumentException: No enum constant org.springframework.boot.logging.LogLevel.classpath:logback-spring.xml at org.springframework.boot.convert.LenientObjectToEnumConverterFactory$LenientToEnumConverter.findEnum(LenientObjectToEnumConverterFactory.java:93) at org.springframework.boot.convert.LenientObjectToEnumConverterFactory$LenientToEnumConverter.convert(LenientObjectToEnumConverterFactory.java:80) at org.springframework.boot.convert.LenientObjectToEnumConverterFactory$LenientToEnumConverter.convert(LenientObjectToEnumConverterFactory.java:61) at org.springframework.core.convert.support.GenericConversionService$ConverterFactoryAdapter.convert(GenericConversionService.java:437) at org.springframework.core.convert.support.ConversionUtils.invokeConverter(ConversionUtils.java:41) ... 62 more
最新发布
06-13
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值