I use hibernate as a jpa provider. thus some objects that are used within h:selectonemenu are 'real' objects, others are just hibernate proxy objects, acting as if they were real ones. When the implementation of that selectonemenu tries to validate if a submitted value is one of the objects in that list, ExpressionFactory.coerceToType(Object obj,Class<?> targetType) gets called.
Sometimes, obj is a real object (e.g. of class MyClass), but targetType is the class of a proxy (like MyClass$$EnhancerByCGLIB$$66ab1395_2e). In this case coerceType fails and throws illegalargumentexception which leads the selectonemenu to set its value to null.
To get around this, I made an ExpressionFactory which uses the original one as a delegate. I modified coerceToType to support proxys and use the delegate in all other cases. This works just fine but now the classloader problems above arise if I want to access my applications other classes.
[Message sent by forum member 'cmdrk' (cmdrk)]
http://forums.java.net/jive/thread.jspa?messageID=344581