ulisesbocchio

ulisesbocchio

Member Since 10 years ago

Burbank, CA

Experience Points
123
follower
Lessons Completed
3
follow
Lessons Completed
57
stars
Best Reply Awards
78
repos

28 contributions in the last year

Pinned
⚡ Jasypt integration for Spring boot
⚡ spring-security-saml integration with Spring Boot
⚡ Enables nicer resource handling from jarred resources
⚡ Boiler Plate eliminator for React projects using Redux
Activity
Oct
10
1 week ago
Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

JDK upgrade caused exception:jasypt-spring-boot Versoin:3.0.4.

Hi, I just upgrade the jdk version from 1.8.0_261 to 1.8.0_291 in windows environment, it is not able to decrypt with new version jdk. Does it depend on jdk? Caused by: com.ulisesbocchio.jasyptspringboot.exception.DecryptionException: Unable to decrypt property: ENC(XXX) resolved to: ENC(XXX). Decryption of Properties failed, make sure encryption/decryption passwords match at com.ulisesbocchio.jasyptspringboot.resolver.DefaultPropertyResolver.lambda$resolvePropertyValue$0(DefaultPropertyResolver.java:46) at java.util.Optional.map(Optional.java:215) at com.ulisesbocchio.jasyptspringboot.resolver.DefaultPropertyResolver.resolvePropertyValue(DefaultPropertyResolver.java:40) at com.ulisesbocchio.jasyptspringboot.resolver.DefaultLazyPropertyResolver.resolvePropertyValue(DefaultLazyPropertyResolver.java:50) at com.ulisesbocchio.jasyptspringboot.EncryptablePropertySource.getProperty(EncryptablePropertySource.java:28) at com.ulisesbocchio.jasyptspringboot.caching.CachingDelegateEncryptablePropertySource.getProperty(CachingDelegateEncryptablePropertySource.java:44) at com.ulisesbocchio.jasyptspringboot.wrapper.EncryptableMapPropertySourceWrapper.getProperty(EncryptableMapPropertySourceWrapper.java:29) at org.springframework.boot.context.properties.source.SpringIterableConfigurationPropertySource.getConfigurationProperty(SpringIterableConfigurationPropertySource.java:105) at org.springframework.boot.context.properties.bind.Binder.findProperty(Binder.java:422) at org.springframework.boot.context.properties.bind.Binder.bindObject(Binder.java:369) at org.springframework.boot.context.properties.bind.Binder.bind(Binder.java:319) ... 86 common frames omitted Caused by: org.jasypt.exceptions.EncryptionOperationNotPossibleException: null at org.jasypt.encryption.pbe.StandardPBEByteEncryptor.decrypt(StandardPBEByteEncryptor.java:1169) at org.jasypt.encryption.pbe.StandardPBEStringEncryptor.decrypt(StandardPBEStringEncryptor.java:738) at org.jasypt.encryption.pbe.PooledPBEStringEncryptor.decrypt(PooledPBEStringEncryptor.java:511) at com.ulisesbocchio.jasyptspringboot.encryptor.DefaultLazyEncryptor.decrypt(DefaultLazyEncryptor.java:57) at com.ulisesbocchio.jasyptspringboot.resolver.DefaultPropertyResolver.lambda$resolvePropertyValue$0(DefaultPropertyResolver.java:44) ... 96 common frames omitted

ulisesbocchio
ulisesbocchio

Do you have the jce installed in the new jdk?

Sep
22
4 weeks ago
Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

BasicTextEncryptor can not replace the StandardPBEStringEncryptor?

Sorry again for for disturbing~ here is my problem:

First the used dependency and version: com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.3

Problem description: when I try to encrypt a sensitive string with the class “org.jasypt.util.text.BasicTextEncryptor”,I set the password and then perform the encryption. But the result that generated in last step doesn't work and cause the exception as the following list: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.

here is the code aims at generating the target encryption that maybe help: BasicTextEncryptor encryptor1 = new BasicTextEncryptor(); encryptor1.setPassword("com.xlys.jasypt"); String encrypt1 = encryptor1.encrypt("[email protected]#$%"); System.out.println("encrypt1 = " + encrypt1); and this is content in application.yml jasypt: encryptor: algorithm: PBEWITHMD5ANDDES password: com.xlys.jasypt

I have traced the source code and find it that when I change the encrypting class from BasicTextEncryptor mentioned above to org.jasypt.encryption.pbe.StandardPBEStringEncryptor, it works fine! StandardPBEStringEncryptor stringEncryptor = new StandardPBEStringEncryptor(); stringEncryptor.setAlgorithm("PBEWITHMD5ANDDES"); stringEncryptor.setPassword("com.xlys.jasypt"); I just wonder if the class BasicTextEncryptor can not be used when encrypt a simple string. Or am I used the BasicTextEncryptor class in a wrong way? Your reply will be appreciated!

Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

jasypt:decrypt fails with Yaml file

When trying to decrypt application.yml with mvn jasypt:decrypt -Djasypt.encryptor.password="{password}" -Djasypt.plugin.path="file:src/main/resources/application.yml" it fails with this error: Error Decrypting: null: EncryptionOperationNotPossibleException

mvn jasypt:encrypt -Djasypt.encryptor.password="{password}" -Djasypt.plugin.path="file:src/main/resources/application.yml" works just fine

ulisesbocchio
ulisesbocchio

what type of encryption are you using? symmetric or asymmetric?

Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

Data not in AES persited

Hi, got the following code, but its not in AES saved. When i pull data with the following Query, i dont get the String, instead i get some

Query to check if data are decodec correctly SELECT AES_ENCRYPT(empfaenger_name, '[email protected]@4D!EkJWY') FROM umsatz

Get image

The Data itseld looks like this (Basse64 Style?) image

My Code @Configuration public class HibernateConfig { @Value("${aes.key}") private String jasyptPassword; @Bean public HibernatePBEStringEncryptor hibernateIntegerEncryptor() { HibernatePBEStringEncryptor hibernatePBEStringEncryptor = new HibernatePBEStringEncryptor(); hibernatePBEStringEncryptor.setRegisteredName("hibernateIntegerEncryptor"); hibernatePBEStringEncryptor.setAlgorithm("PBEWITHMD5ANDDES"); hibernatePBEStringEncryptor.setPassword(jasyptPassword); return hibernatePBEStringEncryptor; } }

