ViewScoped bean being initialized multiple times with includeViewParams="true"

67 views
Skip to first unread message

eng.dan...@gmail.com

unread,
Jun 20, 2023, 7:10:37 AM6/20/23
to WildFly

Hi,

I'm currently migrating an web application developed in JSF from Wildfly 26 to Wildfly28. All the code was refactored to jakarta.* and I'm experiencing some strange behaviour with ViewScoped beans.

On pages containing <h:link ... includeViewParams="true"/> the corresponding backing bean is being initialized multiple times.

Anyone facing the same issue?

More detail: https://stackoverflow.com/questions/76358930/viewscoped-bean-being-initialized-multiple-times-with-includeviewparams-true

Thanks for your help!

Scott Marlow

unread,
Jun 20, 2023, 9:40:44 AM6/20/23
to eng.dan...@gmail.com, WildFly
Have you tried to add Thread.dumpStack() to the backing bean?  That might show what is initializing that bean multiple times.  With that information, perhaps a tracking issue could then be opened.  

Scott

--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/fb241e54-4ed5-4d7d-9dea-2e15bc0333f4n%40googlegroups.com.

Daniel Novo

unread,
Jun 20, 2023, 10:11:24 AM6/20/23
to Scott Marlow, WildFly
Hi Scott,

Thanks for your reply. Attached the dump, i'm not sure what to look for.



--
--------------
Daniel Novo
viewscoped_dumpStack.txt

eng.dan...@gmail.com

unread,
Aug 2, 2023, 4:46:29 AM8/2/23
to WildFly
This bug is fixed on mojarra 4.0.3.

After replacing mojarra on wildfly-29.0.0.Final\modules\system\layers\base\jakarta\faces\impl\main i was unable to reproduce the error.

Thanks

Martin Choma

unread,
Aug 16, 2023, 11:57:35 AM8/16/23
to WildFly
I have created issue to upgrade Wildfly to Mojarra 4.0.3 https://issues.redhat.com/browse/WFLY-18362

Martin Choma

unread,
Aug 17, 2023, 3:51:04 AM8/17/23
to WildFly
> corresponding backing bean is being initialized multiple times.

What exactly do you mean?I tried to reproduce it. When I load pageOne I see in console "Page One PostConstruct". When I click the pageTwo link, message "Page One PostConstruct" is printed in output again. What is what you do not expect? Only one such message?

Daniel Novo

unread,
Sep 4, 2023, 9:29:25 AM9/4/23
to Martin Choma, WildFly
Hi Martin,

Sorry, i was on vacation.

PageOne bean is ViewScoped, the expected behaviour is to print only one message.

Anyway, this is fixed on mojarra 4.0.3

--
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.


--
--------------
Daniel Novo
Reply all
Reply to author
Forward
0 new messages