Bug 3277 - StackOverflowError at org.apache.xerces.validators.common.Grammar.buildSyntaxTree(Grammar.java:856) or OutOfMemoryError building Syntax tree from large Schema-file(s)
Summary: StackOverflowError at org.apache.xerces.validators.common.Grammar.buildSyntax...
Status: REOPENED
Alias: None
Product: Xerces-J
Classification: Unclassified
Component: Schema-Structures (show other bugs)
Version: 1.4.3
Hardware: All All
: P3 normal
Target Milestone: ---
Assignee: Xerces-J Developers Mailing List
URL: http://http://
Keywords:
: 3142 3901 4557 (view as bug list)
Depends on:
Blocks:
 
Reported: 2001-08-27 04:22 UTC by schaefer
Modified: 2004-11-16 19:05 UTC (History)
5 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description schaefer 2001-08-27 04:22:12 UTC
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
Comment 1 sandygao 2001-09-04 05:37:53 UTC
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.
Comment 2 schaefer 2001-09-04 07:53:11 UTC
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
Comment 3 Henry Zongaro 2001-10-03 07:46:56 UTC
*** Bug 3901 has been marked as a duplicate of this bug. ***
Comment 4 sandygao 2001-10-30 13:19:13 UTC
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.
Comment 5 sandygao 2001-10-31 15:24:28 UTC
*** Bug 4557 has been marked as a duplicate of this bug. ***
Comment 6 Henry Zongaro 2001-11-01 08:00:35 UTC
Re-opened to ensure that someone will eventually look at it - in Xerces-1 or 
Xerces-2.
Comment 7 Henry Zongaro 2001-11-01 08:02:03 UTC
*** Bug 3142 has been marked as a duplicate of this bug. ***