0

Below is a snippet of Ant code that attempts to convert XSD to Java:

<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>

The following error occurs:

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)
    .........

The same method frames occur repeatedly in the stack trace.

Chad Nouis
  • 6,861
  • 1
  • 27
  • 28
Mukesh Kumar
  • 333
  • 1
  • 5
  • 20
  • 1
    Possible duplicate of [What is a StackOverflowError?](http://stackoverflow.com/questions/214741/what-is-a-stackoverflowerror) – user1140237 Jan 26 '16 at 07:11
  • @user1140237: A generic explanation of what causes stack overflows may be helpful but is certainly not a duplicate. OP needs help determining the source of his particular problem here. – kjhughes Jan 26 '16 at 12:55
  • Please post a [mcve] that still exhibits the problem. I suspect that your XSD itself is invalid, but you have to present enough information for us to reproduce the problem (but please not so much that you push off the pruning process on us). Thanks. – kjhughes Jan 26 '16 at 12:58
  • @kjhughes Thanks, let me know whatelse you need ? i have posted complete process and tools which i'm using ..can i post whole xds file ? – Mukesh Kumar Jan 27 '16 at 05:56
  • It's generally better to prune down to the minimal example that still produces the problem, but posting the XML and XSD in whole is better than not posting it at all if you truly can't cut its size down. – kjhughes Jan 27 '16 at 12:10

0 Answers0