JSF Validations & Hibernate cglib
Hi,
I'm having some trouble with using Hibernate with JSF.
When using hibernate, lazy loaded.
The problem is that i now have a CGLIB-enhanced version of one of my domain objects. The value of which is to be compared to a list of selectitems.
As it turns out, JSF tries casting my normal objects to a version of those EnhancedObjects, which gives me an IllegalArgumentException because of course the Parent class (ConfigProfile) cannot be cast to one of it's children (ConfigProfile$$EnhancerByCGLibxxx$$)
Has anyone ever come across this problem, and knows how to handle it ?
Thanks in advance !
Jeroen
My Exception :
12-jan-2007 11:18:14 com.sun.faces.lifecycle.ProcessValidationsPhase execute
WARNING: Cannot convert com.watchtalk.web.businessobject.ConnectProfile@966905 of type class com.watchtalk.web.businessobject.ConnectProfile to class com.watchtalk.web.businessobject.ConnectProfile$$EnhancerByCGLIB$$b8f981a2
java.lang.IllegalArgumentException: Cannot convert com.watchtalk.web.businessobject.ConnectProfile@966905 of type class com.watchtalk.web.businessobject.ConnectProfile to class com.watchtalk.web.businessobject.ConnectProfile$$EnhancerByCGLIB$$b8f981a2
at com.sun.el.lang.ELSupport.coerceToType(ELSupport.java:367)
at com.sun.el.ExpressionFactoryImpl.coerceToType(ExpressionFactoryImpl.java:52)
at javax.faces.component.UISelectOne.matchValue(Unknown Source)
at javax.faces.component.UISelectOne.validateValue(Unknown Source)
at javax.faces.component.UIInput.validate(Unknown Source)
at javax.faces.component.UIInput.executeValidate(Unknown Source)
at javax.faces.component.UIInput.processValidators(Unknown Source)
at javax.faces.component.UIForm.processValidators(Unknown Source)
at javax.faces.component.UIComponentBase.processValidators(Unknown Source)
at javax.faces.component.UIViewRoot.processValidators(Unknown Source)
at com.sun.faces.lifecycle.ProcessValidationsPhase.execute(Unknown Source)
at com.sun.faces.lifecycle.LifecycleImpl.phase(Unknown Source)
at com.sun.faces.lifecycle.LifecycleImpl.execute(Unknown Source)
at javax.faces.webapp.FacesServlet.service(Unknown Source)

