Problems with large maxOccurs attribute in XML TCK tests

Barnes, Richard Richard.Barnes at stratus.com
Thu Feb 3 11:59:40 PST 2011


We have recently successfully ported OpenJDK6 b12 to our proprietary
OpenVOS operating systems, and are now running the TCK tests against our
implementation.  When running tests such as
xml_schema/msData/modelGroups/jaxb/mgG014.html#mgG014 in
JCK-devtools-6b, we get the following error:

[ERROR] Current configuration of the parser doesn't allow a maxOccurs
attribute value to be set greater than the value 5,000.

We have tried ways of getting around this, such as trying Andrew Haley's
fix documented at
http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2008-October/00370
3.html or another fix we found in a build of OpenJDK7, and we get the
following warning before getting successful compilation of the schemas:

[WARNING] Unable to check the correctness of the schema due to
OutOfMemoryError. This typically happens when your schema contains
constructs like maxOccurs="999". In the future compilation, add the -nv
option to skip the correctness check for faster compilation.
unknown location

We have tried adding the "-nv" option, but when we do that, other tests
that are expected to fail, suddenly pass, so we think that doing that
would not be correct.

We recognize that the above warning comes from the fact that
SchemaConstraintChecker.java actually builds the nodes that represent
the schema, and with a large maxOccurs attribute, this uses up tons of
space.

So far, we have found versions of Xerces after Version 2.9.1 that deal
with this problem, but the changes to put this in to our current
implementation are quite large.

Has anybody else run into this problem and found a good solution?

Thanks,

Richard Barnes
Senior Technical Consultant
Stratus Technologies
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/porters-dev/attachments/20110203/8e0bafca/attachment.html 


More information about the porters-dev mailing list