ulisesbocchio / jasypt-spring-boot

Jasypt integration for Spring boot
MIT License
2.91k stars 522 forks source link

error starting encryptablePropertyResolver with jasypt-spring-boot or jasypt-spring-boot-starter and jhipster/spring cloud #74

Closed mauga closed 6 years ago

mauga commented 6 years ago

encryptablePropertyResolver in a microservice with jasypt-spring-boot 1.18 or jasypt-spring-boot-starter 1.18 and jhipster/spring cloud cannot start with error "The dependencies of some of the beans in the application context form a cycle"

I tried all examples from github repos without results

versions: spring-cloud.version Camden.SR6 spring-boot 1.5.2.RELEASE jhipster 1.1.2

this is the final message when the microservice start.


APPLICATION FAILED TO START


Description: The dependencies of some of the beans in the application context form a cycle: org.springframework.scheduling.annotation.ProxyAsyncConfiguration asyncConfiguration defined in file [C:...\config\AsyncConfiguration.class] io.github.jhipster.config.JHipsterProperties +-----+ | encryptablePropertyResolver defined in class path resource [.../ResolverConfig.class] +-----+

the ResolverConfig is exactly like the example

import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration;

import com.ulisesbocchio.jasyptspringboot.EncryptablePropertyResolver;

@Configuration public class ResolverConfig {

@Bean(name="encryptablePropertyResolver")
public EncryptablePropertyResolver encryptablePropertyResolver(@Value("${jasypt.encryptor.password}") String password) {
    return new MyEncryptablePropertyResolver(password.toCharArray());
}

}

ulisesbocchio commented 6 years ago

what does the jasypt.encryptor.password property looks like in your application.properties ?

mauga commented 6 years ago

Sorry for the delay, none of the properties are set, We needed the jaspyt just to intercept the decoding of ours yaml properties. In the end we removed completely jasypt and written a spring event handler. Thanks anyway.