o:validateBean IllegalArgumentException: Cannot convert PROPERTY of type class org.omnifaces.el.ExpressionInspector$ValueExpressionType to class java.lang.Boolean #144

Closed
BalusC opened this Issue Jul 6, 2015 · 1 comment

Projects

None yet

1 participant

@BalusC
Member
BalusC commented Jul 6, 2015

http://stackoverflow.com/q/31209226/157882

In a nutshell: using class level <o:validateBean> on a boolean property via <h:selectBooleanCheckbox> fails with mentioned exception during ExpressionInspector#getValueReference().

@BalusC BalusC changed the title from IllegalArgumentException: Cannot convert PROPERTY of type class org.omnifaces.el.ExpressionInspector$ValueExpressionType to class java.lang.Boolean to o:validateBean IllegalArgumentException: Cannot convert PROPERTY of type class org.omnifaces.el.ExpressionInspector$ValueExpressionType to class java.lang.Boolean Aug 4, 2015
@BalusC BalusC closed this in 8129a00 Oct 14, 2015
@BalusC
Member
BalusC commented Oct 14, 2015

Turns out that EL coercion is causing this. I bypassed it to make it to always return null as evaluated value, so EL doesn't attempt to coerce an invalid value.

Right now the work around is to return null instead of our internal value ValueExpressionType.PROPERTY. This way EL won't attempt to coerce it. Only in EL 3.0 we can solve it more nicely by overriding the ELContext#coerceToType() to return the value object unmodified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment