org.apache.commons.lang.SerializationException: java.lang.ClassNotFoundException: com.anonymized.bean.Person
at org.apache.commons.lang.SerializationUtils.deserialize(SerializationUtils.java:166)
at org.apache.commons.lang.SerializationUtils.deserialize(SerializationUtils.java:193)
at org.apache.commons.lang.SerializationUtils.clone(SerializationUtils.java:81)
at com.anonymized.CallingClass.handleRequestInternal(CallingClass.java:45)
at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
Truncated. see log file for complete stacktrace
Caused By: java.lang.ClassNotFoundException: com.anonymized.bean.Person
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
Truncated. see log file for complete stacktrace
The call that's throwing the exception.
Person copy = (Person) SerializationUtils.clone(PersonHolder.getPerson(request));
PersonHolder.getPerson(request) DOES return a PersonPerson implements Serializablerequest is an HttpServletRequest which has data that is being passed to the method in which I try to clone the Person. It contains data that the getPerson method needs. I don't believe this has anything to do with my problem but I just wanted to be clear what it was doing.commons-lang-2.4.jar is included in my project.org.apache.commons.lang.SerializationUtils and the Person class.Any ideas what I may be doing wrong here?
try importing org.apache.commons.lang3.SerializationUtils.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With