Skip to content

java.lang.StackOverflowError still persists with Spring Boot 3.5.10 / jasypt-spring-boot 4.0.4 #427

Description

@verbathim

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:

  1. Create a basic Spring Boot 3.5.10 project using Spring Initializr

  2. 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>
  1. Run the project within an IDE - there should be no issues.

  2. Add an env variable (not a property) named MY_VAR to the IDE and set it's value to "foo".

  3. Run the project within an IDE - there should be no issues.

  4. Change the value of MY_VAR to "${my.application.property}".

  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions