Skip to content

Native support for RetryTemplateFactory as it uses reflections to access the field logger of RetryTemplate  #2439

Closed
@klopfdreh

Description

@klopfdreh

Describe the bug
We wanted to use Spring Cloud Config Client within a native image. During the startup of our application we saw a NullPointerException

java.lang.NullPointerException
at org.springframework.cloud.config.client.RetryTemplateFactory.create(RetryTemplateFactory.java:47)
at org.springframework.cloud.config.client.ConfigClientRetryBootstrapper.lambda$initialize$1(ConfigClientRetryBootstrapper.java:46)
at org.springframework.cloud.config.client.ConfigServerConfigDataLoader.load(ConfigServerConfigDataLoader.java:92)
at org.springframework.cloud.config.client.ConfigServerConfigDataLoader.load(ConfigServerConfigDataLoader.java:61)
at org.springframework.boot.context.config.ConfigDataLoaders.load(ConfigDataLoaders.java:96)

We had a look into RetryTemplateFactory and saw field = ReflectionUtils.findField(RetryTemplate.class, "logger"); in line 31 and field.set(retryTemplate, log); in line 47.

There is no reflect-config.json provided to describe this access.

Sample
N/A

Metadata

Metadata

Labels

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions