You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by "Colm O hEigeartaigh (JIRA)" <ji...@apache.org> on 2015/09/09 11:42:45 UTC

[jira] [Commented] (SANTUARIO-427) org.w3c.dom.DOMException: NOT_FOUND_ERR: An attempt is made to reference a node in a context where it does not exist. at com.sun.org.apache.xerces.internal.dom.ElementImpl.setIdAttribute(Unknown Source)

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

Colm O hEigeartaigh commented on SANTUARIO-427:
-----------------------------------------------

It's hard to tell what the problem is without seeing more of your code. One thing you are not doing correctly though is you are not using the namespace version of the setIdAttribute method - you should be using setIdAttributeNS here instead.

Colm.

> org.w3c.dom.DOMException: NOT_FOUND_ERR: An attempt is made to reference a node in a context where it does not exist. 	at com.sun.org.apache.xerces.internal.dom.ElementImpl.setIdAttribute(Unknown Source)
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SANTUARIO-427
>                 URL: https://issues.apache.org/jira/browse/SANTUARIO-427
>             Project: Santuario
>          Issue Type: Bug
>          Components: Java
>         Environment: JDK 1.8, xmlsec-2.x.jar
>            Reporter: sangeeta
>            Assignee: Colm O hEigeartaigh
>
> Hi,
> I am calling a Webservice security API using openssoclientsdk.jar. and facing below error. Code is not working even if "Id" attribute is set after checking namespace.
> Error
> -------------
> org.w3c.dom.DOMException: NOT_FOUND_ERR: An attempt is made to reference a node in a context where it does not exist.
> 	at com.sun.org.apache.xerces.internal.dom.ElementImpl.setIdAttribute(Unknown Source)
> -----------------
> Code
> -----------------
>  if ((wsuNodes != null) && (wsuNodes.getLength() != 0)) {
>         for (int i = 0; i < wsuNodes.getLength(); ++i) {
>           Element elem = (Element)wsuNodes.item(i);
>           String id = elem.getAttributeNS("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", "Id");
>           if ((id != null) && (id.length() != 0)) {
>             elem.setIdAttribute(id, true);
>           }
>         }
>       }
> ---------------------------------------------------------------



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