Details
-
Type: Bug
-
Status: Closed
-
Resolution: Won't Fix
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
JDK version and platform:Sun 1.5.0_06 for Windows
Description
When using the folowing jsp with Tomcat 5.5.15 and Sun JDK 1.5.0_06 for windows, the inner class object can be serialised but on de-serialisation a CannotResolveClassException is thrown claiming it cannot locate the inner class.
JSP:
<%@ page import="com.thoughtworks.xstream.*" %>
<%!
public static class Example
{
String comments="Hello";
public Example(){}
}
%>
<%
XStream xstream = new XStream();
xstream.fromXML(xstream.toXML(new Example()));
%>
Stack Trace:
com.thoughtworks.xstream.alias.CannotResolveClassException: org.apache.jsp.test_jsp$Example : org.apache.jsp.test_jsp$Example
com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:35)
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
com.thoughtworks.xstream.mapper.XmlFriendlyMapper.realClass(XmlFriendlyMapper.java:44)
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:49)
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:46)
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:70)
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:18)
com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:27)
com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:95)
com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy.unmarshal(ReferenceByXPathMarshallingStrategy.java:12)
com.thoughtworks.xstream.XStream.unmarshal(XStream.java:552)
com.thoughtworks.xstream.XStream.unmarshal(XStream.java:540)
com.thoughtworks.xstream.XStream.fromXML(XStream.java:490)
com.thoughtworks.xstream.XStream.fromXML(XStream.java:483)
org.apache.jsp.test_jsp._jspService(org.apache.jsp.test_jsp:59)
P.S. Using XStream 1.1.3