Gradle build failure cannot find symbol "org.jcp.xml.dsig.internal.dom.XMLDSigRI"

I am using gradle to build my multi-module project. In one of my classes, I have the following code segment.

private XMLSignatureFactory factory = XMLSignatureFactory.getInstance(
            "DOM", new org.jcp.xml.dsig.internal.dom.XMLDSigRI());

      

But when I build this project using gradle, compilation fails with the following error message.

error: package org.jcp.xml.dsig.internal.dom does not exist
private XMLSignatureFactory factory = XMLSignatureFactory.getInstance("DOM", new org.jcp.xml.dsig.internal.dom.XMLDSigRI());

      

But I have already confirmed that the specified class belongs to the rt.jar JRE. I've tried with JDK 7 and 8.

What could be the root cause of the above problem?

Regards, Mayuran

+3


source to share


1 answer


I faced the same problem with you. And I solved it by adding below config in build-> maven-compiler-plugin.

<compilerArguments>
    <verbose />
    <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
</compilerArguments>

      



It seems that maven cannot find rt.jar in the higher jdk version (version 1.8 for me) so we need to configure explicitly.

Hope this helps you.

0


source







All Articles