You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "John Kaputin (JIRA)" <ji...@apache.org> on 2006/02/02 13:55:03 UTC
[jira] Created: (WSCOMMONS-2) IllegalArgumentException because null
is passed as the localPart arg to QName ctor
IllegalArgumentException because null is passed as the localPart arg to QName ctor
----------------------------------------------------------------------------------
Key: WSCOMMONS-2
URL: http://issues.apache.org/jira/browse/WSCOMMONS-2
Project: WS-Commons
Type: Bug
Components: XmlSchema
Environment: Windows XP, JRE 1.42
Reporter: John Kaputin
The testcase has a global element declaration containing a local (un-named) simple type definition. When XmlSchema attempts to parse the <simpleType> it passes a null reference for the 'localPart' to the QName ctor, resulting in an IllegalArgumentException.
Here is the testcase:
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://finance.example.com/CreditCardFaults/xsd"
xmlns:tns="http://finance.example.com/CreditCardFaults/xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.w3.org/2001/XMLSchema
http://www.w3.org/2001/XMLSchema.xsd">
<element name="tns:CreditCardNumber" type="string"></element>
<element name="tns:CreditCardType">
<simpleType>
<restriction base="string">
<enumeration value="AMEX" />
<enumeration value="MASTERCARD" />
<enumeration value="VISA" />
</restriction>
</simpleType>
</element>
</schema>
Here is the stack trace:
Exception in thread "main" java.lang.IllegalArgumentException: localpart cannot be null.
at javax.xml.namespace.QName.<init>(QName.java:128)
at javax.xml.namespace.QName.<init>(QName.java:102)
at org.apache.ws.commons.schema.XmlSchemaType.getQName(XmlSchemaType.java:91)
at org.apache.ws.commons.schema.SchemaBuilder.handleElement(SchemaBuilder.java:1496)
at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:107)
at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:233)
at jktest.XmlSchemaTest.main(XmlSchemaTest.java:31)
--
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
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
[jira] Resolved: (WSCOMMONS-2) IllegalArgumentException because
null is passed as the localPart arg to QName ctor
Posted by "Davanum Srinivas (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/WSCOMMONS-2?page=all ]
Davanum Srinivas resolved WSCOMMONS-2:
--------------------------------------
Resolution: Fixed
Checked in a fix and test case.
> IllegalArgumentException because null is passed as the localPart arg to QName ctor
> ----------------------------------------------------------------------------------
>
> Key: WSCOMMONS-2
> URL: http://issues.apache.org/jira/browse/WSCOMMONS-2
> Project: WS-Commons
> Type: Bug
> Components: XmlSchema
> Environment: Windows XP, JRE 1.42
> Reporter: John Kaputin
>
> The testcase has a global element declaration containing a local (un-named) simple type definition. When XmlSchema attempts to parse the <simpleType> it passes a null reference for the 'localPart' to the QName ctor, resulting in an IllegalArgumentException.
> Here is the testcase:
> <?xml version="1.0" encoding="UTF-8"?>
> <schema xmlns="http://www.w3.org/2001/XMLSchema"
> targetNamespace="http://finance.example.com/CreditCardFaults/xsd"
> xmlns:tns="http://finance.example.com/CreditCardFaults/xsd"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="http://www.w3.org/2001/XMLSchema
> http://www.w3.org/2001/XMLSchema.xsd">
> <element name="tns:CreditCardNumber" type="string"></element>
> <element name="tns:CreditCardType">
> <simpleType>
> <restriction base="string">
> <enumeration value="AMEX" />
> <enumeration value="MASTERCARD" />
> <enumeration value="VISA" />
> </restriction>
> </simpleType>
> </element>
> </schema>
> Here is the stack trace:
> Exception in thread "main" java.lang.IllegalArgumentException: localpart cannot be null.
> at javax.xml.namespace.QName.<init>(QName.java:128)
> at javax.xml.namespace.QName.<init>(QName.java:102)
> at org.apache.ws.commons.schema.XmlSchemaType.getQName(XmlSchemaType.java:91)
> at org.apache.ws.commons.schema.SchemaBuilder.handleElement(SchemaBuilder.java:1496)
> at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:107)
> at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:233)
> at jktest.XmlSchemaTest.main(XmlSchemaTest.java:31)
--
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
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira