You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by xm...@xml.apache.org on 2004/08/31 11:31:21 UTC

[jira] Created: (XMLBEANS-52) Validator loops when schema has certain conditions

Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XMLBEANS-52

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XMLBEANS-52
    Summary: Validator loops when schema has certain conditions
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: XMLBeans
 Components: 
             Validator
             XmlObject
   Versions:
             unspecified

   Assignee: 
   Reporter: Claus Elkjaer

    Created: Tue, 31 Aug 2004 2:22 AM
    Updated: Tue, 31 Aug 2004 2:22 AM
Environment: Windows XP, Windows 2000, but i think it is in all OS.

Description:
When the following schema is used to generate XmlBeans, and a valid file is validated using the XmlObject.validate(), then it loops. After 2 to 10 minuts it returns. I claims 100% cpu usage while it loops.

Here are the schema:
<?xml version="1.0"?>
<xsd:schema targetNamespace="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd" xmlns:tns="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<!-- this schema is valid, but the XmlBeans validation can't handle an unbounded collection of unbounded elements. -->
	<xsd:element name="aList" type="tns:MyList"/>
	<xsd:complexType name="MyList">
		<xsd:sequence maxOccurs="unbounded">
			<xsd:element name="myListEntry" type="tns:ListEntry"  minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="ListEntry">
		<xsd:sequence>
			<xsd:element name="HelloWorld" type="xsd:string" minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
</xsd:schema>

