【发布时间】:2013-04-04 05:13:56
【问题描述】:
您好,我看到了针对 Google App Engine 的 XStream 实现,但是我仍然得到了一个
“无法构造 [class],因为它没有无参数构造函数”
@Test
public void testNoNoArgs() {
Car car = new Car(1, "Blue");
XStream xstream = new XStreamGae();
String s = xstream.toXML(car);
Car c = (Car) xstream.fromXML(s);
}
完整的堆栈跟踪在这里:http://pastebin.com/TGF6N17W
我的应用程序中与 XStream 相关的依赖项是:
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.2</version>
</dependency>
<dependency>
<groupId>xpp3</groupId>
<artifactId>xpp3_min</artifactId>
<version>1.1.4c</version>
</dependency>
<!-- XStreamGae Dependencies -->
<dependency>
<groupId>net.sf.kxml</groupId>
<artifactId>kxml2-min</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>xmlpull</groupId>
<artifactId>xmlpull</artifactId>
<version>1.1.3.1</version>
</dependency>
XStreamGae 类可以在这里找到:
http://www.wappworks.com/2011/11/11/using-xstream-with-google-app-engine/
是否有一种变通方法可以使这种变通方法起作用?
【问题讨论】:
-
顺便说一句,我使用的 App Engine 版本是 SDK 版本 1.7.5
标签: java google-app-engine xstream