@Entity @Table(name = "umsatz") @TypeDef( name="encryptedString", typeClass=EncryptedStringType.class, parameters= { @Parameter(name="encryptorRegisteredName", value="hibernateIntegerEncryptor") } ) public class Umsatz { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Integer id; @Type(type="encryptedString") String empfaengerName; //Getter Setter }

application.properties (generated Key with the webtool, this is correct database login works as aspected) aes.key=ENC(RsH82YF6zrW7Sf1lKUOe9fVL8qcnwBtex..............Gi8EqApGb1/4aoxB5u/5VQW0kb2flEJMzA==)

Is there anyone who can help me out?

ulisesbocchio
ulisesbocchio

I'm not sure I'm following.... Are you using a StringEncryptor from jasypt to implement that EncryptedStringType and you're concocting? When you say "the data itself looks like this..." it looks like the encryption worked.... I'd assume you have a problem decrypting it back. What database type is it stored as? String/Text?

I would need to see your implementation of EncryptedStringType and HibernatePBEStringEncryptor

Sep
18
1 month ago
Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

Spring boot does not load profile specific property files when jasypt is added to classpath

Hi, when I add jasypt-spring-boot-starter 3.0.4 to my pom file, spring completely skips attempting to load application-{profile}.yml properties.

By removing the dependency from my build, the profile specific properties are immediately loaded again.

I am using an embedded cloud config server to fetch external properties and therefore am using bootstrap.yml.

I am using asymmetric encryption and have configured in bootstrap.yml and application.yml jasypt.encryptor.privateKeyFormat and jasypt.encryptor.privateKeyLocation

ulisesbocchio
ulisesbocchio

@marchi1986 are you also using the config-server embedded in your app?

Sep
10
1 month ago
Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

BasicTextEncryptor can not replace the StandardPBEStringEncryptor?

Sorry again for for disturbing~ here is my problem:

First the used dependency and version: com.github.ulisesbocchio:jasypt-spring-boot-starter:3.0.3

Problem description: when I try to encrypt a sensitive string with the class “org.jasypt.util.text.BasicTextEncryptor”,I set the password and then perform the encryption. But the result that generated in last step doesn't work and cause the exception as the following list: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.

here is the code aims at generating the target encryption that maybe help: BasicTextEncryptor encryptor1 = new BasicTextEncryptor(); encryptor1.setPassword("com.xlys.jasypt"); String encrypt1 = encryptor1.encrypt("[email protected]#$%"); System.out.println("encrypt1 = " + encrypt1); and this is content in application.yml jasypt: encryptor: algorithm: PBEWITHMD5ANDDES password: com.xlys.jasypt

I have traced the source code and find it that when I change the encrypting class from BasicTextEncryptor mentioned above to org.jasypt.encryption.pbe.StandardPBEStringEncryptor, it works fine! StandardPBEStringEncryptor stringEncryptor = new StandardPBEStringEncryptor(); stringEncryptor.setAlgorithm("PBEWITHMD5ANDDES"); stringEncryptor.setPassword("com.xlys.jasypt"); I just wonder if the class BasicTextEncryptor can not be used when encrypt a simple string. Or am I used the BasicTextEncryptor class in a wrong way? Your reply will be appreciated!

ulisesbocchio
ulisesbocchio

I think it’s the second. You have to use the exact same class with the exact same configuration to encrypt/decrypt. I can see that BasicTextEncryptor only sets the algorithm on the StandardPBEStringEncryptor so if you want to configure that for your application for it to work with the library you’d have to make sure to set the proper config. This library has different defaults than the default config of the StandardPBEStringEncryptor, in particular it uses a secure random iv generator that adds more complexity to the encrypted result. The iv is then stored with the result on the first 16 bytes of the string. I’m assuming the padding error is because the text encryptor doesn’t use it. So when you try to decrypt with the default config there’s a mismatch

Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

Spring boot does not load profile specific property files when jasypt is added to classpath

Hi, when I add jasypt-spring-boot-starter 3.0.4 to my pom file, spring completely skips attempting to load application-{profile}.yml properties.

By removing the dependency from my build, the profile specific properties are immediately loaded again.

I am using an embedded cloud config server to fetch external properties and therefore am using bootstrap.yml.

I am using asymmetric encryption and have configured in bootstrap.yml and application.yml jasypt.encryptor.privateKeyFormat and jasypt.encryptor.privateKeyLocation

ulisesbocchio
ulisesbocchio

It wouldn’t surprise me if the config server is relying on a specify type of PropertySource that it might not find with this library on because it would be wrapped by a different class. I’d inspect the environment and try to skip property sources from being decorated using property source names or types. Check out the readme on how to do that

Sep
8
1 month ago
Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

Spring boot does not load profile specific property files when jasypt is added to classpath

Hi, when I add jasypt-spring-boot-starter 3.0.4 to my pom file, spring completely skips attempting to load application-{profile}.yml properties.

By removing the dependency from my build, the profile specific properties are immediately loaded again.

I am using an embedded cloud config server to fetch external properties and therefore am using bootstrap.yml.

I am using asymmetric encryption and have configured in bootstrap.yml and application.yml jasypt.encryptor.privateKeyFormat and jasypt.encryptor.privateKeyLocation

ulisesbocchio
ulisesbocchio

Interesting. When you say embedded config server… do you mean you’re running the config server along side spring cloud config? All in the same app?

Sep
1
1 month ago
push

ulisesbocchio push ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

Using TCK Tested JDK builds of OpenJDK

The AdoptOpenJDK has been discontinued since July 2021. When using Zulu you get all the latest updated (TCK Tested) builds for all versions of OpenJDK.

Signed-off-by: Carl Dea [email protected]

ulisesbocchio
ulisesbocchio

Merge pull request #287 from carldea/master

Using TCK Tested JDK builds of OpenJDK

commit sha: 4a5836e57222a94d9bfae7aae265f05c4271c4c2

push time in 1 month ago
pull request

ulisesbocchio pull request ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

Using TCK Tested JDK builds of OpenJDK

The AdoptOpenJDK has been discontinued since July 2021. When using Zulu you get all the latest updated (TCK Tested) builds for all versions of OpenJDK.

Signed-off-by: Carl Dea [email protected]

Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

Using TCK Tested JDK builds of OpenJDK

The AdoptOpenJDK has been discontinued since July 2021. When using Zulu you get all the latest updated (TCK Tested) builds for all versions of OpenJDK.

Signed-off-by: Carl Dea [email protected]

Aug
29
1 month ago
Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

Add GraalVM Native Image Compatibility

There is now a big initiative to make Spring compatible with GraalVM Native Images, which provides massive performance and resource improvements over the traditional JVM.

I've got my application compiling to a native image now, but it fails at runtime because of this library:

2020-11-27 15:03:05,312 ERROR [main] o.s.boot.SpringApplication - Application run failed
org.springframework.aop.framework.AopConfigException: Can't create an ObjenesisCglibAopProxy since it is unsupported in native images
	at org.springframework.aop.framework.DefaultAopProxyFactory.createAopProxy(DefaultAopProxyFactory.java:26)
	at org.springframework.aop.framework.ProxyCreatorSupport.createAopProxy(ProxyCreatorSupport.java:105)
	at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:97)
	at com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter.proxyPropertySource(EncryptablePropertySourceConverter.java:71)
	at com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter.instantiatePropertySource(EncryptablePropertySourceConverter.java:78)
	at com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter.convertPropertySource(EncryptablePropertySourceConverter.java:45)
	at com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter.makeEncryptable(EncryptablePropertySourceConverter.java:37)
	at com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter.lambda$convertPropertySources$1(EncryptablePropertySourceConverter.java:27)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.concurrent.CopyOnWriteArrayList$COWIterator.forEachRemaining(CopyOnWriteArrayList.java:1206)
	at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
	at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:566)
	at com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter.convertPropertySources(EncryptablePropertySourceConverter.java:28)
	at com.ulisesbocchio.jasyptspringboot.configuration.EnableEncryptablePropertiesBeanFactoryPostProcessor.postProcessBeanFactory(EnableEncryptablePropertiesBeanFactoryPostProcessor.java:51)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:291)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:175)
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:707)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:533)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
	at com.morg.service.app.HeyItsMyFakeApplication.main(HeyItsMyFakeApplication.java:10)

This is the offending function: https://github.com/ulisesbocchio/jasypt-spring-boot/blob/master/jasypt-spring-boot/src/main/java/com/ulisesbocchio/jasyptspringboot/EncryptablePropertySourceConverter.java#L77

Judging by the comments, it looks like this section has been problematic before, but the fallback that has been introduced causes the incompatibility with Graal Native Images.

Is there an alternative to this fallback which could be created to ensure Graal compatibility? I'll also raise this issue upstream to see if the workaround used here can be avoided entirely.

Cheers!, Rich

ulisesbocchio
ulisesbocchio

3.0.4 released. It includes no AOP defaults, so you can give it a try, it shouldn't try to proxy anything unless you tell it to

Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

3.0.3 Starter can't work with SpringCloud 2020.0.1

When I tried to upgrade a Spring Cloud project from Hoxton.SR2 to 2020.0.1, it threw the following error. It worked well in the original Hoxton.SR2 version. Is there a solution?

I found that the origin of the problem is Spring Cloud recently added a CachedRandomPropertySource to add support for cached random values.

https://github.com/spring-cloud/spring-cloud-commons/pull/719

envirment: SpringCloud 2020.0.1 jasypt-spring-boot-starter 3.0.3

2021-02-11 17:44:38.573  INFO 17924 --- [           main] o.s.cloud.context.scope.GenericScope     : BeanFactory id=0437414b-f120-3a0e-8432-243df8b15dec
2021-02-11 17:44:38.589  INFO 17924 --- [           main] ptablePropertiesBeanFactoryPostProcessor : Post-processing PropertySource instances
2021-02-11 17:44:38.590  INFO 17924 --- [           main] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource cachedrandom [org.springframework.cloud.util.random.CachedRandomPropertySource] to EncryptablePropertySourceWrapper
2021-02-11 17:44:38.590  INFO 17924 --- [           main] c.u.j.EncryptablePropertySourceConverter : Converting PropertySource springCloudDefaultProperties [org.springframework.cloud.bootstrap.BootstrapApplicationListener$ExtendedDefaultPropertySource] to EncryptableSystemEnvironmentPropertySourceWrapper
2021-02-11 17:44:38.621 ERROR 17924 --- [           main] o.s.boot.SpringApplication               : Application run failed

java.lang.IllegalArgumentException: PropertySource named 'cachedrandom' does not exist
	at org.springframework.core.env.MutablePropertySources.assertPresentAndGetIndex(MutablePropertySources.java:228) ~[spring-core-5.3.3.jar:5.3.3]
	at org.springframework.core.env.MutablePropertySources.replace(MutablePropertySources.java:176) ~[spring-core-5.3.3.jar:5.3.3]
	at com.ulisesbocchio.jasyptspringboot.aop.EncryptableMutablePropertySourcesInterceptor.invoke(EncryptableMutablePropertySourcesInterceptor.java:49) ~[jasypt-spring-boot-3.0.3.jar:na]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.3.3.jar:5.3.3]
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:750) ~[spring-aop-5.3.3.jar:5.3.3]
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:692) ~[spring-aop-5.3.3.jar:5.3.3]
	at org.springframework.core.env.MutablePropertySources$$EnhancerBySpringCGLIB$$f7b0bb1c.replace(<generated>) ~[spring-core-5.3.3.jar:5.3.3]
	at com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter.lambda$convertPropertySources$1(EncryptablePropertySourceConverter.java:46) ~[jasypt-spring-boot-3.0.3.jar:na]
	at java.util.ArrayList.forEach(ArrayList.java:1257) ~[na:1.8.0_211]
	at com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter.convertPropertySources(EncryptablePropertySourceConverter.java:46) ~[jasypt-spring-boot-3.0.3.jar:na]
	at com.ulisesbocchio.jasyptspringboot.configuration.EnableEncryptablePropertiesBeanFactoryPostProcessor.postProcessBeanFactory(EnableEncryptablePropertiesBeanFactoryPostProcessor.java:41) ~[jasypt-spring-boot-3.0.3.jar:na]
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:299) ~[spring-context-5.3.3.jar:5.3.3]
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:178) ~[spring-context-5.3.3.jar:5.3.3]
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:751) ~[spring-context-5.3.3.jar:5.3.3]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:569) ~[spring-context-5.3.3.jar:5.3.3]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:144) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:767) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:426) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:326) ~[spring-boot-2.4.2.jar:2.4.2]
	at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:144) [spring-boot-2.4.2.jar:2.4.2]
	at org.springblade.common.launch.JasyptBladeApplication.run(JasyptBladeApplication.java:29) [classes/:na]
	at org.springblade.auth.AuthApplication.main(AuthApplication.java:32) [classes/:na]

