Hi,
the java.lang.StackOverflowError reported in !418 still persists with Spring Boot 3.5.10 / jasypt-spring-boot 4.0.4 (please have a look at the stack trace excerpt attached).
Steps to reproduce:
-
Create a basic Spring Boot 3.5.10 project using Spring Initializr
-
Add jasypt-spring-boot-starter to the pom.xml
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>4.0.4</version>
</dependency>
-
Run the project within an IDE - there should be no issues.
-
Add an env variable (not a property) named MY_VAR to the IDE and set it's value to "foo".
-
Run the project within an IDE - there should be no issues.
-
Change the value of MY_VAR to "${my.application.property}".
-
Run the project within an IDE - you should get java.lang.StackOverflowError.
In contrast to what has been reported in !418, the java.lang.StackOverflowError also is there when the environment variable is resolvable, e.g. when my.application.property is set to some specific value in application.properties.
I've temporarily fixed the java.lang.StackOverflowError by employing a CustomPropertyResolver which does not call Spring's Environment#resolvePlaceholders. This resolves the issue. Since there have been heavy refactorings w.r.t. the order of environment/property value evaluations/resolutions in Spring Boot 3.5.10, jasypt-spring-boot 4.0.4 and Spring Boot 3.5.10 call each other in an infinite loop.
Please be aware that my solution is only temporary. In my solution, several other patterns might not work any more, e.g. combined ENC/plaintext values or transitive placeholder patterns.
stacktrace.txt
CustomPropertyResolver.java
JasyptConfig.java
Hi,
the java.lang.StackOverflowError reported in !418 still persists with Spring Boot 3.5.10 / jasypt-spring-boot 4.0.4 (please have a look at the stack trace excerpt attached).
Steps to reproduce:
Create a basic Spring Boot 3.5.10 project using Spring Initializr
Add
jasypt-spring-boot-starterto thepom.xmlRun the project within an IDE - there should be no issues.
Add an env variable (not a property) named
MY_VARto the IDE and set it's value to "foo".Run the project within an IDE - there should be no issues.
Change the value of
MY_VARto "${my.application.property}".Run the project within an IDE - you should get
java.lang.StackOverflowError.In contrast to what has been reported in !418, the java.lang.StackOverflowError also is there when the environment variable is resolvable, e.g. when
my.application.propertyis set to some specific value in application.properties.I've temporarily fixed the java.lang.StackOverflowError by employing a CustomPropertyResolver which does not call Spring's
Environment#resolvePlaceholders. This resolves the issue. Since there have been heavy refactorings w.r.t. the order of environment/property value evaluations/resolutions in Spring Boot 3.5.10, jasypt-spring-boot 4.0.4 and Spring Boot 3.5.10 call each other in an infinite loop.Please be aware that my solution is only temporary. In my solution, several other patterns might not work any more, e.g. combined ENC/plaintext values or transitive placeholder patterns.
stacktrace.txt
CustomPropertyResolver.java
JasyptConfig.java