Hibernate version:
3
Full stack trace of any exception that occurs:
java.lang.InstantiationException: org.hibernate.proxy.CGLIBLazyInitializer
Continuing ...
java.lang.RuntimeException: failed to evaluate: <unbound>=CGLIBLazyInitializer.new();
Continuing ...
Name and version of the database you are using:
MySQL 4.0.23
Hi,
I am getting the aforementioned exception when attempting to serialize a POJO that contains a proxy object. A terrible hack around this is to re-construct the original object from the proxy object.
E.g
public void setClassX(ClassX classX) {
this.classX = new ClassX(classX.getName());
}
Is there a cleaner solution for this? Perhaps I need to do something to prevent this exception. It doesn't seem to be a proxy initialization issue as I've successfully accessed the object before serialization. Alternatively, is there a way to get the real object from a proxy object?
Any response will be very much appreciated.
Thanks
lkla
|