An attempt was made to call the method org.springframework.boot...RedisSessionConfiguration 的解决办法

Eureka集成过程常见异常 异常1:jar包冲突类冲突ServletContext.class An attempt was made to call the method javax.servlet.ServletContext.getVirtualServerName()Ljava/lang/String; but it does not exist. Its class, javax.servlet.ServletContext, is available from the following locations: 尝试调用方法 阅读详情

 

问题概述

在项目编写过程中,因为项目需要遂加入了 session 管理的包,启动项目测试时,便出现启动失败,错误信息 “ An attempt was made to call the method org.springframework.boot.autoconfigure.session.RedisSessionConfiguration$SpringBootRedisHttpSessionConfiguration.setCleanupCron(Ljava/lang/String;)V but it does not exist. Its class,” 尝试调用该方法,但是该方法不存在 ,具体的错误内容如下图:

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2018-10-19 14:11:41.241 ERROR 3968 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call the method org.springframework.boot.autoconfigure.session.RedisSessionConfiguration$SpringBootRedisHttpSessionConfiguration.setCleanupCron(Ljava/lang/String;)V but it does not exist. Its class, org.springframework.boot.autoconfigure.session.RedisSessionConfiguration$SpringBootRedisHttpSessionConfiguration, is available from the following locations:

    jar:file:/D:/Install_Applications/apache-maven-3.5.3/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.0.6.RELEASE/spring-boot-autoconfigure-2.0.6.RELEASE.jar!/org/springframework/boot/autoconfigure/session/RedisSessionConfiguration$SpringBootRedisHttpSessionConfiguration.class

It was loaded from the following location:

    file:/D:/Install_Applications/apache-maven-3.5.3/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.0.6.RELEASE/spring-boot-autoconfigure-2.0.6.RELEASE.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.boot.autoconfigure.session.RedisSessionConfiguration$SpringBootRedisHttpSessionConfiguration

如下图:

 

解决办法

关于这个问题,主要是为了在项目的实际生产环境中实现横向扩展时的 Session 管理而引入的,所以在项目的 pom.xml 文件中引入了 “ spring-session ” session 管理的包,如下图:

 

其实这个问题很简单,只需要在项目的配置文件中加入如下配置即可,如下图:

2019年4月补充:由于图片掉了,博主不可能又去复现问题了,再把图贴上来,博主时间都比较紧张,所以这儿简单的描述哈问题思路,自己解决:

这儿是一个坑,你需要注意以下,一般出现这个问题的是Maven项目,并且通过自动的包管理策略,在项目中使用时,不乏出现兼容的问题,如何避免这类的问题呢,还有个问题需要注意的是,在使用Maven前,需要注意配置Maven的镜像地址,最好为国内的,否则你踩这样的坑便是家常便饭了。希望可以帮助到你。

 

通过以上修改后,即可再次成功启动项目了,如下图:

 

 

 


好了,关于 An attempt was made to call the method org.springframework.boot...RedisSessionConfiguration 的解决办法  就写到这儿了,如果还有什么疑问或遇到什么问题欢迎扫码提问,也可以给我留言哦,我会一一详细的解答的。 
歇后语:“ 共同学习,共同进步 ”,也希望大家多多关注CSND的IT社区。


作       者:华    仔
联系作者:who.seek.me@java98k.vip
来       源:优快云 (Chinese Software Developer Network)
原       文:https://blog.youkuaiyun.com/Hello_World_QWP/article/details/83182196
版权声明:本文为博主原创文章,请在转载时务必注明博文出处!
Springboot中使用GSON报错 An attempt was made to call the method com.google.gson.GsonBuilder.setLenient 错误如下: Description: An attempt was made to call the method com.google.gson.GsonBuilder.setLenient()Lcom/google/gson/GsonBuilder; but it does not exist. Its class, com.google.gson.GsonBuilder, is a... 阅读详情

相关推荐

SpringBoot项目启动提示:An attempt was made to call the method org.apache.coyote.AbstractProtocol.setAccept

场景 在Eclipse中新建SpringBoot项目后启动项目提示: 具体报错信息如下: . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | |...

BADAO_LIUMANG_QIZHI的博客 6809

依赖包冲突启动报错:An attempt was made to call the method

今天,maven中添加了一个依赖,添加完启动不起了,内心崩溃!!! 查了一下,原来是依赖包冲突了,按照之前的步骤,排除冲突! 开搞,maven插件右击子项目,再点击 show dependenices,如下图,1查看冲突地方,2依赖图放大. 排除后发现,guava与另一个依赖包也存在冲突,最后,直接指定子项目 使用的版本,搞定!!! <dependency> <groupId>com.google.guava</groupId> &.

qq_34910843的博客 1万+

Pspice安装教程:Windows系统完整指南(含环境变量设置)

