GetApplication (). SendExpressionGet trying to create a new instance (issue with jsf 2.0 & # 8594; 2.2)?

For some reason (wondering why ....) After creating the bean (resulting in ValueExpressionImpl: #{admin.userLocale}

(I see it in the stack trace at the constructor breakpoint), after that when my phase-styler fails (exception) when calling the next commands

return context.getApplication().evaluateExpressionGet(context,
            "#{myBean}", myBean.class);

      

Executing the code above triggers the constructor a second time - why?

It's weird that I got the exact mechanism working just fine (bean constructor call -> phase listener calling the command "the" (which doesn't call the beans constructor)) in many other applications ... but in this particular application it doesn't work.

It's also important to note that as of MyFaces 2.0.11, this app works just fine.

I have double and triple checked that faces-config / web.xml is similar to other applications.

The exception I get after migrating from MyFaces JSF 2.0.11 to 2.2.3 is:

javax.faces.view.facelets.TagAttributeException: /viewMetadata/myPage.xhtml on line 13 and column 38 locale = "# {myBean.userLocale}" null

...

Caused by: java.lang.NullPointerException on org.apache.myfaces.config.ManagedBeanBuilder.getScope (ManagedBeanBuilder.java:560)

I did a little google and found the following MYFACES-3907 and I even tried to apply the fix but all it did was remove the exception but my webapp is still not good

ps Its s @SessionScoped

and Id of the phase in which it is called getApplication().evaluateExpressionGet

,RESTORE_VIEW

Any ideas on how I can figure out the cause of the problem?

Thank!

+3


source to share


1 answer


Found the problem ... although I really don't know why (there are some theories)

In this bean mine was ManagedProperty

...

@ManagedProperty(value = "#{error}")
private ErrorPageMBean error;  //with getter/setter

      



This managed property has been there for years and hasn't even been used. and again it all worked fine in MyFaces 2.0.11 ...

The moment I uninstalled everything it started working perfectly ...

Any idea what's wrong with this ManagedProperty

?

+1


source







All Articles