[richfaces-issues] [JBoss JIRA] Commented: (RF-11035) Unexpected exception during isValid call with Hibernate @Size validation on h:selectManyCheckbox

Ján Jamrich (JIRA) jira-events at lists.jboss.org
Fri Jun 3 09:08:59 EDT 2011


    [ https://issues.jboss.org/browse/RF-11035?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12606317#comment-12606317 ] 

Ján Jamrich commented on RF-11035:
----------------------------------

Exception get with MyFaces:

javax.faces.FacesException: javax.validation.ValidationException: Unexpected exception during isValid call
	at org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.wrap(ExceptionHandlerImpl.java:241)
	at org.apache.myfaces.shared_impl.context.ExceptionHandlerImpl.handle(ExceptionHandlerImpl.java:156)
	at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:191)
	at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
	at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.richfaces.tests.metamer.TestIdentityFilter.doFilter(TestIdentityFilter.java:93)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.richfaces.webapp.PushFilter.doFilter(PushFilter.java:130)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:462)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:395)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:250)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:619)
Caused by: javax.validation.ValidationException: Unexpected exception during isValid call
	at org.hibernate.validator.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:156)
	at org.hibernate.validator.engine.ConstraintTree.validateConstraints(ConstraintTree.java:140)
	at org.hibernate.validator.metadata.MetaConstraint.validateConstraint(MetaConstraint.java:121)
	at org.hibernate.validator.engine.ValidatorImpl.validateValueForGroup(ValidatorImpl.java:648)
	at org.hibernate.validator.engine.ValidatorImpl.validateValue(ValidatorImpl.java:584)
	at org.hibernate.validator.engine.ValidatorImpl.validateValue(ValidatorImpl.java:146)
	at javax.faces.validator.BeanValidator.validate(BeanValidator.java:183)
	at javax.faces.component._ComponentUtils.callValidators(_ComponentUtils.java:173)
	at javax.faces.component.UISelectMany.validateValue(UISelectMany.java:347)
	at javax.faces.component.UIInput.validate(UIInput.java:583)
	at javax.faces.component.UISelectMany.validate(UISelectMany.java:392)
	at javax.faces.component.UIInput.processValidators(UIInput.java:247)
	at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1218)
	at javax.faces.component.UIForm.processValidators(UIForm.java:147)
	at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1218)
	at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1218)
	at javax.faces.component.UIComponentBase.processValidators(UIComponentBase.java:1218)
	at javax.faces.component.UIViewRoot._processValidatorsDefault(UIViewRoot.java:1322)
	at javax.faces.component.UIViewRoot.access$500(UIViewRoot.java:75)
	at javax.faces.component.UIViewRoot$ProcessValidatorPhaseProcessor.process(UIViewRoot.java:1397)
	at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1278)
	at javax.faces.component.UIViewRoot.processValidators(UIViewRoot.java:754)
	at org.apache.myfaces.lifecycle.ProcessValidationsExecutor.execute(ProcessValidationsExecutor.java:34)
	at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171)
	... 24 more
Caused by: java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.util.Collection
	at org.hibernate.validator.constraints.impl.SizeValidatorForCollection.isValid(SizeValidatorForCollection.java:30)
	at org.hibernate.validator.engine.ConstraintTree.validateSingleConstraint(ConstraintTree.java:153)
	... 47 more

> Unexpected exception during isValid call with Hibernate @Size validation on h:selectManyCheckbox
> ------------------------------------------------------------------------------------------------
>
>                 Key: RF-11035
>                 URL: https://issues.jboss.org/browse/RF-11035
>             Project: RichFaces
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>         Environment:     * RichFaces 4.1.0-SNAPSHOT r.22520
>     * Metamer ${4.1.0-SNAPSHOT} r.${22520}
>     * Apache MyFaces JSF-2.0 Core Impl 2.0.4 / Mojarra 2.0.4-b09
>     * Apache Tomcat 7.0.12
>     * Java(TM) SE Runtime Environment 1.6.0_19-b04 @Linux
>     * Firefox 3.6.17 @ Linux x86_64
>            Reporter: Ján Jamrich
>
> When validation performed on input of type h:selectManyCheckbox (bound to property of type List<String>) on backing bean), and unexpected error appear. See details for Mojarra and MyFaces in log attached.
> Since property bound to property is List type, SizeValidatorForCollection validator implementation is called. But submited items from h:selectManyCheckbox are sent to appropriate method (isValid() ) as String[]. (Every item from selectManyCheckbox is another array item). Its the same behavior for Mojarra and MyFaces.
> @Size annotation declare that it should work with String, Collection, Map and Array.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the richfaces-issues mailing list