and here is a simple xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSPY v5 rel. 4 U (http://www.xmlspy.com)-->
<aList xmlns="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd
C:\pfa\techr3\TransformationWorkbench\schema\errorInXmlBeansValidation.xsd">
	<myListEntry>
		<HelloWorld>Hello World</HelloWorld>
	</myListEntry>
</aList>

I can send you a working java project, which shows the bug.
Best Regards 
Claus Elkjær


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (XMLBEANS-52) Validator loops when schema has certain conditions

Posted by "Fernando Dobladez (JIRA)" <xm...@xml.apache.org>.
     [ http://nagoya.apache.org/jira/browse/XMLBEANS-52?page=comments#action_54941 ]
     
Fernando Dobladez commented on XMLBEANS-52:
-------------------------------------------

We are experiencing the same problem here.

For some XMLs, the validate() method never returns (or takes way too long, minutes) and was consumming all the CPU.

As the bug reporter suggested, we removed the "unbounded collection of unbounded elements" that we were using, and the problem disappeared.

We are using the binary distribution of 1.0.3.


> Validator loops when schema has certain conditions
> --------------------------------------------------
>
>          Key: XMLBEANS-52
>          URL: http://nagoya.apache.org/jira/browse/XMLBEANS-52
>      Project: XMLBeans
>         Type: Bug
>   Components: Validator, XmlObject
>     Versions: unspecified
>  Environment: Windows XP, Windows 2000, but i think it is in all OS.
>     Reporter: Claus Elkjaer
>     Assignee: Cezar Andrei
>  Attachments: xmlBeansValidatorError.zip
>
> When the following schema is used to generate XmlBeans, and a valid file is validated using the XmlObject.validate(), then it loops. After 2 to 10 minuts it returns. I claims 100% cpu usage while it loops.
> Here are the schema:
> <?xml version="1.0"?>
> <xsd:schema targetNamespace="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd" xmlns:tns="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
> 	<!-- this schema is valid, but the XmlBeans validation can't handle an unbounded collection of unbounded elements. -->
> 	<xsd:element name="aList" type="tns:MyList"/>
> 	<xsd:complexType name="MyList">
> 		<xsd:sequence maxOccurs="unbounded">
> 			<xsd:element name="myListEntry" type="tns:ListEntry"  minOccurs="0"/>
> 		</xsd:sequence>
> 	</xsd:complexType>
> 	<xsd:complexType name="ListEntry">
> 		<xsd:sequence>
> 			<xsd:element name="HelloWorld" type="xsd:string" minOccurs="0"/>
> 		</xsd:sequence>
> 	</xsd:complexType>
> </xsd:schema>
> and here is a simple xml file:
> <?xml version="1.0" encoding="UTF-8"?>
> <!--Sample XML file generated by XMLSPY v5 rel. 4 U (http://www.xmlspy.com)-->
> <aList xmlns="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd
> C:\pfa\techr3\TransformationWorkbench\schema\errorInXmlBeansValidation.xsd">
> 	<myListEntry>
> 		<HelloWorld>Hello World</HelloWorld>
> 	</myListEntry>
> </aList>
> I can send you a working java project, which shows the bug.
> Best Regards 
> Claus Elkjær

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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


[jira] Resolved: (XMLBEANS-52) Validator loops when schema has certain conditions

Posted by "Cezar Andrei (JIRA)" <xm...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XMLBEANS-52?page=history ]
     
Cezar Andrei resolved XMLBEANS-52:
----------------------------------

    Resolution: Won't Fix

On my box this takes 16 miliseconds, I think this is acceptable. Indeed there is a big loop there because of the NFA, and most probably this big loop would get optimized if DFA would be used in running the validating state machine, but the automaton can get exponentialy bigger.

> Validator loops when schema has certain conditions
> --------------------------------------------------
>
>          Key: XMLBEANS-52
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-52
>      Project: XMLBeans
>         Type: Bug
>   Components: Validator, XmlObject
>     Versions: unspecified
>  Environment: Windows XP, Windows 2000, but i think it is in all OS.
>     Reporter: Claus Elkjaer
>     Assignee: Cezar Andrei
>  Attachments: xmlBeansValidatorError.zip
>
> When the following schema is used to generate XmlBeans, and a valid file is validated using the XmlObject.validate(), then it loops. After 2 to 10 minuts it returns. I claims 100% cpu usage while it loops.
> Here are the schema:
> <?xml version="1.0"?>
> <xsd:schema targetNamespace="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd" xmlns:tns="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
> 	<!-- this schema is valid, but the XmlBeans validation can't handle an unbounded collection of unbounded elements. -->
> 	<xsd:element name="aList" type="tns:MyList"/>
> 	<xsd:complexType name="MyList">
> 		<xsd:sequence maxOccurs="unbounded">
> 			<xsd:element name="myListEntry" type="tns:ListEntry"  minOccurs="0"/>
> 		</xsd:sequence>
> 	</xsd:complexType>
> 	<xsd:complexType name="ListEntry">
> 		<xsd:sequence>
> 			<xsd:element name="HelloWorld" type="xsd:string" minOccurs="0"/>
> 		</xsd:sequence>
> 	</xsd:complexType>
> </xsd:schema>
> and here is a simple xml file:
> <?xml version="1.0" encoding="UTF-8"?>
> <!--Sample XML file generated by XMLSPY v5 rel. 4 U (http://www.xmlspy.com)-->
> <aList xmlns="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd
> C:\pfa\techr3\TransformationWorkbench\schema\errorInXmlBeansValidation.xsd">
> 	<myListEntry>
> 		<HelloWorld>Hello World</HelloWorld>
> 	</myListEntry>
> </aList>
> I can send you a working java project, which shows the bug.
> Best Regards 
> Claus Elkjær

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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


[jira] Assigned: (XMLBEANS-52) Validator loops when schema has certain conditions

Posted by xm...@xml.apache.org.
Message:

   The following issue has been re-assigned.

   Assignee: Cezar Andrei (mailto:cezar@apache.org)
---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XMLBEANS-52

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XMLBEANS-52
    Summary: Validator loops when schema has certain conditions
       Type: Bug

     Status: Open
   Priority: Major

    Project: XMLBeans
 Components: 
             Validator
             XmlObject
   Versions:
             unspecified

   Assignee: Cezar Andrei
   Reporter: Claus Elkjaer

    Created: Tue, 31 Aug 2004 2:22 AM
    Updated: Tue, 31 Aug 2004 11:42 AM
Environment: Windows XP, Windows 2000, but i think it is in all OS.

Description:
When the following schema is used to generate XmlBeans, and a valid file is validated using the XmlObject.validate(), then it loops. After 2 to 10 minuts it returns. I claims 100% cpu usage while it loops.

Here are the schema:
<?xml version="1.0"?>
<xsd:schema targetNamespace="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd" xmlns:tns="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<!-- this schema is valid, but the XmlBeans validation can't handle an unbounded collection of unbounded elements. -->
	<xsd:element name="aList" type="tns:MyList"/>
	<xsd:complexType name="MyList">
		<xsd:sequence maxOccurs="unbounded">
			<xsd:element name="myListEntry" type="tns:ListEntry"  minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="ListEntry">
		<xsd:sequence>
			<xsd:element name="HelloWorld" type="xsd:string" minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
</xsd:schema>

and here is a simple xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSPY v5 rel. 4 U (http://www.xmlspy.com)-->
<aList xmlns="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd
C:\pfa\techr3\TransformationWorkbench\schema\errorInXmlBeansValidation.xsd">
	<myListEntry>
		<HelloWorld>Hello World</HelloWorld>
	</myListEntry>
</aList>

I can send you a working java project, which shows the bug.
Best Regards 
Claus Elkjær


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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


[jira] Commented: (XMLBEANS-52) Validator loops when schema has certain conditions

Posted by "Fernando Dobladez (JIRA)" <xm...@xml.apache.org>.
     [ http://nagoya.apache.org/jira/browse/XMLBEANS-52?page=comments#action_54942 ]
     
Fernando Dobladez commented on XMLBEANS-52:
-------------------------------------------

I tried the attached example, and took about 7 minutes. Here's the output:

C:\tmp\xmlBeansError>java -classpath .\lib\xbean.jar;.\bin;mySchemaBeans.jar dk.pfa.xmlbeans.error.ShowXmlBeanError
Now we start opening inputfile: ./testXmlBeansError.xml
Input file open. Begin to validate file. It will take a couple of minuts
File parsed in 330 milliseconds. Begin to parse file.
File validated in 396320 milliseconds.
Finished.


> Validator loops when schema has certain conditions
> --------------------------------------------------
>
>          Key: XMLBEANS-52
>          URL: http://nagoya.apache.org/jira/browse/XMLBEANS-52
>      Project: XMLBeans
>         Type: Bug
>   Components: Validator, XmlObject
>     Versions: unspecified
>  Environment: Windows XP, Windows 2000, but i think it is in all OS.
>     Reporter: Claus Elkjaer
>     Assignee: Cezar Andrei
>  Attachments: xmlBeansValidatorError.zip
>
> When the following schema is used to generate XmlBeans, and a valid file is validated using the XmlObject.validate(), then it loops. After 2 to 10 minuts it returns. I claims 100% cpu usage while it loops.
> Here are the schema:
> <?xml version="1.0"?>
> <xsd:schema targetNamespace="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd" xmlns:tns="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
> 	<!-- this schema is valid, but the XmlBeans validation can't handle an unbounded collection of unbounded elements. -->
> 	<xsd:element name="aList" type="tns:MyList"/>
> 	<xsd:complexType name="MyList">
> 		<xsd:sequence maxOccurs="unbounded">
> 			<xsd:element name="myListEntry" type="tns:ListEntry"  minOccurs="0"/>
> 		</xsd:sequence>
> 	</xsd:complexType>
> 	<xsd:complexType name="ListEntry">
> 		<xsd:sequence>
> 			<xsd:element name="HelloWorld" type="xsd:string" minOccurs="0"/>
> 		</xsd:sequence>
> 	</xsd:complexType>
> </xsd:schema>
> and here is a simple xml file:
> <?xml version="1.0" encoding="UTF-8"?>
> <!--Sample XML file generated by XMLSPY v5 rel. 4 U (http://www.xmlspy.com)-->
> <aList xmlns="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd
> C:\pfa\techr3\TransformationWorkbench\schema\errorInXmlBeansValidation.xsd">
> 	<myListEntry>
> 		<HelloWorld>Hello World</HelloWorld>
> 	</myListEntry>
> </aList>
> I can send you a working java project, which shows the bug.
> Best Regards 
> Claus Elkjær

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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


[jira] Updated: (XMLBEANS-52) Validator loops when schema has certain conditions

Posted by xm...@xml.apache.org.
The following issue has been updated:

    Updater: Claus Elkjaer (mailto:clausAPACHE@elkjaer-consult.dk)
       Date: Tue, 31 Aug 2004 2:26 AM
    Comment:
Here is an example which shows the bug.
    Changes:
             Attachment changed to xmlBeansValidatorError.zip
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://issues.apache.org/jira/browse/XMLBEANS-52?page=history

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XMLBEANS-52

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XMLBEANS-52
    Summary: Validator loops when schema has certain conditions
       Type: Bug

     Status: Unassigned
   Priority: Major

    Project: XMLBeans
 Components: 
             Validator
             XmlObject
   Versions:
             unspecified

   Assignee: 
   Reporter: Claus Elkjaer

    Created: Tue, 31 Aug 2004 2:22 AM
    Updated: Tue, 31 Aug 2004 2:26 AM
Environment: Windows XP, Windows 2000, but i think it is in all OS.

Description:
When the following schema is used to generate XmlBeans, and a valid file is validated using the XmlObject.validate(), then it loops. After 2 to 10 minuts it returns. I claims 100% cpu usage while it loops.

Here are the schema:
<?xml version="1.0"?>
<xsd:schema targetNamespace="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd" xmlns:tns="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<!-- this schema is valid, but the XmlBeans validation can't handle an unbounded collection of unbounded elements. -->
	<xsd:element name="aList" type="tns:MyList"/>
	<xsd:complexType name="MyList">
		<xsd:sequence maxOccurs="unbounded">
			<xsd:element name="myListEntry" type="tns:ListEntry"  minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
	<xsd:complexType name="ListEntry">
		<xsd:sequence>
			<xsd:element name="HelloWorld" type="xsd:string" minOccurs="0"/>
		</xsd:sequence>
	</xsd:complexType>
</xsd:schema>

and here is a simple xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSPY v5 rel. 4 U (http://www.xmlspy.com)-->
<aList xmlns="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://pfa.dk/dummy/errorInXmlBeansValidation.xsd
C:\pfa\techr3\TransformationWorkbench\schema\errorInXmlBeansValidation.xsd">
	<myListEntry>
		<HelloWorld>Hello World</HelloWorld>
	</myListEntry>
</aList>

I can send you a working java project, which shows the bug.
Best Regards 
Claus Elkjær


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


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