Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Quarkus 2.2.0] XmlSecurity itests fail in native mode #2977

Closed
jamesnetherton opened this issue Aug 3, 2021 · 2 comments
Closed

[Quarkus 2.2.0] XmlSecurity itests fail in native mode #2977

jamesnetherton opened this issue Aug 3, 2021 · 2 comments
Milestone

Comments

@jamesnetherton
Copy link
Contributor

Caused by: javax.xml.crypto.dsig.XMLSignatureException: javax.xml.crypto.dsig.TransformException: Couldn't find Transform for: http://www.w3.org/2000/09/xmldsig#enveloped-signature
	at org.jcp.xml.dsig.internal.dom.DOMReference.transform(DOMReference.java:551)
	at org.jcp.xml.dsig.internal.dom.DOMReference.digest(DOMReference.java:360)
	at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.digestReference(DOMXMLSignature.java:490)
	at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.sign(DOMXMLSignature.java:375)
	at org.apache.camel.component.xmlsecurity.processor.XmlSignerProcessor.sign(XmlSignerProcessor.java:304)
	... 48 more
Caused by: javax.xml.crypto.dsig.TransformException: Couldn't find Transform for: http://www.w3.org/2000/09/xmldsig#enveloped-signature
	at org.jcp.xml.dsig.internal.dom.ApacheTransform.transformIt(ApacheTransform.java:144)
	at org.jcp.xml.dsig.internal.dom.ApacheTransform.transform(ApacheTransform.java:112)
	at org.jcp.xml.dsig.internal.dom.DOMTransform.transform(DOMTransform.java:154)
	at org.jcp.xml.dsig.internal.dom.DOMReference.transform(DOMReference.java:455)
	... 52 more
Caused by: com.sun.org.apache.xml.internal.security.transforms.InvalidTransformException: Unknown transformation. No handler installed for URI http://www.w3.org/2000/09/xmldsig#enveloped-signature
Original Exception was java.lang.InstantiationException: Type `com.sun.org.apache.xml.internal.security.transforms.implementations.TransformEnvelopedSignature` can not be instantiated reflectively as it does not have a no-parameter constructor or the no-parameter constructor has not been added explicitly to the native image.
	at com.sun.org.apache.xml.internal.security.transforms.Transform.initializeTransform(Transform.java:355)
	at com.sun.org.apache.xml.internal.security.transforms.Transform.<init>(Transform.java:134)
	at org.jcp.xml.dsig.internal.dom.ApacheTransform.transformIt(ApacheTransform.java:137)
	... 55 more
Caused by: java.lang.InstantiationException: Type `com.sun.org.apache.xml.internal.security.transforms.implementations.TransformEnvelopedSignature` can not be instantiated reflectively as it does not have a no-parameter constructor or the no-parameter constructor has not been added explicitly to the native image.
	at java.lang.Class.newInstance(DynamicHub.java:911)
	at com.sun.org.apache.xml.internal.security.transforms.Transform.initializeTransform(Transform.java:351)
	... 57 more
@aldettinger
Copy link
Contributor

I think the root cause could be that ApacheXMLDSig security provider is no more present in the native image.

The release note for graalvm 21.2 mention something about Removed unnecessary security providers from the image.

@jamesnetherton
Copy link
Contributor Author

I think the root cause could be that ApacheXMLDSig security provider is no more present in the native image.

Yep, that was indeed the problem. Had to add a BuildStep for NativeImageSecurityProviderBuildItem and get that provider registered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants