Closed r-okui closed 6 years ago
Thanks for the test case we will try to reproduce the issue from your test case.
Thanks a lot for the very detailed report.
This is caused by an (incorrect) fix for the following issue:
This became a Mojarra issue:
The original fix in 2.3 was:
Which was backported to Mojarra 2.2.14:
And eventually landed in Payara 4.1.1.171
The issue was a mid-request navigation that replaced the view root, and therefor cleaned the view map (that contains the concrete view scoped bean instances) which causes the beans to be destroyed. This was then followed by a session.invalidate
within that same request later, which again tries to destroy the view scoped beans. In the case of an @Stateful @ViewScoped
bean, the EJB container is responsible for destroying the bean, and it barfs on encountering a null instance.
The issue was thought to be fixed by clearing the context map, as the destroy method checks on that first, but the context map contains meta data related to view scoped bean types and has no relation to instances.
The fix was to revert this clearing of the context map, and instead check for the actual instance being null or not.
Fix is committed here: https://github.com/payara/patched-src-mojarra/commit/6914e34cddc3437c22c4b99fb4043e25b5e4cfd3#diff-9227212e21a5831a6e82023e8d621b21R181
Description
@ViewScoped does not work properly when operating the same page in two windows. The end of the scope affects to another view.
Here is the reproduction source code. https://github.com/r-okui/view_scope
Expected Outcome
Payara 4.1.1.161 ViewScope is separated in two windows.
https://github.com/r-okui/view_scope#expected-outcome
Current Outcome
Payara 4.1.2.181 End of ViewScope affects another window.
https://github.com/r-okui/view_scope#current-outcome
Steps to reproduce
Samples
CASE 1
CASE 2
Environment