The javassist proxies of classes that declare getHandler() method lead to ClassCastException in org.hibernate.proxy.pojo.javassist.JavassistLazyInitializer.
This is caused by change JASSIST-144 in javassist 3.16. This change deprecates ProxyObject interface and introduces new less intrusive interface Proxy. The new interface does not declare getHandler() method that would conflict with target object's method of the same name.
- replace interface ProxyObject by Proxy
- replace calls proxyObject.getHandler() by static ProxyFactory.getHandler(proxyObject).