sdk-java
sdk-java copied to clipboard
Non-root namespace Spring dependencies fail on app startup
Expected Behavior
Defining non-root namespaces in the Spring Starter should allow beans to be injected.
Actual Behavior
The documentation calls out that this is supported, yet the BeanPostProcessor that creates these beans run after bean initialization, so application startup will fail.
In order to work around this, one must use an ObjectProvider to decouple component autowiring from Temporal bean creation, deferring bean finalization to either PostConstruct or app runtime.
Steps to Reproduce the Problem
- Create a non-root namespace configuration
- Create a
@Componentthat injects a non-rootWorkflowClient(using@Resource, per docs) - Start the application: The app should fail to start due to the non-root namespace WorkflowClient being unavailable.
Specifications
- Version: 1.29.0, 1.30.1
- Platform: N/A