Closed mark0614 closed 4 years ago
我在apollo-use-cases中增加了一个例子,跑下来是OK的,可以参考下
我在apollo-use-cases中增加了一个例子,跑下来是OK的,可以参考下
楼主,你好。按照你的方法,我使用springInitializer自定义了一个demo项目(spring boot版本:2.0.3.RELEASE),启动后,log是正常的:
[demo1:8080] 2019-11-04 18:07:30.523 INFO 5976 [] [main] com.example.demo1.Demo1Application No active profile set, falling back to default profiles: default
[demo1:8080] 2019-11-04 18:07:30.535 INFO 5976 [] [main] org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@636e8cc: startup date [Mon Nov 04 18:07:30 CST 2019]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@57bc27f5
[demo1:8080] 2019-11-04 18:07:31.330 INFO 5976 [] [main] org.springframework.cloud.context.scope.GenericScope BeanFactory id=5ea7cbcb-b13e-31c0-85f3-8b61ad769e22
[demo1:8080] 2019-11-04 18:07:31.357 INFO 5976 [] [main] org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
[demo1:8080] 2019-11-04 18:07:31.552 INFO 5976 [] [main] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker Bean 'org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$ec377eac] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[demo1:8080] 2019-11-04 18:07:31.871 INFO 5976 [] [main] org.springframework.boot.web.embedded.tomcat.TomcatWebServer Tomcat initialized with port(s): 8080 (http)
当我加入spring cloud(Finchley.SR3)依赖后,同时加入了jasypt-spring-boot-starter(版本:1.18)问题来了:
[demo1:172.20.13.124:8080] 2019-11-04 19:00:13.217 INFO 17732 [] [main] com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter Converting PropertySource configurationProperties [org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertySource] to AOP Proxy
[demo1:172.20.13.124:8080] 2019-11-04 19:00:13.218 INFO 17732 [] [main] com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter Converting PropertySource ApolloBootstrapPropertySources [org.springframework.core.env.CompositePropertySource] to EncryptableEnumerablePropertySourceWrapper
[demo1:172.20.13.124:8080] 2019-11-04 19:00:13.219 INFO 17732 [] [main] com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter Converting PropertySource bootstrap [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
[demo1:172.20.13.124:8080] 2019-11-04 19:00:13.219 INFO 17732 [] [main] com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter Converting PropertySource systemProperties [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
[demo1:172.20.13.124:8080] 2019-11-04 19:00:13.219 INFO 17732 [] [main] com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter Converting PropertySource systemEnvironment [org.springframework.boot.env.SystemEnvironmentPropertySourceEnvironmentPostProcessor$OriginAwareSystemEnvironmentPropertySource] to EncryptableMapPropertySourceWrapper
[demo1:172.20.13.124:8080] 2019-11-04 19:00:13.219 INFO 17732 [] [main] com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter Converting PropertySource random [org.springframework.boot.env.RandomValuePropertySource] to EncryptablePropertySourceWrapper
[demo1:172.20.13.124:8080] 2019-11-04 19:00:13.219 INFO 17732 [] [main] com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter Converting PropertySource springCloudClientHostInfo [org.springframework.core.env.MapPropertySource] to EncryptableMapPropertySourceWrapper
[demo1:172.20.13.124:8080] 2019-11-04 19:00:13.219 INFO 17732 [] [main] com.ulisesbocchio.jasyptspringboot.EncryptablePropertySourceConverter Converting PropertySource applicationConfig: [classpath:/bootstrap.properties] [org.springframework.boot.env.OriginTrackedMapPropertySource] to EncryptableMapPropertySourceWrapper
[demo1:172.20.13.124:8080] 2019-11-04 19:00:13.232 INFO 17732 [] [main] org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
[demo1:172.20.13.124:8080] 2019-11-04 19:00:13.260 INFO 17732 [] [main] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker Bean 'configurationPropertiesRebinderAutoConfiguration' of type [org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration$$EnhancerBySpringCGLIB$$2eddb6e0] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
[demo1:172.20.13.124:8080] 2019-11-04 19:00:13.328 INFO 17732 [] [main] com.ulisesbocchio.jasyptspringboot.resolver.DefaultLazyPropertyResolver Property Resolver custom Bean not found with name 'encryptablePropertyResolver'. Initializing Default Property Resolver
[demo1:172.20.13.124:8080] 2019-11-04 19:00:13.329 INFO 17732 [] [main] com.ulisesbocchio.jasyptspringboot.detector.DefaultLazyPropertyDetector Property Detector custom Bean not found with name 'encryptablePropertyDetector'. Initializing Default Property Detector
[APP_NAME_IS_UNDEFINED:172.20.13.124:0000] 2019-11-04 19:00:13.654 INFO 17732 [] [main] com.ulisesbocchio.jasyptspringboot.encryptor.DefaultLazyEncryptor String Encryptor custom Bean not found with name 'jasyptStringEncryptor'. Initializing Default String Encryptor
[APP_NAME_IS_UNDEFINED:172.20.13.124:0000] 2019-11-04 19:00:13.660 INFO 17732 [] [main] com.ulisesbocchio.jasyptspringboot.encryptor.DefaultLazyEncryptor Encryptor config not found for property jasypt.encryptor.keyObtentionIterations, using default value: 1000
[APP_NAME_IS_UNDEFINED:172.20.13.124:0000] 2019-11-04 19:00:13.660 INFO 17732 [] [main] com.ulisesbocchio.jasyptspringboot.encryptor.DefaultLazyEncryptor Encryptor config not found for property jasypt.encryptor.providerName, using default value: null
[APP_NAME_IS_UNDEFINED:172.20.13.124:0000] 2019-11-04 19:00:13.660 INFO 17732 [] [main] com.ulisesbocchio.jasyptspringboot.encryptor.DefaultLazyEncryptor Encryptor config not found for property jasypt.encryptor.providerClassName, using default value: null
[APP_NAME_IS_UNDEFINED:172.20.13.124:0000] 2019-11-04 19:00:13.660 INFO 17732 [] [main] com.ulisesbocchio.jasyptspringboot.encryptor.DefaultLazyEncryptor Encryptor config not found for property jasypt.encryptor.saltGeneratorClassname, using default value: org.jasypt.salt.RandomSaltGenerator
[APP_NAME_IS_UNDEFINED:172.20.13.124:0000] 2019-11-04 19:00:13.661 INFO 17732 [] [main] com.ulisesbocchio.jasyptspringboot.encryptor.DefaultLazyEncryptor Encryptor config not found for property jasypt.encryptor.stringOutputType, using default value: base64
[APP_NAME_IS_UNDEFINED:172.20.13.124:0000] 2019-11-04 19:00:16.714 INFO 17732 [] [main] com.ulisesbocchio.jasyptspringboot.configuration.EnableEncryptablePropertiesConfiguration Bootstraping jasypt-string-boot auto configuration in context: demo1-1
[APP_NAME_IS_UNDEFINED:172.20.13.124:0000] 2019-11-04 19:00:16.715 INFO 17732 [] [main] com.example.demo1.Demo1Application No active profile set, falling back to default profiles: default
[APP_NAME_IS_UNDEFINED:172.20.13.124:0000] 2019-11-04 19:00:16.727 INFO 17732 [] [main] org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@362a019c: startup date [Mon Nov 04 19:00:16 CST 2019]; parent: org.springframework.context.annotation.AnnotationConfigApplicationContext@38ba6ce3
[APP_NAME_IS_UNDEFINED:172.20.13.124:0000] 2019-11-04 19:00:17.439 INFO 17732 [] [main] org.springframework.cloud.context.scope.GenericScope BeanFactory id=1b490803-88ca-36b5-9885-e312ed5e9a70
[APP_NAME_IS_UNDEFINED:172.20.13.124:0000] 2019-11-04 19:00:17.461 INFO 17732 [] [main] com.ulisesbocchio.jasyptspringboot.configuration.EnableEncryptablePropertiesBeanFactoryPostProcessor Post-processing PropertySource instances
......省略
能否控制下变量,看看具体是哪个依赖引入引起的?
能否控制下变量,看看具体是哪个依赖引入引起的?
加入这个依赖后,就会变成这个样子
<dependency>
<groupId>com.github.ulisesbocchio</groupId>
<artifactId>jasypt-spring-boot-starter</artifactId>
<version>1.18</version>
</dependency>
能否控制下变量,看看具体是哪个依赖引入引起的?
加入这个依赖后,就会变成这个样子 <dependency> <groupId>com.github.ulisesbocchio</groupId> <artifactId>jasypt-spring-boot-starter</artifactId> <version>1.18</version> </dependency>
我将1.18降到1.16就没有这个问题了。亲测
see #2162 #2170
This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed in 14 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had activity in the last 14 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.
apollo配置:
apollo中心的application.properties配置:
业务服务的logback-spring.xml部分配置:
服务启动后的部分日志:
问题: 日志文件配置中的
APP_NAME
变量为什么会出现APP_NAME_IS_UNDEFINED
这种情况,而且刚启动的时候APP_NAME
是有值得,启动了一会就没值了