temporalio / temporalio/sdk-java

Non-root namespace Spring dependencies fail on app startup

Open
#2,579 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
433
Forks
249
Avg merge
5d 6h
Merged PRs (30d)
26

Description

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

  1. Create a non-root namespace configuration
  2. Create a @Component that injects a non-root WorkflowClient (using @Resource, per docs)
  3. 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

Contributor guide

Open the contributing guide

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 Spring Starter's BeanPostProcessor and reproduce startup using a non-root namespace and a @Component with @Resource injection. Compare the documented behavior with the bean lifecycle involving WorkflowClient creation and ObjectProvider; done means the application starts successfully and non-root Temporal beans can be injected without deferred workarounds.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.