jasypt-spring-boot提示Failed to bind properties
1 问题描述
在Spring Boot中使用jasypt-spring-boot进行加密,但是提示:
Description:
Failed to bind properties under 'spring.datasource.password' to java.lang.String:
Reason: Failed to bind properties under 'spring.datasource.password' to java.lang.String
Action:
Update your application's configuration
或提示
Description:
Failed to bind properties under 'spring.datasource.url' to java.lang.String:
Reason: Failed to bind properties under 'spring.datasource.password' to java.lang.String
Action:
Update your application's configuration
最后的异常是这个:

2 解决办法
查阅了相关issue,发现是3.0.2更改了默认的加密算法,最后的办法是把版本降到2.1.2:

<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>2.1.2</version>
</dependency>
接着重新加密配置,但是2.1.2不支持使用环境变量作为加密的口令,在IDEA中测试的时候需要在运行配置加上
-Djasypt.encryptor.password=xxxx
部署到Tomcat时添加环境变量:
export JAVA_OPTS="-Djasypt.encryptor.password=xxxx"
jasypt-spring-boot提示Failed to bind properties的更多相关文章
- sprinbcloud学习之-Failed to bind properties under 'logging.level' to java.util.Map<java.lang.String>
日志报错,提示Failed to bind properties under 'logging.level' to java.util.Map<java.lang.String>, 原因为 ...
- Failed to bind properties under '' to com.zaxxer.hikari.Hikari DataSource Spring Boot解决方案
Description: Failed to bind properties under '' to com.zaxxer.hikari.HikariDataSource: Property: dri ...
- Failed to bind properties under 'spring.datasource' to javax.sql.DataSource
这是我的配置文件 # 国际化配置文件(包名.基础名) spring.messages.basename=i18n.login server.tomcat.uri-encoding=UTF- sprin ...
- springBoot配置druid监控报错Failed to bind properties under 'spring.datasource.druid' to javax.sql.DataSource
报错信息: Description: Failed to bind properties under 'spring.datasource.druid' to javax.sql.DataSource ...
- SpringBoot报错:Failed to load ApplicationContext( Failed to bind properties under 'logging.level')
引起条件: SpringBoot2.0下yml文件配置SLF4j日志输出日志级别 logging: level: debug 解决方法: 指定系统包路径 logging: root: debug 指定 ...
- springboot项目war包部署及出现的问题Failed to bind properties under 'mybatis.configuration.mapped-statements[0].
1.修改pom文件 修改打包方式 为war: 添加tomcat使用范围,provided的意思即在发布的时候有外部提供,内置的tomcat就不会打包进去 <groupId>com.scho ...
- SpringBoot升级报错:Failed to bind properties under 'logging.level'
错误详细信息: org.springframework.boot.context.properties.bind.BindException: Failed to bind properties un ...
- Failed to bind properties under 'logging.level' to java.util.Map<java.lang.String, java.lang.String>
org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'log ...
- 【spring boot】使用@Value映射properties文件属性
描述 使用@Value映射properties文件属性到Java字段 重点 使用@PropertySource 注解指定*.properties文件位置: 使用@Value进行注入: my.prope ...
随机推荐
- .net使用CSRedis操作Redis缓存的简单笔记(新手教程)
0.介绍 .NET Core or .NET Framework 4.0+ client for Redis and Redis Sentinel (2.8) and Cluster. Include ...
- [计算机图形学]视图变换:MVP变换、视口变换
目录 一.MVP变换 1. 模型变换 1.1 缩放矩阵 1.2 旋转矩阵 1.3 平移矩阵 2. 视角变换 3. 投影变换 二.Viewport变换 一.MVP变换 MVP变换是模型变换(M).视角变 ...
- C#日志使用
本文参考链接 日志框架 框架选择:NLog 安装方法,Nuget命令行:Install-Package NLog 常用规则 尽量不要在循环中打印日志. 应输出错误的堆栈信息:e.Message仅为异常 ...
- 浮动引发的高度塌陷问题及其解决方法(BFC相关概念及性质)
浮动引发的高度塌陷问题 高度塌陷问题的产生 BFC(Block Formatting Context)的引入 元素开启BFC后的特点 开启BFC的元素不会被其他浮动元素所覆盖 开启BFC的元素不会发生 ...
- LeetCode1576. 替换所有的问号
原题链接 1 class Solution { 2 public: 3 string modifyString(string s) { 4 int lens = s.length(); 5 for(i ...
- 解决appium点击软键盘上的搜索按钮
在执行appium自动化测试的时候,需要点击软件盘上的搜索按钮. 具体操作步骤如下: 前提:需要事先安装搜狗输入法 1.唤醒软件盘,可以封装到一个类里,用到的时候随时调用. import os#调起s ...
- FutureTask源码分析(JDK7)
总览 A cancellable asynchronous computation. This class provides a base implementation of {@link Futur ...
- pytorch(12)ContainersAndAlexNet
containers graph LR A["Containers"] --> B["nn.Sequetial"] B["nn.Sequetia ...
- 如何在 C# 中使用 const,readonly,static
平时在开发时经常会用到 const,readonly,static 关键字,可以肯定这些关键词是完全不同的概念,但有时候他们在用法上很相似以至于在场景中不知道选择哪一个,这篇文章我们就来讨论 C# 中 ...
- shell脚本,mysql数据库的备份-2[mysqldump]
# 数据库IPIP=127.0.0.1# 数据库端口PORT=3306# 数据库用户USER=root# 数据库密码PASSWORD=****# 要备份的数据库TARGET_DB=database_n ...