2021-02-11 17:44:38.625  WARN 17924 --- [       Thread-9] c.a.n.common.http.HttpClientBeanHolder   : [HttpClientBeanHolder] Start destroying common HttpClient
2021-02-11 17:44:38.626  WARN 17924 --- [       Thread-9] c.a.n.common.http.HttpClientBeanHolder   : [HttpClientBeanHolder] Destruction of the end

Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

Don't wrap StubPropertySource

Hi, I've been analyzing an issue in my project (https://github.com/gavlyukovskiy/spring-boot-data-source-decorator/issues/55) that was reproducing only when jasypt starter is added. The issue was that I have ConfigurationProperties that references class, which was not available at runtime. I've spent some time to find the reason why and here what I found:

  1. As a performance optimization when Spring Boot binds ConfigurationProperties before attempting to bind a field it checks if property source contains the property itself or any descendants of the property. If there is no properties of specific prefix Spring Boot shortcuts to resolving whole field as null without trying to recursively resolve object tree.
  2. This check goes into ConfigurationPropertySource#containsDescendantOf that depends on particular implementation of PropertySource - that either wraps a Map or is a EnumerablePropertySource
  3. While iterating over property sources Spring Boot ignores StubPropertySource - the property source that does not have any properties and is a placeholder for properties that might be resolved in the future.
  4. When Jasypt wraps all property sources it also wraps StubPropertySource into EncryptablePropertySourceWrapper so that this property source is neither ignored nor enumerable, which leads to Spring Boot to always resolve recursively all ConfigurationProperties classes.

While the problem was 100% on my side for having class that is not available at runtime in properties, I think it makes sense to not wrap StubPropertySource and let Spring Boot optimize this use case. It should be safe as it doesn't have any properties to be encrypted and in case it's replaced with other property source during context refresh - that property source will be wrapped by your bean post processor.

I have tried locally to apply the change in EncryptablePropertySourceConverter:43 (or use jasypt.encryptor.skip-property-sources=org.springframework.core.env.PropertySource$StubPropertySource) and I saw small improvement in startup time - from 7.3 - 7.4s to 7.1 - 7.2s. Obviously is not a reliable benchmark :)

Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

Passing in an active spring profile does not encrypt values in application-{profile}.properties file

I defined the application-prod.properties file with some key/values to encrypt:

my.key=DEC(key-123)

Is it a normal behaviour that when running the suggested command for a spring profile:

mvn jasypt:encrypt -Dspring.profiles.active=prod -Djasypt.encryptor.password="the password"

didn't modify the values to be encrypted and specified in the corresponding application-prod.properties file? The plugin was still looking for them in the application.properties file:

INFO] The following profiles are active: prod
[INFO] Post-processing PropertySource instances
[INFO] Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy
[INFO] Converting PropertySource systemProperties [org.springframework.core.env.PropertiesPropertySource] to EncryptableMapPropertySourceWrapper
[INFO] Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableSystemEnvironmentPropertySourceWrapper
[INFO] Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper
[INFO] Property Filter custom Bean not found with name 'encryptablePropertyFilter'. Initializing Default Property Filter
[INFO] Started MavenCli in 1.01 seconds (JVM running for 2.601)
[INFO] Active Profiles: prod
[INFO] Encrypting file src/main/resources/application.properties
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  1.632 s
[INFO] Finished at: 2021-03-16T14:02:27+01:00

When passing the path to the file explicitly as follows:

mvn jasypt:encrypt -Djasypt.plugin.path="file:src/main/resources/application-prod.properties" -Djasypt.encryptor.password="the password"

it worked. What am I missing?

Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

Problem with spring-cloud-config and refresh

Hi,

I have a problem with jasypt and the actuator refresh endpoint.

Versions: spring boot: 2.3.9 spring cloud: Hoxton.SR10 jasypt: 3.0.3

Originally we integrated jasypt by adding the jasypt-spring-boot dependency and adding the @EnableEncryptableProperties to a configuration class. This worked as expected on initial startup of the application. We have some encrypted properties that are provided by the spring cloud config server and they are correctly decrypted and used.

But triggering the refresh without changing the configuration files results in changes to this encrypted properties and inspecting them shows that after the refresh they are filled with the encrypted value instead of the decrypted one. Searching for this issue, I found some recommendations to use the StandardEncryptableEnvironment with the SpringApplicationBuilder. I tried it, but with the StandardEncryptableEnvironment our application is no longer booting. I get this error:

java.lang.IllegalArgumentException: PropertySource named 'cachedrandom' does not exist
	at org.springframework.core.env.MutablePropertySources.assertPresentAndGetIndex(MutablePropertySources.java:228)
	at org.springframework.core.env.MutablePropertySources.replace(MutablePropertySources.java:176)
	at com.ulisesbocchio.jasyptspringboot.aop.EncryptableMutablePropertySourcesInterceptor.invoke(EncryptableMutablePropertySourcesInterceptor.java:49)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
	at org.springframework.core.env.MutablePropertySources$$EnhancerBySpringCGLIB$$8afbdedf.replace(<generated>)
	at com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter.lambda$convertPropertySources$1(EncryptablePropertySourceConverter.java:46)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1540)
	at com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter.convertPropertySources(EncryptablePropertySourceConverter.java:46)
	at com.ulisesbocchio.jasyptspringboot.configuration.EnableEncryptablePropertiesBeanFactoryPostProcessor.postProcessBeanFactory(EnableEncryptablePropertiesBeanFactoryPostProcessor.java:41)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:291)
	at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:175)
	at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:707)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:533)
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)

