Search code examples
javaspring-bootencryptionjasypt

Springboot Application Performance affected after adding Jasypt encryption dependency


My Springboot app (2.3.0) was working smooth until this Jasypt dependency was introduced:

<dependency>
        <groupId>com.github.ulisesbocchio</groupId>
        <artifactId>jasypt-spring-boot-starter</artifactId>
        <version>3.0.3</version>
</dependency>

And then the only change was replacing the plain text password in my application.properties to ENC(***):

datasource.password=ENC(*************************************)

How can I improve the performance? The application pages that used to load within milliseconds are now taking 4-5 seconds to load.


Solution

  • I took jasypt source code and replaced a line to simply return false.

    This was the line in jasypt source code that was causing the slowness : RefreshScopeRefreshedEventListener.java

    boolean isAssignable(String className, Object value) {
        try {
            return ClassUtils.isAssignableValue(ClassUtils.forName(className, null),value);
         }...