You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org> on 2014/03/07 16:46:43 UTC

[jira] [Resolved] (XERCESJ-1580) Out of memory while validating an XML instance with a schema that contains particles with a large maxOccurs

     [ https://issues.apache.org/jira/browse/XERCESJ-1580?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Glavassevich resolved XERCESJ-1580.
-------------------------------------------

    Resolution: Duplicate

XERCESJ-1227 is already open for tracking this issue. Setting the javax.xml.XMLConstants.FEATURE_SECURE_PROCESSING on the SchemaFactory/Validator can be used to avoid the OutOfMemoryError. You'll get a different exception about hitting a limit on content model nodes but it won't be an OOM.

> Out of memory while validating an XML instance with a schema that contains particles with a large maxOccurs
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: XERCESJ-1580
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1580
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: XML Schema 1.1 Structures
>            Reporter: Octavian Nadolu
>            Priority: Critical
>
> I obtain an OutOfMemory exception when i validate the XML instance "test.xml" with the schema "test.xsd". 
> You can reproduce the issue on the xml-schema-1.1-dev branch, using the jaxp.SourceValidator as follows:
> jaxp.SourceValidator -xsd11 -a test.xsd -i test.xml
> Please note that this exception occurs only if the "full schema checking" feature is disabled.
> XML instance: test.xml
> <doc>
>  <a/>
>  <b/>
> </doc>
> Schema: test.xsd
> <xsd:schema xmlns:xsd='http://www.w3.org/2001/XMLSchema' >
>  <xsd:complexType name='fooType' > 
> 		<xsd:choice maxOccurs="100000">
>    			<xsd:sequence maxOccurs="100000000">
> 				     <xsd:element name='a' maxOccurs="unbounded"/>
> 			</xsd:sequence>
> 			<xsd:element name="b"/>
> 		</xsd:choice>
>   </xsd:complexType>
>   <xsd:element name="doc" type="fooType"/>
> </xsd:schema>



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org