Setting the "balance-syntax-trees" feature [1] to true may also work, but
you need to be using the real Xerces to set it.

[1]
http://xerces.apache.org/xerces2-j/features.html#validation.balance-syntax-trees

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrgla...@ca.ibm.com
E-mail: mrgla...@apache.org

Chris Simmons <c...@corefiling.com> wrote on 08/04/2010 12:16:29 PM:

>   On 04/08/10 16:38, Thomas Maschutznig wrote:
> > Hi,
> >
> > I get a StackOverflowError when trying to parse a 50 lines, 3 nodes
> > deep XML file:
> >
> > java.lang.StackOverflowError
> >    at
> com.sun.org.apache.xerces.internal.impl.dtd.models.CMStateSet.<init>
> (CMStateSet.java:85)
> >    at
> com.sun.org.apache.xerces.internal.impl.dtd.models.CMNode.lastPos
> (CMNode.java:107)
> >    at
> com.sun.org.apache.xerces.internal.impl.dtd.models.CMBinOp.calcLastPos
> (CMBinOp.java:156)
> >    at
> com.sun.org.apache.xerces.internal.impl.dtd.models.CMNode.lastPos
> (CMNode.java:108)
> >
> > ... 200 more identical lines of lastPos() and calcLastPos() ...
> >
> >    at
> com.sun.org.apache.xerces.internal.impl.dtd.models.CMBinOp.calcLastPos
> (CMBinOp.java:156)
>
> As Michael points out, you're not using the real Xerces but I have seen
> the real-deal Xerces require relatively deep stacks too.  Either way you
> can up the stack depth of your application like this
>
> java -Xss1m ...
>
> Note stack size is separate from heap size.  I didn't look any further
> into it as upping the stack did the trick.
>
> Your favourite search engine will tell you more as ever.
>
> Chris Simmons.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: j-users-unsubscr...@xerces.apache.org
> For additional commands, e-mail: j-users-h...@xerces.apache.org

Reply via email to