I debugged it a little and found out that the replace is actually done twice in the EncryptableMutablePropertySourcesInterceptor, once for the envCopy and once for the normal MutablePropertySources and in the envCopy the cachedrandom part was missing. In fact, the envCopy had only 16 property sources while the other MutablePropertySources had 19. The missing ones were the bootstrap.yml files and this cachedrandom property source.

I first thought I might be able to circumvent the issue by adding it to the skipPropertySourceClasses but this did not help, because in EncryptablePropertySourceConverter.convertPropertySources the filter only checks if it is not an instance of EncryptablePropertySource. The skipPropertySourceClasses check is only done in the makeEncrypable method, so it still tries to replace the property source with itself.

My next idea was that maybe it is not a good idea to mix the StandardEncryptableEnvironment and the @EnableEncryptableProperties annotation, so I removed the annotation. With this change, I was able to start the application again. However, trying to call refresh results in an exception again:

java.lang.IllegalArgumentException: PropertySource named 'applicationConfig: [classpath:/config/bootstrap-dev.yml]' does not exist
	at org.springframework.core.env.MutablePropertySources.assertPresentAndGetIndex(MutablePropertySources.java:228)
	at org.springframework.core.env.MutablePropertySources.replace(MutablePropertySources.java:176)
	at com.ulisesbocchio.jasyptspringboot.aop.EncryptableMutablePropertySourcesInterceptor.invoke(EncryptableMutablePropertySourcesInterceptor.java:49)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
	at org.springframework.core.env.MutablePropertySources$$EnhancerBySpringCGLIB$$8afbdedf.replace(<generated>)
	at org.springframework.cloud.context.refresh.ContextRefresher.addConfigFilesToEnvironment(ContextRefresher.java:127)
	at org.springframework.cloud.context.refresh.ContextRefresher.refreshEnvironment(ContextRefresher.java:93)
	at org.springframework.cloud.context.refresh.ContextRefresher.refresh(ContextRefresher.java:85)
	at org.springframework.cloud.endpoint.RefreshEndpoint.refresh(RefreshEndpoint.java:41)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)

Now I'm having only 19 entries in the envCopy but 21 in the wrapping MutablePropertySources. The missing ones are the bootstrap files plus the cachedrandom one from the error before. The difference is probably that this property sources belong to the bootstrap context.

I'm not sure if I'm doing something wrong, I'm a little out of ideas right now, so any hints how to solve this problem are appreciated.

Thank you Kristina

Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

Double decryption in Sprint Boot 2.4

I have custom EncryptablePropertyFilter that will match only to properties ending with '.encrypted' and custom EncryptablePropertyDetector with isEncrypted method returning always true (I dont want to deduce based on value + I want to enforce that every .encrypted will go through decryption). The problem is that it works fine on SB 2.1, 2.2, 2.3, but it breaks on 2.4. It turns out that on 2.4 it performs the decoding twice, which breaks app. It appear that they changed the chain of loading properties. On 2.4 image vs on 2.3 image

on 2.3 it goes to CachingDelegateEncryptablePropertySource -> which delegates to ResourcePropertySource on 2.4 it goes to EncryptablePropertySourceMethodInterceptor -> which delegates to CachingDelegateEncryptablePropertySource-> which delegates to ConfigurationPropertySourcesPropertySource -> CachingDelegateEncryptablePropertySource. With this multiple steps, it gets decoded twice.

Any advice how to handle that ? The easiest will be probably to change EncryptablePropertyFilter/Detector, but that sth that I was trying to avoid.

Edit: Im digging deaper: org.springframework.test.context.support.AbstractContextLoader has now 7 instead of 6 ContextCustomizers, additional one is org.springframework.boot.test.autoconfigure.actuate.metrics.MetricsExportContextCustomizerFactory which invokes https://github.com/spring-projects/spring-boot/blob/master/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySources.java#L80 that will contain chained delegates. Those delegates will be further replaced with encyrptable versions and they will perform double decruption. Still dont know how to fix it.

Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

Use vm options, it cannot start

I user jasypt-spring-boot-starter 3.0.3 encrypt my configuration,I use vm options -Djasypt.encryptor.password=hello -Djasypt.encryptor.algorithm=PBEWITHHMACSHA512ANDAES_256 -Djasypt.encryptor.iv-generator-classname=org.jasypt.iv.RandomIvGenerator in idea,app starts normally,After typing into a jar package and using vm options, it can’t be started anymore, image

Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

application.properties jasypt.encryptor.password property is not working with 3.0.3 version.

application.properties jasypt.encryptor.password property is not working with 3.0.3 version. When I changed only the version to 2.0.0, it works finely.

Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

Jasypt and application-*.properties

Hi in the documentatin it states:

"And encryptable properties will be enabled across the entire Spring Environment (This means any system property, environment property, command line argument, application.properties, yaml properties, and any other custom property sources can contain encrypted properties)"

However, it is not clear to me if it includes all applicatin-*.properties.

For example:

Let say I have a application-prod.properties with the following ecrypted property:

secret.property=ENC(xxxxxx)

By using @EncryptablePropertySource would secret.property it be recognized as encrypted in application-prod.properties?

If that's the case, would it be possible to improve the documentation to make it clear? I am sure it would help others.

Regards,

Flávio Oliva

Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

类加载器堵塞

在使用jasypt3.0.3版本中,result请求也将触发接ApplicationEvent事件,导致将一直触发ClassUtils.forName,如果如下两个类不存在的化,

这将导致类加载的调用堵塞,建议修改下

