Skip to main content

XMLSignature Error. NoClassDefFoundError ..../UnsyncBufferedOutputStream

2 replies [Last post]
chirammfm
Offline
Joined: 2008-07-02

Im developing a WebService that conatains some Signed XML.

When i tried to sign those xml, i got this erro:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
java.lang.NoClassDefFoundError: com/sun/org/apache/xml/internal/security/utils/UnsyncBufferedOutputStream
at org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory.newReference(Unknown Source)
at org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory.newReference(Unknown Source)
at net.gencat.medcat.ws.client.trataXML.firmar_Con_mi_Privada(trataXML.java:227)
at net.gencat.medcat.ws.client.UploadClient.main(UploadClient.java:77)
Exception in thread "main"
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

I follow this tutorial to create my code:
http://today.java.net/pub/a/today/2006/11/21/xml-signature-with-jsr-105....

Any help are apreciated.

Thank You!!

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
chirammfm
Offline
Joined: 2008-07-02

Hi,

I solved my problem.
To resolve it, i put a XMLObject well formed (it was my first error).
Other problem was a bug in xmlsec, in class DOMReference, when excute the DeReference step. To solve it, i made a new class called "MyURIDereferencer", and put it in DOM Context,

DOMSignContext dsc = new DOMSignContext(privateKey, node);
dsc.setURIDereferencer(new MyURIDereferencer());

MyURIDerefender made with http://weblogs.java.net/blog/mullan/archive/2006/06/supporting_addi.html

Hope this post helps

Thx!!

Message was edited by: chirammfm

wessammhd
Offline
Joined: 2009-06-29

i've the same exception when creating a new reference

but i do not understand hpw did you solve it I solved my problem.

To resolve it, i put a XMLObject well formed (it was my first error). ???

please can u explain more

my case that i want to sign a web service SOAP message