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

JSF pages containing #{session.id} fail with NotSerializableException when sessions are distributable #5222

Closed
pferraro opened this issue Apr 6, 2023 · 0 comments · Fixed by #5223

Comments

@pferraro
Copy link
Contributor

pferraro commented Apr 6, 2023

Describe the bug

JSF pages containing #{session.id} fail with:
java.io.NotSerializableException: com.sun.faces.cdi.SessionProducer$$Lambda$1586/0x0000000100cc6478
... when deployed as a web application.

SessionProducer creates a SessionScoped bean using a non-serializable function, which naturally fails to serialize.
I see nothing about this bean that should warrant it being SessionScoped rather than RequestScoped.

To Reproduce

A reproducer for this issue is available at: https://issues.redhat.com/browse/WFLY-17840

Expected behavior

#{session.foo} should behave the same as #{request.session.foo}.

Additional context

Changing #{session.foo} expressions to #{request.session.foo} sufficiently works around the issue. This resolves the expression via the RequestProducer, which, of course, is RequestScoped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant