Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arc - tweak ContextNotActiveException for session scoped beans to mention optional enablement #45383

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

manovotn
Copy link
Contributor

@manovotn manovotn commented Jan 6, 2025

Fixes #45191

Using the reproducer from original issue, the exception now looks like this:

jakarta.enterprise.context.ContextNotActiveException: SessionScoped context was not active when trying to obtain a bean instance for a client proxy of PRODUCER_METHOD bean [class=io.quarkus.ts.spring.data.primitivetypes.configuration.AppConfiguration, id=9767shscEaYLEayHF-_VBq-X1Aw]
- @SessionScoped is not supported by default. However, a Quarkus extension implementing session context can be used to enable this functionality (such as Undertow extension).

@manovotn manovotn requested review from Ladicek and mkouba January 6, 2025 14:16
@quarkus-bot quarkus-bot bot added the area/arc Issue related to ARC (dependency injection) label Jan 6, 2025
Copy link
Contributor

@Ladicek Ladicek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should do this also for the conversation context, but that's more complex and can be subject of a different PR. This PR LGTM.

@manovotn
Copy link
Contributor Author

manovotn commented Jan 6, 2025

I think we should do this also for the conversation context, but that's more complex and can be subject of a different PR.

I don't think ArC should solve that since we don't support it in any shape or form (and CDI Lite doesn't support it either).
That being said, if you are both in favor, I can send a PR with that as well. It should be simple enough.

Copy link

quarkus-bot bot commented Jan 6, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit bb7c3b1.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@mkouba
Copy link
Contributor

mkouba commented Jan 7, 2025

I think we should do this also for the conversation context, but that's more complex and can be subject of a different PR.

I don't think ArC should solve that since we don't support it in any shape or form (and CDI Lite doesn't support it either). That being said, if you are both in favor, I can send a PR with that as well. It should be simple enough.

Right, and since we don't support this scope annotation in any form we should probably fail the build. Currently, we silently ignore this scope declared on a class and fall back to @Dependent for a producer.

@mkouba mkouba merged commit 83f6a03 into quarkusio:main Jan 7, 2025
52 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.18 - main milestone Jan 7, 2025
@Ladicek
Copy link
Contributor

Ladicek commented Jan 7, 2025

Right, and since we don't support this scope annotation in any form we should probably fail the build. Currently, we silently ignore this scope declared on a class and fall back to @Dependent for a producer.

Technically someone could provide the conversation context implementation and expect that to work, but I agree with a build failure, at least for now.

@manovotn
Copy link
Contributor Author

manovotn commented Jan 7, 2025

Alright, I've created #45413 to track the conversation scope change.
I can most likely look into it some time later this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/arc Issue related to ARC (dependency injection) kind/bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Spring-di's @Scope#session throws ContextNotActiveException
3 participants