Unproxyable @ApplicationScoped bean silently behaves as @Dependent
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 54/100
Research direction
Start by tracing how @ApplicationScoped beans are processed and how CDI resolution handles unproxyable bean types in micronaut-odi-cdi and micronaut-odi-processor-cdi; the issue does not name specific files or tests. Reproduce with the supplied NoDefaultCtor example and check whether startup or Instance.get() reports an UnproxyableResolutionException instead of silently creating dependent instances.
Written by the indexing model from the issue text.
Description
ODI 1.0.0 (micronaut-odi-cdi + micronaut-odi-processor-cdi from Maven Central), Temurin 25.0.5.
@Dependent
public class Helper { }
@ApplicationScoped
public class NoDefaultCtor {
private int hits;
@Inject public NoDefaultCtor(Helper helper) { } // no no-arg constructor
public int hit() { return ++hits; }
}
SeContainer c = SeContainerInitializer.newInstance().initialize();
NoDefaultCtor a = c.select(NoDefaultCtor.class).get();
NoDefaultCtor b = c.select(NoDefaultCtor.class).get();
// a != b, a.hit() == 1, b.hit() == 1, a.getClass() == NoDefaultCtor (no client proxy)
Injecting it into a @Dependent bean (@Inject NoDefaultCtor injected;) also gives a new instance per consumer.
Expected (CDI 4.1, "Unproxyable bean types"): the class has no non-private no-arg constructor, so it cannot be proxied. An injection point resolving to it is a deployment problem, and Instance.get() throws UnproxyableResolutionException.
Actual: compilation and startup succeed with no warning, and every lookup or injection creates a new instance, so the scope is silently lost.
This reproduces with a plain 5-class project and no interceptors; happy to attach it.
- Dominant language
- Java
- Stars
- 13
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from eclipse-ee4j/odi
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
eclipse-ee4j/odi#34 ·
All issues in eclipse-ee4j/odi
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
erkamyaman/rust-anything#1153 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
NullPointerException in BukkitPlayerListener.onInventoryClickEvent when InventoryAction is nullOpenbug
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
expandRepos produces a single comma-separated argument instead of splittingPossibly taken @Sanne-ai-bot claimed this today. Openagent:pr go:build
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Sanne/incus-spawn#2871 · 1 comment ·
Maintainers usually reply within 1 day