javax.faces.FacesException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • h4. Description Convertors of a List in a Map do not work the same between two different Tomcat versions (versions tested are 6.0.29 and 6.0.36): the original value List<String> becomes a String[]. This throws ClassCastException in client code (validator methods, valueChange listeners, action methods...) where a type List is expected and not an array. h4. Steps to reproduce I am going to send source files and war file of the following test case to issues@javaserverfaces.java.net In each Tomcat version, do this: 1) Click on the button "send" 2) Click on the button "error (only in Tomcat 6.0.36)" h4. Log lines written after the tests h5. Tomcat 6.0.29 h6. After a click on the button "send" {noformat} validatorMethod: value='[1, 2]' type='java.util.ArrayList' actionMethod: map='{1=[1, 2]}' type='java.util.HashMap' actionMethod: map[1]='[1, 2]' type='java.util.ArrayList' {noformat} h6. After a click on the button "error (only in Tomcat 6.0.36)" {noformat} validatorMethod: value='[1, 2]' type='java.util.ArrayList' {noformat} h5. Tomcat 6.0.36 h6. After a click on the button "send" {noformat} validatorMethod: value='[Ljava.lang.String;@144e858' type='java.lang.String[]' arrayToString='[1, 2]' actionMethod: map='{1=[Ljava.lang.String;@144e858}' type='java.util.HashMap' actionMethod: map[1]='[Ljava.lang.String;@144e858' type='java.lang.String[]' arrayToString='[1, 2]' {noformat} h6. After a click on the button "error (only in Tomcat 6.0.36)" validatorMethod: value='[Ljava.lang.String;@a1c582' type='java.lang.String[]' arrayToString='[1, 2]' {noformat} com.sun.faces.lifecycle.InvokeApplicationPhase execute WARN: #{Index.actionMethodError}: java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.util.List javax.faces.FacesException: #{Index.actionMethodError}: java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.util.List at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118) at javax.faces.component.UICommand.broadcast(UICommand.java:315) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282) at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646) 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:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) Caused by: javax.faces.el.EvaluationException: java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.util.List at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101) at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) ... 19 more Caused by: java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.util.List at newpackage.Index.actionMethodError(Index.java:60) 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 org.apache.el.parser.AstValue.invoke(AstValue.java:191) at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87) ... 20 more {noformat} h4. Possible related issues "javax.el.MapELResolver getType returns class of kept object instead of Object.class" https://issues.apache.org/bugzilla/show_bug.cgi?id=51177 This bug was resolved in Tomcat 6.0.33 (see http://tomcat.apache.org/tomcat-6.0-doc/changelog.html) "JspValueExpression.getType() returns Object.class instead of correct Type" https://issues.apache.org/bugzilla/show_bug.cgi?id=44637 This bug is linked by the previous bug page.
    via by jsf.01,
  • h4. Description Convertors of a List in a Map do not work the same between two different Tomcat versions (versions tested are 6.0.29 and 6.0.36): the original value List<String> becomes a String[]. This throws ClassCastException in client code (validator methods, valueChange listeners, action methods...) where a type List is expected and not an array. h4. Steps to reproduce I am going to send source files and war file of the following test case to issues@javaserverfaces.java.net In each Tomcat version, do this: 1) Click on the button "send" 2) Click on the button "error (only in Tomcat 6.0.36)" h4. Log lines written after the tests h5. Tomcat 6.0.29 h6. After a click on the button "send" {noformat} validatorMethod: value='[1, 2]' type='java.util.ArrayList' actionMethod: map='{1=[1, 2]}' type='java.util.HashMap' actionMethod: map[1]='[1, 2]' type='java.util.ArrayList' {noformat} h6. After a click on the button "error (only in Tomcat 6.0.36)" {noformat} validatorMethod: value='[1, 2]' type='java.util.ArrayList' {noformat} h5. Tomcat 6.0.36 h6. After a click on the button "send" {noformat} validatorMethod: value='[Ljava.lang.String;@144e858' type='java.lang.String[]' arrayToString='[1, 2]' actionMethod: map='{1=[Ljava.lang.String;@144e858}' type='java.util.HashMap' actionMethod: map[1]='[Ljava.lang.String;@144e858' type='java.lang.String[]' arrayToString='[1, 2]' {noformat} h6. After a click on the button "error (only in Tomcat 6.0.36)" validatorMethod: value='[Ljava.lang.String;@a1c582' type='java.lang.String[]' arrayToString='[1, 2]' {noformat} com.sun.faces.lifecycle.InvokeApplicationPhase execute WARN: #{Index.actionMethodError}: java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.util.List javax.faces.FacesException: #{Index.actionMethodError}: java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.util.List at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118) at javax.faces.component.UICommand.broadcast(UICommand.java:315) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282) at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646) 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:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) Caused by: javax.faces.el.EvaluationException: java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.util.List at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101) at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) ... 19 more Caused by: java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.util.List at newpackage.Index.actionMethodError(Index.java:60) 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 org.apache.el.parser.AstValue.invoke(AstValue.java:191) at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87) ... 20 more {noformat} h4. Possible related issues "javax.el.MapELResolver getType returns class of kept object instead of Object.class" https://issues.apache.org/bugzilla/show_bug.cgi?id=51177 This bug was resolved in Tomcat 6.0.33 (see http://tomcat.apache.org/tomcat-6.0-doc/changelog.html) "JspValueExpression.getType() returns Object.class instead of correct Type" https://issues.apache.org/bugzilla/show_bug.cgi?id=44637 This bug is linked by the previous bug page.
    via by jsf.01,
    • javax.faces.FacesException: #{Index.actionMethodError}: java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.util.List at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118) at javax.faces.component.UICommand.broadcast(UICommand.java:315) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282) at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81) at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646) 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:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:619) Caused by: javax.faces.el.EvaluationException: java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.util.List at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:101) at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102) ... 19 more Caused by: java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.util.List at newpackage.Index.actionMethodError(Index.java:60) 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 org.apache.el.parser.AstValue.invoke(AstValue.java:191) at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276) at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105) at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87) ... 20 more
    No Bugmate found.