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
发出异常的电话。
Person copy = (Person) SerializationUtils.clone(PersonHolder.getPerson(request));
PersonHolder.getPerson(request)
返回Person
Person
实施Serializable
request
是一个HttpServletRequest,它的数据传递给我尝试克隆Person
的方法。它包含getPerson
方法所需的数据。我不相信这与我的问题有任何关系,但我只想清楚它在做什么。commons-lang-2.4.jar
。org.apache.commons.lang.SerializationUtils
和Person
类。我在这里做错了什么想法?
答案 0 :(得分:1)
尝试导入 org.apache.commons.lang3.SerializationUtils。