首页 > 解决方案 > 从 Spring Boot 2.4.6 移动到 2.5.4 后出现 IllegalAccessError

问题描述

我正在尝试从 spring boot 2.4.6 升级到 2.5.4 并开始收到以下错误

启动 ApplicationContext 时出错。要显示条件报告,请在启用“调试”的情况下重新运行您的应用程序。2021-09-28 14:10:37 [main] 错误 osboot.SpringApplication - 应用程序运行失败 org.springframework.beans.factory.BeanCreationException:创建类路径资源中定义的名称为“supplierInitializer”的 bean 时出错 [org/springframework/cloud /stream/function/FunctionConfiguration.class]:init 方法调用失败;嵌套异常是 org.springframework.beans.factory.BeanCreationException:创建名为“inMemorySwaggerResourcesProvider_integrationflow.org.springframework.integration.config.SourcePollingChannelAdapterFactoryBean#0”的 bean 时出错:调用 init 方法失败;嵌套异常是 org.springframework.beans.factory.BeanCreationException: Error created bean with name ' 在类路径资源 [org/springframework/boot/autoconfigure/integration/IntegrationAutoConfiguration.class] 中定义的 integrationGlobalProperties':通过工厂方法进行的 Bean 实例化失败;嵌套异常是 org.springframework.beans.BeanInstantiationException:无法实例化 [org.springframework.integration.context.IntegrationProperties]:工厂方法“integrationGlobalProperties”抛出异常;嵌套异常是 java.lang.IllegalAccessError: class org.springframework.boot.autoconfigure.integration.IntegrationAutoConfiguration 试图访问私有方法 'void org.springframework.integration.context.IntegrationProperties.()' (org.springframework.boot.autoconfigure. integration.IntegrationAutoConfiguration 和 org.springframework.integration.context。

无法理解 spring boot 2.5.X 中发生了什么变化,尽管升级到版本 2.4.11 工作正常。

标签: springspring-boot

解决方案


我猜你有一个旧版本的 spring-integration-core 库。删除.m2/repository/org/springframework/integration那应该修复它的所有文件夹。


推荐阅读