Project: Tomcat
Bug 43285 Missing EL Coercion causes argument type mismatch
Reported: 2007-09-02 13:14:26 | Status: resolved fixed

I'll attach a sample web application reproducing the error. Note that this error only occurs when using Tomcat 6.0.x (i.e. it works with Jetty as it uses Sun's EL RI). Moreover it doesn't matter which JSF implementation you're using to reproduce the error (I just wanted to mention that as it's definitely no bug in MyFaces even though the following stack trace shows a FacesException). The exception stack trace: javax.faces.FacesException: Exception while calling broadcast on component : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /home.jsp][ Class: javax.faces.component.html.HtmlForm,Id: j_id_jsp_923754602_1][Class: javax.faces.component.html.HtmlCommandButton,Id: j_id_jsp_923754602_3]} at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:494) at javax.faces.component.UICommand.broadcast(UICommand.java:105) at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:292) at javax.faces.component.UIViewRoot.process(UIViewRoot.java:209) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:117) at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32) at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:95) at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:70) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:144) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619) Caused by: org.apache.jasper.el.JspELException: /home.jsp(12,3) '#{numberBean.number}' java.lang.IllegalArgumentException: argument type mismatch at org.apache.jasper.el.JspValueExpression.setValue(JspValueExpression.java:94) at org.apache.myfaces.event.SetPropertyActionListener.processAction(SetPropertyActionListener.java:72) at javax.faces.event.ActionEvent.processListener(ActionEvent.java:48) at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:489) ... 20 more Caused by: java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at javax.el.BeanELResolver.setValue(BeanELResolver.java:108) at javax.el.CompositeELResolver.setValue(CompositeELResolver.java:68) at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.access$501(FacesCompositeELResolver.java:46) at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver$6.invoke(FacesCompositeELResolver.java:132) at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.invoke(FacesCompositeELResolver.java:148) at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.setValue(FacesCompositeELResolver.java:128) at org.apache.el.parser.AstValue.setValue(AstValue.java:114) at org.apache.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:249) at org.apache.jasper.el.JspValueExpression.setValue(JspValueExpression.java:85) ... 23 more

Files changed in fix:
java/org/apache/el/parser/AstValue.java