Comment From: spencergibb
Please as description, along with versions used and how to recreate the problem.
Comment From: chp008
Spring boot: 2.0.8.Release.
Spring cloud: Finchley.RELEASE
we have an applicationContext.xml to define the beans.
<bean id="jnditemplate" class="jnditemplate">
<property name="environment">
<props><propkey="java.naming.provider.url">${xxx.host.provider.url}</prop>
</props>
</property>
</bean>
If we only use the spring boot, it would be fine. the spring boot can be started up correctly.
Since I want to introduce the feign. so I introduce the
compile("org.springframework.cloud:spring-cloud-starter-openfeign")
Then when I start it up:
the application will say: the JndiTemplate create InitialContext is failed. because the property passing into it is still ${xxxxx.xxx}
protected Context createInitialContext() throws NamingException {
Hashtable<?, ?> icEnv = null;
Properties env = getEnvironment();
if (env != null) {
icEnv = new Hashtable<>(env.size());
CollectionUtils.mergePropertiesIntoMap(env, icEnv);
}
return new InitialContext(icEnv);
}
I checked that when the application started, the application context will invokeBeanDefinitionRegistryPostProcessors which will trigger the RefreshAutoConfiguration-> postProcessBeanDefinitionRegistry. it will loop all the beans & create the bean jnditemplate. but when it createInitialContext(), the enviroment passing into it contains the {xxx}.
If I disable it. it will work //@SpringBootApplication(exclude = { RefreshAutoConfiguration.class })
Comment From: spencergibb
I need the version of spring cloud as well
Comment From: chp008
I have updated it.
Comment From: spencergibb
Do you only add the feign dependency or do you create a client?
Comment From: chp008
I only add the feign dependency , I have not create any client.
Comment From: ryanjbaxter
Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.
Comment From: spencergibb
If you'd like us to investigate please
Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.
Comment From: chp008
please see my code here: https://github.com/chp008/issues/tree/issue_01 this issue is only happing in Finchley.RELEASE. it will not be an issue in Greenwich.RELEASE. Reproduce: set a debug here in JNDITemplate. to see the property value public void setEnvironment(@Nullable Properties environment) { this.environment = environment; }
Comment From: spencergibb
Finchley is no longer supported. please upgrade