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 "Brent Daniel (JIRA)" <ji...@apache.org> on 2010/05/04 07:20:55 UTC

[jira] Created: (WSCOMMONS-537) Cached NodeNamespaceContext causes problems when a new namespace is added

Cached NodeNamespaceContext  causes problems when a new namespace is added
--------------------------------------------------------------------------

                 Key: WSCOMMONS-537
                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-537
             Project: WS-Commons
          Issue Type: Bug
          Components: XmlSchema
    Affects Versions: XmlSchema 1.4.3
            Reporter: Brent Daniel


The NodeNamespaceContext caching added between 1.4.2 and 1.4.3 causes problems when dynamically adding a new namespace to an existing document. 

Calling XmlSchemaCollection.read() will cause the NodeNamespaceContext to be cached in the UserData for the document.

 If you then add a new namespace declaration to the document, the cached value will not be invalidated or updated. Adding an element that uses the new declaration in its type and calling XMLSchemaCollection.read() with the document as an argument will result in the following exception:

java.lang.IllegalStateException: The prefix tns is not bound.
	at org.apache.ws.commons.schema.SchemaBuilder.getRefQName(SchemaBuilder.java:593)
	at org.apache.ws.commons.schema.SchemaBuilder.getRefQName(SchemaBuilder.java:566)
	at org.apache.ws.commons.schema.SchemaBuilder.handleElement(SchemaBuilder.java:1406)
	at org.apache.ws.commons.schema.SchemaBuilder.handleSequence(SchemaBuilder.java:964)
	at org.apache.ws.commons.schema.SchemaBuilder.handleComplexType(SchemaBuilder.java:661)
	at org.apache.ws.commons.schema.SchemaBuilder.handleElement(SchemaBuilder.java:1433)
	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:210)
	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:121)
	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:509)
	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:493)



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (WSCOMMONS-537) Cached NodeNamespaceContext causes problems when a new namespace is added

Posted by "Brent Daniel (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Brent Daniel updated WSCOMMONS-537:
-----------------------------------

    Attachment: XSDTest.java
                test.xsd

See the attached test case

> Cached NodeNamespaceContext  causes problems when a new namespace is added
> --------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-537
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-537
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: XmlSchema
>    Affects Versions: XmlSchema 1.4.3
>            Reporter: Brent Daniel
>         Attachments: test.xsd, XSDTest.java
>
>
> The NodeNamespaceContext caching added between 1.4.2 and 1.4.3 causes problems when dynamically adding a new namespace to an existing document. 
> Calling XmlSchemaCollection.read() will cause the NodeNamespaceContext to be cached in the UserData for the document.
>  If you then add a new namespace declaration to the document, the cached value will not be invalidated or updated. Adding an element that uses the new declaration in its type and calling XMLSchemaCollection.read() with the document as an argument will result in the following exception:
> java.lang.IllegalStateException: The prefix tns is not bound.
> 	at org.apache.ws.commons.schema.SchemaBuilder.getRefQName(SchemaBuilder.java:593)
> 	at org.apache.ws.commons.schema.SchemaBuilder.getRefQName(SchemaBuilder.java:566)
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleElement(SchemaBuilder.java:1406)
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleSequence(SchemaBuilder.java:964)
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleComplexType(SchemaBuilder.java:661)
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleElement(SchemaBuilder.java:1433)
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:210)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:121)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:509)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:493)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (WSCOMMONS-537) Cached NodeNamespaceContext causes problems when a new namespace is added

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved WSCOMMONS-537.
-----------------------------------

         Assignee: Daniel Kulp
    Fix Version/s: XmlSchema 1.4.7
       Resolution: Fixed


Changed to not use the user data stuff at all.   When running on DOM level 3 (where the user data methods are), we don't need the NodeNamespaceContext things as we can use the lookupNamespaceURI and lookupPrefix methods on the Element itself.


> Cached NodeNamespaceContext  causes problems when a new namespace is added
> --------------------------------------------------------------------------
>
>                 Key: WSCOMMONS-537
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-537
>             Project: WS-Commons
>          Issue Type: Bug
>          Components: XmlSchema
>    Affects Versions: XmlSchema 1.4.3
>            Reporter: Brent Daniel
>            Assignee: Daniel Kulp
>             Fix For: XmlSchema 1.4.7
>
>         Attachments: test.xsd, XSDTest.java
>
>
> The NodeNamespaceContext caching added between 1.4.2 and 1.4.3 causes problems when dynamically adding a new namespace to an existing document. 
> Calling XmlSchemaCollection.read() will cause the NodeNamespaceContext to be cached in the UserData for the document.
>  If you then add a new namespace declaration to the document, the cached value will not be invalidated or updated. Adding an element that uses the new declaration in its type and calling XMLSchemaCollection.read() with the document as an argument will result in the following exception:
> java.lang.IllegalStateException: The prefix tns is not bound.
> 	at org.apache.ws.commons.schema.SchemaBuilder.getRefQName(SchemaBuilder.java:593)
> 	at org.apache.ws.commons.schema.SchemaBuilder.getRefQName(SchemaBuilder.java:566)
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleElement(SchemaBuilder.java:1406)
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleSequence(SchemaBuilder.java:964)
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleComplexType(SchemaBuilder.java:661)
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleElement(SchemaBuilder.java:1433)
> 	at org.apache.ws.commons.schema.SchemaBuilder.handleXmlSchemaElement(SchemaBuilder.java:210)
> 	at org.apache.ws.commons.schema.SchemaBuilder.build(SchemaBuilder.java:121)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:509)
> 	at org.apache.ws.commons.schema.XmlSchemaCollection.read(XmlSchemaCollection.java:493)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.