public class RefreshScopeRefreshedEventListener implements ApplicationListener<ApplicationEvent> {

    public static final String REFRESHED_EVENT_CLASS = "org.springframework.cloud.context.scope.refresh.RefreshScopeRefreshedEvent";
    public static final String ENVIRONMENT_EVENT_CLASS = "org.springframework.cloud.context.environment.EnvironmentChangeEvent";

线程堆栈

"http-nio-8091-exec-3" #41 daemon prio=5 os_prio=31 tid=0x00007fe8a1a55000 nid=0x8c03 waiting for monitor entry [0x000070000384d000]
   java.lang.Thread.State: BLOCKED (on object monitor)
        at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoader.loadClass(TomcatEmbeddedWebappClassLoader.java:68)
        - waiting to lock <0x00000006c26005f8> (a java.lang.Object)
        at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:348)
        at org.springframework.util.ClassUtils.forName(ClassUtils.java:292)
        at com.ulisesbocchio.jasyptspringboot.caching.RefreshScopeRefreshedEventListener.isAssignable(RefreshScopeRefreshedEventListener.java:45)
        at com.ulisesbocchio.jasyptspringboot.caching.RefreshScopeRefreshedEventListener.onApplicationEvent(RefreshScopeRefreshedEventListener.java:31)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:404)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:361)
        at org.springframework.web.servlet.FrameworkServlet.publishRequestHandledEvent(FrameworkServlet.java:1141)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1023)
        at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:652)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:733)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at com.apexsoft.live.session.SessionFilter.doFilter(SessionFilter.java:49)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:93)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
        at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
        at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
        at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374)
        at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:888)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1597)
        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
        - locked <0x00000007bfe9bf48> (a org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
        at java.lang.Thread.run(Thread.java:748)
Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

jasypt3.0.3中RefreshScopeRefreshedEventListener 监听导致类加载器调用堵塞

在使用jasypt3.0.3版本中,大量的Http请求都会触发publishRequestHandledEvent事件

RefreshScopeRefreshedEventListener恰好监听这类事件,如果如下两个类不存在的话,

ClassUtils.forName调用效率极低,一直处于BLOCKED状态,建议优化下

`public class RefreshScopeRefreshedEventListener implements ApplicationListener {

public static final String REFRESHED_EVENT_CLASS = "org.springframework.cloud.context.scope.refresh.RefreshScopeRefreshedEvent";
public static final String ENVIRONMENT_EVENT_CLASS = "org.springframework.cloud.context.environment.EnvironmentChangeEvent";`

线程堆栈 "http-nio-8091-exec-3" #41 daemon prio=5 os_prio=31 tid=0x00007fe8a1a55000 nid=0x8c03 waiting for monitor entry [0x000070000384d000] java.lang.Thread.State: BLOCKED (on object monitor) at org.springframework.boot.web.embedded.tomcat.TomcatEmbeddedWebappClassLoader.loadClass(TomcatEmbeddedWebappClassLoader.java:68) - waiting to lock <0x00000006c26005f8> (a java.lang.Object) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1188) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at org.springframework.util.ClassUtils.forName(ClassUtils.java:292) at com.ulisesbocchio.jasyptspringboot.caching.RefreshScopeRefreshedEventListener.isAssignable(RefreshScopeRefreshedEventListener.java:45) at com.ulisesbocchio.jasyptspringboot.caching.RefreshScopeRefreshedEventListener.onApplicationEvent(RefreshScopeRefreshedEventListener.java:31) at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172) at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165) at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:404) at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:361) at org.springframework.web.servlet.FrameworkServlet.publishRequestHandledEvent(FrameworkServlet.java:1141) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1023) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) at javax.servlet.http.HttpServlet.service(HttpServlet.java:652) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at com.apexsoft.live.session.SessionFilter.doFilter(SessionFilter.java:49) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:93) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:542) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:143) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:374) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:888) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1597) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) - locked <0x00000007bfe9bf48> (a org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748)

Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

jasypt-spring-boot-3.0.3 appear dead lock

Java stack information for the threads listed above:
===================================================
"HeartBeatSenderThread":
	at com.ulisesbocchio.jasyptspringboot.caching.CachingDelegateEncryptablePropertySource.getProperty(CachingDelegateEncryptablePropertySource.java:39)
	- waiting to lock <0x00000006c50b3880> (a com.ulisesbocchio.jasyptspringboot.aop.EncryptablePropertySourceMethodInterceptor)
	at com.ulisesbocchio.jasyptspringboot.aop.EncryptablePropertySourceMethodInterceptor.invoke(EncryptablePropertySourceMethodInterceptor.java:29)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
	at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource$$EnhancerBySpringCGLIB$$19e2f5e6.getProperty(<generated>)
	at org.springframework.boot.context.properties.bind.PropertySourcesPlaceholdersResolver.resolvePlaceholder(PropertySourcesPlaceholdersResolver.java:65)
	at org.springframework.boot.actuate.env.EnvironmentEndpoint$PropertySourcesPlaceholdersSanitizingResolver.resolvePlaceholder(EnvironmentEndpoint.java:206)
	at org.springframework.boot.context.properties.bind.PropertySourcesPlaceholdersResolver$$Lambda$104/1374733028.resolvePlaceholder(Unknown Source)
	at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:151)
	at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:124)
	at org.springframework.boot.context.properties.bind.PropertySourcesPlaceholdersResolver.resolvePlaceholders(PropertySourcesPlaceholdersResolver.java:57)
	at org.springframework.boot.actuate.env.EnvironmentEndpoint.describeValueOf(EnvironmentEndpoint.java:144)
	at org.springframework.boot.actuate.env.EnvironmentEndpoint.lambda$describeSource$4(EnvironmentEndpoint.java:137)
	at org.springframework.boot.actuate.env.EnvironmentEndpoint$$Lambda$1529/1427844589.accept(Unknown Source)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418)
	at org.springframework.boot.actuate.env.EnvironmentEndpoint.describeSource(EnvironmentEndpoint.java:137)
	at org.springframework.boot.actuate.env.EnvironmentEndpoint.lambda$getEnvironmentDescriptor$1(EnvironmentEndpoint.java:95)
	at org.springframework.boot.actuate.env.EnvironmentEndpoint$$Lambda$1528/1787943542.accept(Unknown Source)
	at java.util.LinkedHashMap.forEach(LinkedHashMap.java:676)
	at org.springframework.boot.actuate.env.EnvironmentEndpoint.getEnvironmentDescriptor(EnvironmentEndpoint.java:93)
	at org.springframework.boot.actuate.env.EnvironmentEndpoint.environment(EnvironmentEndpoint.java:82)
	at com.apexsoft.heartbeat.HeartBeatBuilder.build(HeartBeatBuilder.java:265)
	at com.apexsoft.heartbeat.HeartBeatBuilder.getHeartbeat(HeartBeatBuilder.java:90)
	at com.apexsoft.heartbeat.HeartBeatBuilder$HeartBeatSender.run(HeartBeatBuilder.java:124)
