-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Spring-di's @Scope#session throws ContextNotActiveException #45191
Comments
/cc @aureamunoz (spring), @geoand (spring) |
AFAIK the session scope was never supported. @geoand do you happen to know how |
It never did. If it worked before, that was purely accidental |
From the doc: |
Right but what Martin means is that ArC never had an actual session scope impl so we must have ignored it or transformed it into another one whereas now it seems to use the newly added context (which is for tests). |
I believe that the scope was previously simply ignored. The
|
I was looking into the Spring processor as well and came to the same conclusion.
While this is the right solution, it might break existing apps - an alternative would be to re-implement the fallback to |
Good point. Although the fallback should not be used by default because this functionality was unintenional and erroneous. Maybe we should add a config knob, fail by default but enable the fallback if really needed. |
+1 |
The fail message could mention the fallback configuration option. |
Describe the bug
After the merge of #45170 the
@Scope(scopeName = "session")
stopped working and throwing thejakarta.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]
Other scopes seems working fine. So maybe with recent change the SpringDIProcessor needs to updated.
Expected behavior
Not getting
ContextNotActiveException
when using@Scope(scopeName = "session")
Actual behavior
How to Reproduce?
git clone -b spring-session-scoped git@github.com:jedla97/quarkus-reproducers.git
cd quarkus-reproducers
quarkus dev
We mainly propagated it to headers when running test. For simplification I add it as response value on
MagazineResource#test
endpoint (magazine-resource
).Output of
uname -a
orver
No response
Output of
java -version
No response
Quarkus version or git rev
main
Build tool (ie. output of
mvnw --version
orgradlew --version
)No response
Additional information
If you want to try it on our TS see https://github.com/quarkus-qe/quarkus-test-suite/tree/main/spring/spring-data
You can run run it by
mvn -fae -V -B clean verify -Dreruns=0 -Pspring-modules -pl spring/spring-data
The text was updated successfully, but these errors were encountered: