spring-cloud / spring-cloud/spring-cloud-vault

Unable to instantiate CloudFoundryVcapEnvironmentPostProcessor during config refresh

Open
#942 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
291
Forks
152
Avg merge
11h 24m
Merged PRs (30d)
3

Description

Before adding and provisioning spring cloud vault, our app was refreshing fine via the /actuator/refresh endpoint. But after adding and provisioning spring cloud vault the endpoint returns 500 due to the following exception:

java.lang.IllegalArgumentException: Unable to instantiate org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor. Caused by: java.lang.ClassNotFoundException: org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor

Our app's dependency versions:

  • spring boot 4.0.6
  • spring-cloud-dependencies: 2025.1.0
  • spring-cloud-services-starter-config-client: 4.4.0
  • spring-cloud-starter-vault-config: 5.0.0
  • spring-vault-core: 5.0.0
  • spring-boot-starter-cloudfoundry

The rest of the stack trace:
java.lang.IllegalArgumentException: Unable to instantiate org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor [org.springframework.boot.EnvironmentPostProcessor] at org.springframework.boot.util.Instantiator.lambda$static$0(Instantiator.java:54) ..... Original Stack Trace: at org.springframework.boot.util.Instantiator.lambda$static$0(Instantiator.java:54) at org.springframework.boot.util.Instantiator.instantiate(Instantiator.java:202) at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(Unknown Source) at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(Unknown Source) at java.base/java.util.stream.ReferencePipeline.toArray(Unknown Source) at java.base/java.util.stream.ReferencePipeline.toArray(Unknown Source) at java.base/java.util.stream.ReferencePipeline.toList(Unknown Source) at org.springframework.boot.util.Instantiator.instantiate(Instantiator.java:192) at org.springframework.boot.util.Instantiator.instantiate(Instantiator.java:127) at org.springframework.boot.util.Instantiator.instantiate(Instantiator.java:114) at org.springframework.cloud.context.refresh.ConfigDataContextRefresher.updateEnvironment(ConfigDataContextRefresher.java:90) at org.springframework.cloud.context.refresh.ContextRefresher.refreshEnvironment(ContextRefresher.java:100) at org.springframework.cloud.context.refresh.ContextRefresher.refresh(ContextRefresher.java:93) at org.springframework.cloud.endpoint.RefreshEndpoint.refresh(RefreshEndpoint.java:46) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:281) at org.springframework.boot.actuate.endpoint.invoke.reflect.ReflectiveOperationInvoker.invoke(ReflectiveOperationInvoker.java:76) at org.springframework.boot.actuate.endpoint.annotation.AbstractDiscoveredOperation.invoke(AbstractDiscoveredOperation.java:62) at org.springframework.boot.webflux.actuate.endpoint.web.AbstractWebFluxEndpointHandlerMapping$ElasticSchedulerInvoker.lambda$invoke$0(AbstractWebFluxEndpointHandlerMapping.java:303) at reactor.core.publisher.MonoCallable.call(MonoCallable.java:69) at reactor.core.publisher.FluxSubscribeOnCallable$CallableSubscribeOnSubscription.run(FluxSubscribeOnCallable.java:228) at io.micrometer.context.ContextSnapshot.lambda$wrap$0(ContextSnapshot.java:91) at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:72) at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: org.springframework.boot.cloud.CloudFoundryVcapEnvironmentPostProcessor at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source) at java.base/java.lang.ClassLoader.loadClass(Unknown Source) at java.base/java.lang.Class.forName0(Native Method) at java.base/java.lang.Class.forName(Unknown Source) at org.springframework.util.ClassUtils.forName(ClassUtils.java:302) at org.springframework.boot.util.Instantiator$TypeSupplier$1.get(Instantiator.java:282) at org.springframework.boot.util.Instantiator.instantiate(Instantiator.java:197) at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.base/java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(Unknown Source) at java.base/java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.base/java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.base/java.util.stream.AbstractPipeline.evaluateToArrayNode(Unknown Source) at java.base/java.util.stream.ReferencePipeline.toArray(Unknown Source) at java.base/java.util.stream.ReferencePipeline.toArray(Unknown Source) at java.base/java.util.stream.ReferencePipeline.toList(Unknown Source) at org.springframework.boot.util.Instantiator.instantiate(Instantiator.java:192) at org.springframework.boot.util.Instantiator.instantiate(Instantiator.java:127) at org.springframework.boot.util.Instantiator.instantiate(Instantiator.java:114) at org.springframework.cloud.context.refresh.ConfigDataContextRefresher.updateEnvironment(ConfigDataContextRefresher.java:90) at org.springframework.cloud.context.refresh.ContextRefresher.refreshEnvironment(ContextRefresher.java:100) at org.springframework.cloud.context.refresh.ContextRefresher.refresh(ContextRefresher.java:93) at org.springframework.cloud.endpoint.RefreshEndpoint.refresh(RefreshEndpoint.java:46) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source) at java.base/java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:281) at org.springframework.boot.actuate.endpoint.invoke.reflect.ReflectiveOperationInvoker.invoke(ReflectiveOperationInvoker.java:76) at org.springframework.boot.actuate.endpoint.annotation.AbstractDiscoveredOperation.invoke(AbstractDiscoveredOperation.java:62) at org.springframework.boot.webflux.actuate.endpoint.web.AbstractWebFluxEndpointHandlerMapping$ElasticSchedulerInvoker.lambda$invoke$0(AbstractWebFluxEndpointHandlerMapping.java:303) at reactor.core.publisher.MonoCallable.call(MonoCallable.java:69) at reactor.core.publisher.FluxSubscribeOnCallable$CallableSubscribeOnSubscription.run(FluxSubscribeOnCallable.java:228) at io.micrometer.context.ContextSnapshot.lambda$wrap$0(ContextSnapshot.java:91) at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:72) at reactor.core.scheduler.SchedulerTask.call(SchedulerTask.java:28) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the /actuator/refresh entry point and the ConfigDataContextRefresher and ContextRefresher stack frames, then inspect the listed Spring Boot, Spring Cloud Vault, and Cloud Foundry dependencies for the missing class. Reproduce the refresh failure and determine the compatible dependency configuration; done means /actuator/refresh completes without the ClassNotFoundException and returns successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring-boot
Domain
backend, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.