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.
#{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.
Describe the bug
JSF pages containing web application.
#{session.id}
fail with: java.io.NotSerializableException: com.sun.faces.cdi.SessionProducer$$Lambda$1586/0x0000000100cc6478 ... when deployed as aSessionProducer creates a
SessionScoped
bean using a non-serializable function, which naturally fails to serialize. I see nothing about this bean that should warrant it beingSessionScoped
rather thanRequestScoped
.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.