1

Here is my current code within the application Java: SourceActiveTab activeTab = (SourceActiveTab)fc.getApplication().createValueBinding("#{sourceActiveTab}").getValue(fc);

This is what I'm trying to replace it with based on what I have found here and the web javadocs
SourceActiveTab activeTab1 = fc.getApplication().evaluateExpressionGet(fc,"#{sourceActiveTab}", SourceActiveTab.class);

This is the error I get when trying to use the fixed code. What am I missing or doing wrong?

Root cause of ServletException. javax.faces.el.EvaluationException: Exception while invoking expression #{sourceBaseBean.selectPersonBtn}at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:156) at javax.faces.component.UICommand.broadcast(UICommand.java:89) at javax.faces.component.UIData.broadcast(UIData.java:517) at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180) at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158) Truncated. see log file for complete stacktrace Caused By: java.lang.NoSuchMethodError: javax.faces.application.Application.evaluateExpressionGet(Ljavax/faces/context/FacesContext;Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object; at lean.source.beans.SourceBaseBean.selectPersonBtn(SourceBaseBean.java:246) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498)

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
RalphC
  • 21
  • 5
  • Huh? Are you trying to run JSF 2.x code on a JSF 1.x environment without upgrading it to JSF 2.x first? Why exactly? You better first upgrade the environment from JSF 1.x to JSF 2.x. It's backwards compatible. Then you can start writing JSF 2.x specific code. – BalusC May 05 '20 at 21:58
  • To be clear: the exception which you got there basically tells that the environment is still running JSF 1.x! Most likely you forgot to remove the JSF 1.x libraries after having added JSF 2.x libraries, or you only have JSF 2.x libraries in compile time classpath and not in the runtime classpath. – BalusC May 05 '20 at 22:31
  • Question for you my application is only using Myfaces-api-1.1.5 and Myfaces-impl-1.1.5 jars. Can I update to the MyFaces 2.3.6 api and Impl jar and it still be backward compatible? Or Should I go to JSF 2.x only your recommendation would be appreciated. – RalphC May 06 '20 at 14:36

0 Answers0