ws-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Kulp (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (XMLSCHEMA-42) xmlschema-walker fails when an xs:attribute has no type attribute
Date Sun, 06 Nov 2016 14:18:59 GMT

    [ https://issues.apache.org/jira/browse/XMLSCHEMA-42?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15641862#comment-15641862
] 

Daniel Kulp commented on XMLSCHEMA-42:
--------------------------------------

No.   The walker is also used for serialization so we need to distinguish between when a user
specifically put in type="anyType"  and when the user didn't put a type in there at all. 


> xmlschema-walker fails when an xs:attribute has no type attribute
> -----------------------------------------------------------------
>
>                 Key: XMLSCHEMA-42
>                 URL: https://issues.apache.org/jira/browse/XMLSCHEMA-42
>             Project: XmlSchema
>          Issue Type: Bug
>    Affects Versions: 2.2.1
>            Reporter: Tobias Crawley
>         Attachments: XMLSCHEMA-42-with-test.patch
>
>
> When using xmlschema-walker against an XSD that has an attribute definition that lacks
a type, I get the following NPE:
> {noformat}
> Exception in thread "main" java.lang.NullPointerException
> 	at org.apache.ws.commons.schema.walker.XmlSchemaScope.getAttribute(XmlSchemaScope.java:569)
> 	at org.apache.ws.commons.schema.walker.XmlSchemaScope.createAttributeMap(XmlSchemaScope.java:629)
> 	at org.apache.ws.commons.schema.walker.XmlSchemaScope.walk(XmlSchemaScope.java:310)
> 	at org.apache.ws.commons.schema.walker.XmlSchemaScope.walk(XmlSchemaScope.java:151)
> 	at org.apache.ws.commons.schema.walker.XmlSchemaScope.<init>(XmlSchemaScope.java:91)
> 	at org.apache.ws.commons.schema.walker.XmlSchemaScope.getScope(XmlSchemaScope.java:696)
> 	at org.apache.ws.commons.schema.walker.XmlSchemaScope.walk(XmlSchemaScope.java:333)
> 	at org.apache.ws.commons.schema.walker.XmlSchemaScope.walk(XmlSchemaScope.java:306)
> 	at org.apache.ws.commons.schema.walker.XmlSchemaScope.walk(XmlSchemaScope.java:151)
> 	at org.apache.ws.commons.schema.walker.XmlSchemaScope.<init>(XmlSchemaScope.java:112)
> 	at org.apache.ws.commons.schema.walker.XmlSchemaWalker.walk(XmlSchemaWalker.java:224)
> 	at org.apache.ws.commons.schema.walker.XmlSchemaWalker.walk(XmlSchemaWalker.java:339)
> 	at org.apache.ws.commons.schema.walker.XmlSchemaWalker.walk(XmlSchemaWalker.java:486)
> 	at org.apache.ws.commons.schema.walker.XmlSchemaWalker.walk(XmlSchemaWalker.java:336)
> 	at org.apache.ws.commons.schema.walker.XmlSchemaWalker.walk(XmlSchemaWalker.java:295)
> 	at org.apache.ws.commons.schema.walker.XmlSchemaWalker.walk(XmlSchemaWalker.java:339)
> 	at org.apache.ws.commons.schema.walker.XmlSchemaWalker.walk(XmlSchemaWalker.java:486)
> 	at org.apache.ws.commons.schema.walker.XmlSchemaWalker.walk(XmlSchemaWalker.java:336)
> 	at org.apache.ws.commons.schema.walker.XmlSchemaWalker.walk(XmlSchemaWalker.java:295)
> {noformat}
> The XSD that triggered this was https://github.com/wildfly/wildfly-core/blob/master/server/src/main/resources/schema/wildfly-config_4_2.xsd#L2774
(that line specifically). 
> I have a patch to fix this that I'll attach shortly. It doesn't include any tests, because
most of the tests fail for me with a fresh checkout, so it's hard to confirm that any tests
I write are working. I have tested the fix manually.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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


Mime
View raw message