下面是一段试图将XSD转换为Java的Ant代码:
<target name="PayAPI">
<echo>Converting Comman API xsd to Java....</echo>
<taskdef name="xjc" classname="com.sun.tools.xjc.XJCTask">
<classpath>
<fileset dir="{externalLib}" includes="*.jar" excludes="ant.jar" />
</classpath>
</taskdef>
<xjc schema="${dataDir}/xsd/CommonPrefs.xsd" target="src/java/gds"
package="com.eos.gds.webservice.CommonPrefs" extension="true" />
</target>
发生以下错误:
build.xml:1042: java.lang.StackOverflowError
at java.io.ObjectStreamClass$WeakClassKey.<init>(ObjectStreamClass.java:2307)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:322)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1134)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
.........
在堆栈跟踪中重复出现相同的方法帧。