title: javax.xml.crypto.URIReferenceException: Cannot resolve element with ID SAML-
body: <p>I am trying to parse SAML response with signature using Java.I get an exception </p>
  
  <pre><code>javax.xml.crypto.URIReferenceException:  
  com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException: Cannot 
  resolve element with ID SAML-
  </code></pre>
  
  <p>Upon investigation there is bug in Java after the 1.7 u25 versions.The reference is below</p>
  
  <p><a href="http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7094155" rel="nofollow">http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7094155</a>.</p>
  
  <p>Could anybody point me how to correct this error,as I am using AWS Beanstalk(which has support only for 1.7 u 25 and that too only Linux.)</p>
  
  <p>Here is the starting code for reading the SAML and parsing,actually i need to validate the SAML along with signature.</p>
  
  <pre><code>  ByteArrayInputStream bis = new ByteArrayInputStream(resp.getBytes());
      DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
      documentBuilderFactory.setNamespaceAware(true);
              DocumentBuilder docBuilder;
  
  
      try {
          docBuilder = documentBuilderFactory.newDocumentBuilder();      
          Document doc = docBuilder.parse(bis);
          Node nl = doc.getElementsByTagNameNS(XMLSignature.XMLNS,"Signature").item(0);
                     .....
  </code></pre>
  
  <p>any help would be appreciated.</p>