I tried to validate a small xml-file (931 bytes) against a set of xml schema files. The schema file, includes other schemas. The file size of all schemas (sum) is 324.330 bytes. If necessary, I can send them for reproduction of this error. 1.4.3 Xerces-J Running the sax.SAX2Count (from xercesSamples.jar) WinNT4.0, 256 MB RAM i got a StackOverflowError at org.apache.xerces.validators.common.Grammar.buildSyntaxTree(Grammar.java:856). The java option -Xss didn't help. I also reproduced this error on a Sun Ultra Sparc 400/Solaris 8, and PC/Win2k. On Sun/Solaris: java -Xss8192Kb -cp xercesSamples.jar:xerces.jar sax.SAX2Count -v xxx.xml resulted in a java.lang.OutOfMemoryError. pete
Hi Pete. Could you check whether there is a large "maxOccurs" value in your schema file(s)? It's a known limitation that Xerces1 schema can't handle large occurrence values. But in most cases, you can use maxOccurs="unbounded" instead. Thx.
The greatest maxOccurs value is 9999, the next biggest one is 999. I replaced both with maxOccurs="unbounded" as you suggested and it works. Thx. for your help. Pete
*** Bug 3901 has been marked as a duplicate of this bug. ***
This is a known limitation of Xerces1. We are trying to introduce some mechanism in Xerces2 to handle large maxOccurs values. In the meanwhile, specifying maxOccurs="unbounded" would meet most users' need.
*** Bug 4557 has been marked as a duplicate of this bug. ***
Re-opened to ensure that someone will eventually look at it - in Xerces-1 or Xerces-2.
*** Bug 3142 has been marked as a duplicate of this bug. ***