详细讲解在Windows系统中完成Pspice安装的全过程,涵盖安装步骤与关键的环境变量设置,帮助用户顺利运行仿真工具。适合初学者快速上手pspice安装教程中的核心环节。

weixin_42230607的博客 1174

An attempt was made to call the method xxx.jedis but it does not exist

在公司项目中做配置迁移的时候,服务启动时报错报错信息这种问题一看就是maven引入第三方依赖相关问题,该问题导致这个springboot服务启动报错,其实这种报错还是看上去比较舒服的,这个报错提示是非常到位,咱们试着理解下这个报错提示。

wwwwwww31311的博客 763

电路研究9.4——合宙Air780EP的LuatOS、CSDK跟标准AT

 C-SDK、AT指令、LuatOS

esmember的博客 1116

一分钟理解 AP(Affinity Propagation) 亲和⼒传播算法

这篇博客发出来后,我用 Rust 复现代码出现问题。为此,我对对照了 sklearn 的相关代码,反复比较了两天,发现一处 bug,把 += 误写成了 =,导致数据量大的时候完全无法聚类。这个debug过程让我仔细梳理的 AP 算法的计算过程,今天我对这篇博客做了大规模修改,以便能原样展现原论文思想。

程序猿视角 3216

An attempt was made to call the method错误

An attempt was made to call the method org.springframework.plugin.core.Pluginspring-plugin-core报错。但是下面generatort这个包的依赖如果是3.0.1可能就不对,运行时就会报这个错误,下面图片的的版本已更新。一般是jar包中依赖版本不对,比如,下面的版本是3.5.3。

m0_51568183的博客 1352

Xtract or Ucfyber的最条理的整理入门级教程

XTRACT可以对任意截面进行全过程截面分析。工程中常用来分析各种截面(如异形柱、组合截面等)的非线性特征点及承载力校核。 xtract主要思路也是根据各种材料本构关系,基于平截面假定,用fiber划分截面进行全过程非线性分析。......

→★佐佑思维★← 8394

An attempt was made to call the method org.springframework.boot.autoconfigure.web.servlet.WebMvcAuto

An attempt was made to call the method org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration$EnableWebMvcConfiguration.addDefaultHandlerExceptionResolvers(Ljava/util/List;)V but it does not exist. Its class, org.springframework.boot.a.

weixin_41111189的博客 2653

在 SAP BTP ABAP 环境中测试多租户 SaaS 解决方案的完整实践指南

ABAP SaaS测试阶段关键实践 在SAP BTP ABAP环境中开发多租户SaaS解决方案时,测试阶段(TST)对确保产品质量尤为关键。测试阶段应包含两个主要维度: 业务功能验证: 通过软件组件管理确保测试环境与代码仓库同步 创建并验证业务角色分配,确保权限配置正确 测试Fiori Launchpad导航流程和跨应用跳转 验证inbound/outbound通信配置 自动化质量管控: 在开发环境(DEV)执行本地ATC检查和单元测试 通过ABAP Test Cockpit(ATC)进行代码质量检查 集成

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 294

Pytest教程:Pytest插件原理

Pytest的插件系统是其强大功能的核心,它允许用户和开发者扩展和定制测试框架的行为。要深入理解Pytest插件的原理,我们需要从Pytest的架构和设计模式开始,然后深入到底层源码。

旦莫的博客 636

Jar冲突解决思路

一、 问题 Description: An attempt was made to call the method org.apache.ibatis.session.Configuration.getLanguageDriver(Ljava/lang/Class;) Lorg/apache/ibatis/scripting/LanguageDriver; but it does not exist. Its class, org.apache.ibatis.session.Configuration, i

冉木的博客 3506

基于STM32LXXX的模数转换芯片ADC(CMS24AD2001)驱动C程序设计

/ 电压 = (原始值 / 2^23) * Vref (注意:24位有符号数范围为 -2^23 到 2^23-1)//---------------- 硬件端口映射 (请根据实际电路修改) ----------------ADC_SCLK_HIGH();- PGA 放大倍数可选:1、2、4、8、16、32、64、128、256;//---------------- 宏定义操作 -------------------//---------------- 函数声明 -------------------

myron6688的博客 159

Maven错误总结-----An attempt was made to call the method XXXX

解决An attempt was made to call the method XXXX的问题

weixin_42712953的博客 1050

Dify框架面试内容整理-如何优化Dify的应用性能?

为1536维)可选用 PCA、FAISS 的量化压缩方法降低维度(如128、256、512);对知识库预览、任务流配置等页面,使用 nginx/cache-control 减少请求。API 响应耗时(P50/P95)、Token 使用量、缓存命中率、向量检索耗时;对 Prompt+输入内容计算 Hash,缓存相同请求的返回结果;使用占位符 + 函数拼接,按需组合 Prompt,而非静态长模板;数据量大时,应在构建索引前清洗冗余段落、统一格式,避免重复向量。维度越低,检索越快,但可能影响召回准确度,需平衡。

