forgot to mention that I usually add 'private' to managed bean members that
I reference via @Inject, so in my app, I would do the following:
@Inject
private UserDataB udB;
@Inject
private ItemC itemC;
@Inject
private ImageC imageC;
@Inject
private UserC userC;
also, I would change the JSF-managed-bean to a CDI-managed bean.
FYI, MyFaces 2.2.0 (snapshot) is available, now, for download-n-testing,
and MyFaces 2.2.0 (snapshot) has CDI @ViewScoped.
also OmniFaces 1.6 has CDI @ViewScoped, too, for MyFaces 2.0.x and 2.1.x;
i'm using that in production, and it has been working great with TomEE
1.6.0 and MyFaces 2.1.12.
On Tue, Oct 1, 2013 at 12:37 PM, Howard W. Smith, Jr. <
[email protected]> wrote:
>
>
>>
>> So...the error happens randomly (just sometimes to some users) for all
>> pages that modify information and are backed by a @ViewScoped bean:
>>
>
> I looked at your bean, and it is quite interesting that this (JSF)
> 'managedbean',
>
> @ManagedBean(name = "addItem")
> @ViewScoped
> public class AddItemB implements Serializable {
>
>
> uses CDI to @Inject the following:
>
> @Inject
> UserDataB udB;
> @Inject
> ItemC itemC;
> @Inject
> ImageC imageC;
> @Inject
> UserC userC;
>
> I don't know if MyFaces' implementation is expecting JSF managed beans to
> do CDI @Inject. maybe MyFaces implementation does allow for this and does
> 'not' place assumption that JSF managedbean will 'never' have or allow for
> CDI @Inject. I know, in my JSF/PrimeFaces/MyFaces/TomEE web app, I would
> never try something like this. I would do CDI managed bean and do CDI
> @Inject into other CDI managed beans. that is why i migrated 'from' JSF
> managed beans to CDI managed beans, when I migrated from Glassfish/R.I. to
> TomEE/OpenWebBeans.
>