| From | Sent On | Attachments |
|---|---|---|
| Mario Jukic (ZG/ETK) | Jul 7, 2004 12:15 am | |
| Farrukh Najmi | Jul 7, 2004 5:54 am | |
| Mario Jukic (ZG/ETK) | Jul 7, 2004 7:17 am | |
| Farrukh Najmi | Jul 7, 2004 8:46 am | |
| ramesh mandava | Jul 8, 2004 10:57 am | .properties |
| Subject: | Re: XMLDSig in JWSDP1.4 | |
|---|---|---|
| From: | Farrukh Najmi (Farr...@Sun.COM) | |
| Date: | Jul 7, 2004 8:46:08 am | |
| List: | net.java.dev.jwsdp.users | |
Mario Jukic (ZG/ETK) wrote:
Hello,
Thanks for your answer. I made sure that I am using the right jars. But it still doesn't work. It seems to me that it is still the problem with the jars somewhere. Here is the full trace.
javax.xml.crypto.NoSuchMechanismException: Cannot find DOM mechanism type at
javax.xml.crypto.dsig.XMLSignatureFactory.findInstance(XMLSignatureFactory.java:190)
at
javax.xml.crypto.dsig.XMLSignatureFactory.getInstance(XMLSignatureFactory.java:226)
at drugi.GenDetached1.main(GenDetached1.java:83) Caused by:
java.lang.reflect.InvocationTargetException at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
From: http://java.sun.com/j2se/1.4.2/docs/api/java/lang/reflect/InvocationTargetException.html
" InvocationTargetException is a checked exception that wraps an exception thrown by an invoked method or constructor."
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324) at
javax.xml.crypto.dsig.XMLSignatureFactory.findInstance(XMLSignatureFactory.java:184)
... 2 more Caused by: java.lang.NoClassDefFoundError:
org/apache/commons/logging/LogFactory at
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Above class is defined by the <jwsdp-1.4>/jwsdp-shared/lib/commons-logging.jar.
Please make sure that is in your classpath and teh problem will go away. Good luck.
org.jcp.xml.dsig.internal.dom.DOMXMLSignatureFactory.<clinit>(DOMXMLSignatureFactory.java:32)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Nativ!
e Method) at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274) at
java.lang.Class.newInstance0(Class.java:308) at
java.lang.Class.newInstance(Class.java:261) at
javax.xml.crypto.dsig.XMLDSigSecurity.doGetImpl(XMLDSigSecurity.java:170) at
javax.xml.crypto.dsig.XMLDSigSecurity.getImpl(XMLDSigSecurity.java:133) ... 7
more Exception in thread "main"
BTW: I tried to break the code even before and even got the provide properties
to make sure that the provider is right.
King regards,
Mario Jukic
-----Original Message----- From: Farrukh Najmi [mailto:Farr...@Sun.COM] Sent: Wednesday, July 07, 2004 2:55 PM To: use...@jwsdp.dev.java.net Subject: Re: XMLDSig in JWSDP1.4
Mario Jukic (ZG/ETK) wrote:
Hello,
I tried to use the XMLDsig API in the JWSDP1.4. Of course starting by trying to use the provided samples, particulary GenDetached. However, on the very second line the sample throws exception. The problem appears when trying to instatiate the object XMLSignatureFactory. It throws exception NoSuchMechanismException with the description: "Cannot find DOM mechanism type".
The exeption is in the second line of the code:
String providerName = System.getProperty ("jsr105Provider", "org.jcp.xml.dsig.internal.dom.XMLDSigRI"); XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM", (Provider) Class.forName(providerName).newInstance());
Any suggestions?
I am no expert on this. Much of Sun is in a shutdown this week and I will try and help since I have recently been migrating from Apache XML Security to XMLDSIG (It has been going very well).
Can you include the full stack trace? I have had no problems with above boiler plate initialization code. You may also want to break down the above code to debug what is going on better.
String providerName = System.getProperty ("jsr105Provider", "org.jcp.xml.dsig.internal.dom.XMLDSigRI"); Provider provider = (Provider) Class.forName(providerName).newInstance(); XMLSignatureFactory fac = XMLSignatureFactory.getInstance("DOM", provider);
I suspect a classpath problem where you may be picking up standard Apache jars (e.g. xercesImpl.jar) instead of the JWSDP 1.4 versions of those jars. In my app I made sure that I removed all jars that are under the jwsdp.home/jaxp/...
Good luck.
-- Regards, Farrukh






.properties