"RMI TCP Connection(11)-192.168.17.239":
	at com.ulisesbocchio.jasyptspringboot.caching.CachingDelegateEncryptablePropertySource.getProperty(CachingDelegateEncryptablePropertySource.java:39)
	- waiting to lock <0x00000006c521ebc0> (a com.ulisesbocchio.jasyptspringboot.caching.CachingDelegateEncryptablePropertySource)
	at com.ulisesbocchio.jasyptspringboot.wrapper.EncryptablePropertySourceWrapper.getProperty(EncryptablePropertySourceWrapper.java:33)
	at org.springframework.boot.context.properties.source.SpringConfigurationPropertySource.getConfigurationProperty(SpringConfigurationPropertySource.java:84)
	at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource.findConfigurationProperty(ConfigurationPropertySourcesPropertySource.java:65)
	at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource.findConfigurationProperty(ConfigurationPropertySourcesPropertySource.java:53)
	at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource.getProperty(ConfigurationPropertySourcesPropertySource.java:42)
	at com.ulisesbocchio.jasyptspringboot.EncryptablePropertySource.getProperty(EncryptablePropertySource.java:17)
	at com.ulisesbocchio.jasyptspringboot.caching.CachingDelegateEncryptablePropertySource.getProperty(CachingDelegateEncryptablePropertySource.java:41)
	- locked <0x00000006c50b3880> (a com.ulisesbocchio.jasyptspringboot.aop.EncryptablePropertySourceMethodInterceptor)
	at com.ulisesbocchio.jasyptspringboot.aop.EncryptablePropertySourceMethodInterceptor.invoke(EncryptablePropertySourceMethodInterceptor.java:29)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
	at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource$$EnhancerBySpringCGLIB$$19e2f5e6.getProperty(<generated>)
	at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:85)
	at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:62)
	at org.springframework.core.env.AbstractEnvironment.getProperty(AbstractEnvironment.java:535)
	at org.springframework.boot.admin.SpringApplicationAdminMXBeanRegistrar$SpringApplicationAdmin.getProperty(SpringApplicationAdminMXBeanRegistrar.java:154)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
	at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
	at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:193)
	at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:175)
	at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:117)
	at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:54)
	at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237)
	at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)
	at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
	at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
	at sun.rmi.transport.Transport$1.run(Transport.java:200)
	at sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$$Lambda$10/870345149.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)
"RMI TCP Connection(9)-192.168.17.239":
	at com.ulisesbocchio.jasyptspringboot.caching.CachingDelegateEncryptablePropertySource.getProperty(CachingDelegateEncryptablePropertySource.java:39)
	- waiting to lock <0x00000006c50b3880> (a com.ulisesbocchio.jasyptspringboot.aop.EncryptablePropertySourceMethodInterceptor)
	at com.ulisesbocchio.jasyptspringboot.aop.EncryptablePropertySourceMethodInterceptor.invoke(EncryptablePropertySourceMethodInterceptor.java:29)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:749)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:691)
	at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource$$EnhancerBySpringCGLIB$$19e2f5e6.getProperty(<generated>)
	at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:85)
	at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:62)
	at org.springframework.core.env.AbstractEnvironment.getProperty(AbstractEnvironment.java:535)
	at com.apex.ams.autoconfig.AmsSpringPropertySource.getProperty(AmsSpringPropertySource.java:38)
	at com.ulisesbocchio.jasyptspringboot.EncryptablePropertySource.getProperty(EncryptablePropertySource.java:17)
	at com.ulisesbocchio.jasyptspringboot.caching.CachingDelegateEncryptablePropertySource.getProperty(CachingDelegateEncryptablePropertySource.java:41)
	- locked <0x00000006c521ebc0> (a com.ulisesbocchio.jasyptspringboot.caching.CachingDelegateEncryptablePropertySource)
	at com.ulisesbocchio.jasyptspringboot.wrapper.EncryptablePropertySourceWrapper.getProperty(EncryptablePropertySourceWrapper.java:33)
	at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:85)
	at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:62)
	at org.springframework.core.env.AbstractEnvironment.getProperty(AbstractEnvironment.java:535)
	at org.springframework.boot.admin.SpringApplicationAdminMXBeanRegistrar$SpringApplicationAdmin.getProperty(SpringApplicationAdminMXBeanRegistrar.java:154)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:71)
	at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:275)
	at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:193)
	at com.sun.jmx.mbeanserver.ConvertingMethod.invokeWithOpenReturn(ConvertingMethod.java:175)
	at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:117)
	at com.sun.jmx.mbeanserver.MXBeanIntrospector.invokeM2(MXBeanIntrospector.java:54)
	at com.sun.jmx.mbeanserver.MBeanIntrospector.invokeM(MBeanIntrospector.java:237)
	at com.sun.jmx.mbeanserver.PerInterface.invoke(PerInterface.java:138)
	at com.sun.jmx.mbeanserver.MBeanSupport.invoke(MBeanSupport.java:252)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
	at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1468)
	at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
	at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1309)
	at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1401)
	at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:829)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
	at sun.rmi.transport.Transport$1.run(Transport.java:200)
	at sun.rmi.transport.Transport$1.run(Transport.java:197)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
	at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler$$Lambda$10/870345149.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Found 1 deadlock.

