Reputation: 15
I am trying to deserialize an object, using simple code
ObjectInputStream ois = new ObjectInputStream(inputStream);
Object sss = ois.readObject();
ois.readObject is throwing classNotFound Exception, even i have all the classes
when i dig further , i found that the deserilizer is looking for a class like
com.xy.services.bank.trans.bean.SampleBean$$EnhancerBySpringCGLIB$$ee37d1aa
I have SampleBean in my project, but why the JVM is enahancing the bean, i am not able to figure out
can anyone give the clue what may be happening
Thank you
Upvotes: 1
Views: 199
Reputation: 643
If you serialized anything that was Injected by Spring, you have to understand that Spring actually injects Proxies, not the real object which is what you are seeing there.
On a related note, not sure what you are trying to do, but I would stay clear of serialized objects unless absolutely necessary.
Upvotes: 2