Reinf - Problems assigning content in the Reference URI tag

Asked

Viewed 103 times

2

Has anyone experienced this? Error assigning content in the signature tag: Signature -> Reference -> URI

When assigning content in the Reference URI Signature tag I am receiving a EXCEPTION, see below:

javax.xml.crypto.dsig.XMLSignatureException: javax.xml.crypto.URIReferenceException: com.sun.org.apache.xml.internal.security.utils.resolver.ResourceResolverException: Cannout resolve element with ID IDnnnnnnnnnn

In some literatures / forum, quote, I have done, the implementation of the code:

...
String id = el.getAttribute("id");  
el.setIdAttribute("id", true);  
... 
Reference ref = fac.newReference("#".concat(id), fac.newDigestMethod("http://www.w3.org/2001/04/xmlenc#sha256", null),transformList, null, null);  
...

The "id" is exactly like this in the input XML. The content of the ID in Reference is being generated correctly, but when you run the message below, I get this Exception. ( Cannout resolves element with ID Idnnnnnnnnnnnn )

signature.sign(dsc);
  • The message says "Cannout" or says "Cannot"?

  • Osvaldomenezes, take a look at this link and see if this is your case: https://bugs.java.com/bugdatabase/view_bug.do?bug_id=8017265

1 answer

0


In fact, in some literature I researched, Ruireferenceexception is updated the version of JAVA by ORACLE.

But the mistake in my case was that there were two DOCUMENT INSTANCES in the source. One of them (EX: DOC) was treating the ID and the other (EX> DOCS) was treating the SIGNATURE.

I deleted one of the instances by fixing the code and SOLVED.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.