Is my usage wrong?

Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

jasypt Dead Lock

thread 1:

at com.ulisesbocchio.jasyptspringboot.caching.CachingDelegateEncryptablePropertySource.getProperty(CachingDelegateEncryptablePropertySource.java:39) - waiting to lock <0x000000033f4ad9d8> (a com.ulisesbocchio.jasyptspringboot.caching.CachingDelegateEncryptablePropertySource) at com.ulisesbocchio.jasyptspringboot.wrapper.EncryptableEnumerablePropertySourceWrapper.getProperty(EncryptableEnumerablePropertySourceWrapper.java:23) at org.springframework.boot.context.properties.source.SpringConfigurationPropertySource.find(SpringConfigurationPropertySource.java:111) at org.springframework.boot.context.properties.source.SpringConfigurationPropertySource.find(SpringConfigurationPropertySource.java:100) at org.springframework.boot.context.properties.source.SpringConfigurationPropertySource.getConfigurationProperty(SpringConfigurationPropertySource.java:84) at org.springframework.boot.context.properties.source.SpringIterableConfigurationPropertySource.getConfigurationProperty(SpringIterableConfigurationPropertySource.java:70) at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource.findConfigurationProperty(ConfigurationPropertySourcesPropertySource.java:65) at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource.findConfigurationProperty(ConfigurationPropertySourcesPropertySource.java:53) at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource.getProperty(ConfigurationPropertySourcesPropertySource.java:42) at com.ulisesbocchio.jasyptspringboot.EncryptablePropertySource.getProperty(EncryptablePropertySource.java:17) at com.ulisesbocchio.jasyptspringboot.caching.CachingDelegateEncryptablePropertySource.getProperty(CachingDelegateEncryptablePropertySource.java:41) - locked <0x0000000337f3e698> (a com.ulisesbocchio.jasyptspringboot.aop.EncryptablePropertySourceMethodInterceptor) at com.ulisesbocchio.jasyptspringboot.aop.EncryptablePropertySourceMethodInterceptor.invoke(EncryptablePropertySourceMethodInterceptor.java:29) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource$$EnhancerBySpringCGLIB$$257ea7b4.getProperty() at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:85) at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:68) at org.springframework.core.env.AbstractPropertyResolver.getProperty(AbstractPropertyResolver.java:175) at org.springframework.core.env.AbstractEnvironment.getProperty(AbstractEnvironment.java:551)


thread 2:

at com.ulisesbocchio.jasyptspringboot.caching.CachingDelegateEncryptablePropertySource.getProperty(CachingDelegateEncryptablePropertySource.java:39) - waiting to lock <0x0000000337f3e698> (a com.ulisesbocchio.jasyptspringboot.aop.EncryptablePropertySourceMethodInterceptor) at com.ulisesbocchio.jasyptspringboot.aop.EncryptablePropertySourceMethodInterceptor.invoke(EncryptablePropertySourceMethodInterceptor.java:29) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource$$EnhancerBySpringCGLIB$$257ea7b4.getProperty() at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:85) at org.springframework.core.env.PropertySourcesPropertyResolver.getPropertyAsRawString(PropertySourcesPropertyResolver.java:74) at org.springframework.core.env.AbstractPropertyResolver$$Lambda$34/2136288211.resolvePlaceholder(Unknown Source) at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:151) at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:124) at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:236) at org.springframework.core.env.AbstractPropertyResolver.resolvePlaceholders(AbstractPropertyResolver.java:202) at org.springframework.core.env.AbstractEnvironment.resolvePlaceholders(AbstractEnvironment.java:566) at com.ulisesbocchio.jasyptspringboot.resolver.DefaultPropertyResolver$$Lambda$360/1118494797.apply(Unknown Source) at java.util.Optional.map(Optional.java:215) at com.ulisesbocchio.jasyptspringboot.resolver.DefaultPropertyResolver.resolvePropertyValue(DefaultPropertyResolver.java:38) at com.ulisesbocchio.jasyptspringboot.resolver.DefaultLazyPropertyResolver.resolvePropertyValue(DefaultLazyPropertyResolver.java:50) at com.ulisesbocchio.jasyptspringboot.EncryptablePropertySource.getProperty(EncryptablePropertySource.java:20) at com.ulisesbocchio.jasyptspringboot.caching.CachingDelegateEncryptablePropertySource.getProperty(CachingDelegateEncryptablePropertySource.java:41) - locked <0x000000033f4ad9d8> (a com.ulisesbocchio.jasyptspringboot.caching.CachingDelegateEncryptablePropertySource) at com.ulisesbocchio.jasyptspringboot.wrapper.EncryptableEnumerablePropertySourceWrapper.getProperty(EncryptableEnumerablePropertySourceWrapper.java:23) at org.springframework.cloud.context.refresh.ContextRefresher.extract(ContextRefresher.java:253) at org.springframework.cloud.context.refresh.ContextRefresher.extract(ContextRefresher.java:229) at org.springframework.cloud.context.refresh.ContextRefresher.refreshEnvironment(ContextRefresher.java:91)

Activity icon
issue

ulisesbocchio issue comment ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

Unable to decrypt property when property is use placeholder and default value

This is my configuration.

spring:
  redis:
    password: ${PWD:ENC(HOJOq10/kNRG20xuHQvA/Q==)}

He did not decrypt the default value When I did not set the environment variable.

push

ulisesbocchio push ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

[maven-release-plugin] prepare for next development iteration

commit sha: e231dfe3cf526b82deb09de60e82da61bdb981fa

push time in 1 month ago
Activity icon
created tag

ulisesbocchio in ulisesbocchio/jasypt-spring-boot create tag jasypt-spring-boot-parent-3.0.4

createdAt 1 month ago
push

ulisesbocchio push ulisesbocchio/jasypt-spring-boot

ulisesbocchio
ulisesbocchio

[maven-release-plugin] prepare release jasypt-spring-boot-parent-3.0.4

commit sha: c0c207cda7dfc294fa986955a72384e8a5d365c9

push time in 1 month ago
Previous