java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null"

解决java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null" 使用springboot,权限管理使用spring security,使用内存用户验证,但无响应报错:java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null"解决方法:这是因为Spring boot 2.0.3引用的security 依赖是 spring security 5.X... 阅读详情

问题描述

今天使用SpringSecurity配置登录验证,输入密码提示如下错误提示:

2019-12-30 14:28:52.534 ERROR 1684 --- [nio-8080-exec-5] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception

java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null"
	at org.springframework.security.crypto.password.DelegatingPasswordEncoder$UnmappedIdPasswordEncoder.matches(DelegatingPasswordEncoder.java:250) ~[spring-security-core-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.crypto.password.DelegatingPasswordEncoder.matches(DelegatingPasswordEncoder.java:198) ~[spring-security-core-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter$LazyPasswordEncoder.matches(WebSecurityConfigurerAdapter.java:592) ~[spring-security-config-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.authentication.dao.DaoAuthenticationProvider.additionalAuthenticationChecks(DaoAuthenticationProvider.java:90) ~[spring-security-core-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.authentication.dao.AbstractUserDetailsAuthenticationProvider.authenticate(AbstractUserDetailsAuthenticationProvider.java:166) ~[spring-security-core-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:175) ~[spring-security-core-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.authentication.ProviderManager.authenticate(ProviderManager.java:195) ~[spring-security-core-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter.attemptAuthentication(UsernamePasswordAuthenticationFilter.java:95) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:212) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:92) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:77) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) ~[spring-security-web-5.2.1.RELEASE.jar:5.2.1.RELEASE]
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:358) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:271) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) ~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) ~[tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:860) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1591) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_172]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_172]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.29.jar:9.0.29]
	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_172]

解决办法

  • 添加passwordEncoder方法
@Bean
PasswordEncoder passwordEncoder(){
   return new BCryptPasswordEncoder();
}
  • 具体位置如下图:
    在这里插入图片描述
SpringSecurity报错:IllegalArgumentException: There is no PasswordEncoder mapped for the id “null“ springboot整合springSecurity通过配置类自定义用户名和密码的时候,提示报错信息:java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null" 阅读详情

相关推荐

Superpowers:可编程AI协作协议与Skill工程化实践

AI编程正从提示词驱动迈向工程化协作新范式。Superpowers并非传统代码补全工具,而是一套定义清晰、可版本控制、可调试复用的AI协作协议——它将AI能力抽象为带输入校验、执行管道、输出契约和元数据声明的Skill(类DSL构件),再通过状态驱动的Workflow编排实现跨平台、可熔断、含人工Checkpoint的自动化流水线。其核心价值在于解决AI生成代码长期存在的不可复现、不可审计、不可交接三大痛点,支撑OpenAPI转TS、Figma转Vue等高复用场景落地。本文深入解析Skill设计四重契约与P

weixin_31124163的博客 376

解决java.lang.IllegalArgumentException: There is no PasswordEncoder mapped f...

解决java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id 使用springboot,权限管理使用spring security,使用内存用户验证,但无响应报错: java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null" 解决方法: 这是因为Spring boot 2.0.3

HongYu012的博客 2935

【photoshop CEP插件】 OCR文字识别

一个photoshop CEP插件OCR文字识别 APP_ID = 17594920 API_KEY = puMFv72xqCYV2jdcSlXgtFvm SECRET_KEY = v5XHtqKXEm0p6ehPZrXIXrftDvocyv1m /*********************************************/ 百度OCR 密钥由Greless@qq.com 提供, 用户可自行前往https://ai.baidu.com/docs#/Auth/top 申请。 通用文字识别..

Greless的后花园 6491

There is no PasswordEncoder mapped for the id "null" 的解决办法

环境/问题概述: 在项目构建的过程中,根据需求进行了系统升级,包括硬件和软件环境,项目开发使用的 Spring Boot 进行的,这次升级直接从1.5.2 直接升级为了2.0.3; 在包更正完成后,启动项目测试,遇到不能登录系统的问题,异常信息如下: java.lang.IllegalArgumentException: There is no PasswordEncoder...

Spring Boot-Common On With You 2万+

UPF2.1进阶指南:如何优雅地处理Hard Macro与Top-Level Port的电源意图

本文深入解析UPF2.1在复杂SoC设计中的高级电源意图建模,重点探讨Hard Macro与顶层端口的电源管理实战技巧。通过`power_model`和`set_port_attribute`的高级应用,解决第三方硬核IP电源建模不透明、顶层端口电源属性定义不当等工程难题,提供可靠的电源管理方案,确保芯片设计性能与功耗的精确控制。

weixin_30443747的博客 170

S型速度曲线进阶:基于Sin²(x)的PLC平滑运动控制实践(以伺服/步进系统为例)

本文深入探讨了基于Sin²(x)的S型速度曲线在PLC平滑运动控制中的实践应用,特别针对伺服/步进系统。通过对比传统梯形曲线和七段S曲线,详细展示了Sin²(x)曲线在加速度连续性、计算效率和参数自适应性方面的优势,并结合博图平台的具体实现技巧和实战案例,为精密运动控制提供了优化方案。

weixin_28718793的博客 242

报错:java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id “null“解决的方式

目录一、报错描述二、报错原因三、解决方式 一、报错描述 springboot项目整个spring security权限管理,表单验证输入用户名和密码页面无响应,控制台报错如下图: 二、报错原因 lz自定了一个处理用户校验逻辑MyUserDeitailsService类,实现了UserDetailsService接口,但是在SecurityConfig配置类中没有注入PasswordEncoder实例,导致报错。 MyUserDeitailsService类代码如下: @Component pu

小志的博客 1621

推荐算法之Thompson(汤普森)采样

如果想理解汤普森采样算法,就必须先熟悉了解贝塔分布。 一、Beta(贝塔)分布 Beta分布是一个定义在[0,1]区间上的连续概率分布族,它有两个正值参数,称为形状参数,一般用α和β表示,Beta分布的概率密度函数形式如下: 这里的Γ表示gamma函数。 Beta分布的均值是: 方差: ...

weixin_30508241的博客 4259

解决java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null"

使用springboot,权限管理使用spring security,使用内存用户验证,但无响应报错: java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null" 解决方法: 这是因为Spring boot 2.0.8引用的security 依赖是 spring security ...

qq_39971139的博客 1104

移植Google Gemini Nano到RK3588 NPU,实现高效边缘推理

在嵌入式 AI 开发中,大家常常会遇到模型在硬件平台上运行时出现性能瓶颈的问题,比如推理速度慢、功耗过高,这严重影响了应用的实时性和稳定性 ,导致性能瓶颈,无法满足如智能安防、工业检测等场景的实时性需求。为了解决这些问题,我们可以将轻量模型移植到具有强大算力的硬件平台上。本文将手把手教你将 Google Gemini Nano(或类似轻量模型)移植到 RK3588 NPU,充分发挥 RK3588 NPU 的 6Tops 算力,实现高效的模型推理,提升嵌入式系统的 AI 处理能力。

远程部署调试 运行安装 项目调试 二次开发 项目技术新 持续迭代 部分源码免费分享 295

执行HDevelop项目

这一节,我们讲述的是如何用HDevEngine加载和执行一个HDevelop项目。代码部分来源于示例程序exec_program(源文件exec_program.cpp),检测塑料零件边界上的毛刺。1.Step 1:初始化首先,我们包含HALCON/C++和HDevEngine头文件以及命名空间。注意到在这个示例程序中,HDevEngine头文件已经包含在my_hdevoperatorimpl中,所

Z's Palace 2994

java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id “null”

Spring Boot2集成Security时候在页面输入用户名密码出现的异常,这是配置用户的代码 java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id “null” /** * 描述:配置内存用户 * @param auth * @throws Exception */ @A...

图图是只猫 1473

基于MATLAB的最大重叠离散小波变换(MODWT)算法详解

最大重叠离散小波变换(Maximal Overlap Discrete Wavelet Transform, MODWT)是DWT的重要改进形式,由Percival和Walden等人在20世纪90年代系统提出并完善。MODWT通过消除下采样操作,采用样本平移不变的分解方式,解决了DWT的多个固有缺陷。MODWT的核心创新在于取消下采样环节。与DWT每级分解后对滤波输出进行二分下采样不同,MODWT在每一级都使用相同的滤波器,但通过插入零值的方式调整滤波器系数,保持每级系数数量与原始信号相同。

qq_42212808的博客 115

解决 java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null"

pringboot,权限管理使用spring security,使用内存用户验证,但无响应报错: java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null" 解决方法: 这是因为Spring boot 2.0.3引用的security 依赖是 spring security 5.X...

weixin_45863786的博客 373

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

ssm框架搭建

这个是一个在idea上成功跑起来的ssm框架项目,保存在这里方便以后使用直接下载

java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id “null“ 产生原因

在做接口拦截器的时候自定义了一个配置类,但是运行在控制台上产生了java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null" 的问题。这个问题主要是依赖SpringBoot2.x整合Security5所引发的问题。现在idea中找到了DelegatingPasswordEncoder类,在这个类中包含了一个私有类UnmappedIdPasswordEncoder,是由于mathes方法导致的这

hammring的博客 820

Outlook Express 6 (OE6) for Win7/Win8/Win10

英文版 Outlook Express6.0, 兼容Win7/Win10/WinXP,解压就可用。

java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null"报错

出现问题的原因:   内存用户验证时,Spring boot 2.0.1引用的security 依赖是 spring security 5.X版本,此版本需要提供一个PasswordEncorder的实例,否则后台汇报错误: java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "...

BigData 539

怀旧版电脑GBC模拟器

再现原版GBC掌机的界面,电脑运行连游戏界面都一样大小,很怀旧,很真实,(英文版)强烈推荐,很小的文件,很难才找到的。

java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id “null“

问题描述: 使用springboot,权限管理使用spring security,使用内存用户验证,但无响应报错: java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id “null” 在Spring Security 5.0之前,默认值PasswordEncoder是NoOpPasswordEncoder需要纯文本密码。在Spring Security 5中,默认值为DelegatingPasswo

JavaSupeMan的博客 472

java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null" (security)

  5.0以后的版本,有多种的加密方式,没有指定加密方式的方法。 两种解决方式修改成:   代码: import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframewor...

然而老干妈早就看穿了一切 747
上一篇: 使用Promise封装Ajax()
下一篇: 设置IDEA的 pom.xml 自动提示
dadeity
博客等级 码龄10年 1172粉丝 225原创
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

打赏作者

dadeity

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

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

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

打赏作者

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

抵扣说明:

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

余额充值