不务正业的猿 1548

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

An attempt was made to call the method org.springframework.plugin.core.Pluginspring-plugin-core报错

报错信息: *************************** APPLICATION FAILED TO START *************************** Description: An attempt was made to call the method org.springframework.plugin.core.PluginRegistry.getPluginFor(Ljava/lang/Object;)Ljava/util/Optional; but it does

weixin_44044915的博客 5319

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

activiti集成 问题集

一:An attempt was made to call the method org.apache.ibatis.session.Configuration.setVfsImpl 无法启动 原因:activiti中的mybaitis版本冲突 springboot 2.0.4.RELEASE 不支持 mybatis-plus-boot-starter 3.1.0及以上版本。 解决: &...

thver的博客 681

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

springboot启动时报:An attempt was made to call a method that does not exist

Description: An attempt was made to call a method that does not exist. The attempt was made from the following location: org.springframework.context.annotation.ConfigurationClassUtils.checkConfigurationClassCandidate(ConfigurationClassUtils.java:108)

weixin_45255645的博客 8259

记spring boot配置redis 项目启动时的一个奇怪的错误

在刚开始学redis时,我照着网上的教程,把redis和jedis整合到spring boot,整合完毕后,启动项目总是失败,总是爆出下面的错误:【Correct the classpath of your application so that it contains a single, compatible version of org.springframework.data.reposit...

More than coding 1万+

Springboot启动报错An attempt was made to call a method that does not exist.

意思是:javax.servlet.ServletContext.getVirtualServerName() 这个方法不存在。我分别去两个jar包中找这个类发现2.3版本的jar包没有这个方法而下面的jar包有该方法。然后去依赖里面找到2.3版本的依赖排除掉即可解决该问题。这个方法的类存在两个jar包中。

qq_41542187的博客 1408

spring启动报错解决办法: An attempt was made to call a method that does not exist.

spring启动报错解决办法 这是因为多个版本的依赖,找到mybatis-spring这个1.2.4依赖删除即可

weixin_44099288的博客 2516

An attempt was made to call the method 。。。;but it does not exist. Its class,

imedera 2020-09-01 21:19:16.160 restartedMain ERROR org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter Line:42 - *************************** APPLICATION FAILED TO START *************************** Description: An attempt was made to .

m0_37626203的博客 2822

Spring initializr

建Spring lnitializr时遇到的问题: 运行不成功: An attempt was made to call the method org.springframework.core.type.AnnotationMetadata.introspect(Ljava/lang/Class;)Lorg/springframework/core/type/AnnotationMetadata; but it does not exist. Its class, org.springframework.c

a_hanhanzi的博客 774

SpringBoot 2.4.3搭配Eureka启动报错:Correct the classpath of your application so that it contains a single,

1 问题 一个超级奇葩的问题,在没引入Eureka之前启动正常,添加Eureka依赖后,疯狂报错,折腾了很长时间,才搞明白。 在整合Eureka后,启动报错: Description: An attempt was made to call the method org.springframework.boot.autoconfigure.web.ServerProperties$Servlet.getServletPrefix()Ljava/lang/String; but it does not ex

qq_35843514的博客 634

(转)搭建Springboot启动报错(An attempt was made to call the method reactor.retry.Retry.retryMax(I)Lreactor/r

[转载原因:springboot使用gson,报类似错误,结果是因为gson版本问题] [转载原文:http://www.manongjc.com/article/24593.html] 本文章向大家介绍搭建Springboot启动报错(An attempt was made to call the method reactor.retry.Retry.retryMax(I)Lreactor/ret),主要包括搭建Springboot启动报错(An attempt was made to call th

小蚯蚓的博客 1011

spring session 加载的时候一些配置问题

启动springboot时候的错误信息: An attempt was made to call the method org.springframework.boot.autoconfigure.session.RedisSessionConfiguration$SpringBootRedisHttpSessionConfiguration.setCleanupCron(Lja...

weixin_30699831的博客 507
上一篇: STS卡顿(一次STS IDE 优化调优记录)
下一篇: Activiti 7.0 正式发布啦-Activiti Core 与 Activiti Cloud Beta1
TechBro华仔
TechBro华仔 优质创作者: Java技术领域 优质创作者: Java技术领域 领域专家: 后端开发技术领域 领域专家: 后端开发技术领域
博客等级 码龄11年 5万+粉丝 430原创
评论 22
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

打赏作者

TechBro华仔

日拱一卒无有尽,功不唐捐终入海

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

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

打赏作者

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

抵扣说明:

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

余额充值