1

I tried to compile a Spring Boot project (Java 8 + Kotlin 1.5) using Gradle 6.8 and found the error below in Java class.

error: package sun.security.provider.certpath.ldap does not exist
import sun.security.provider.certpath.ldap.LDAPCertStoreHelper;
                                          ^

I found a solution to Maven project from: https://stackoverflow.com/a/43894257/13790777 by adding this config in pom.xml which is work.

<configuration>
     <fork>true</fork>
     <compilerArgument>-XDignore.symbol.file</compilerArgument>
</configuration>

But I when can't config something like this in build.gradle.kts (Gradle Project). So, I want to know the ways to solve this problem.

If you want to reproduce this problem, you can clone this project: https://github.com/ETDA/PDFSigningAndTimestamp and try to compile this project, and you will encounter the problem immediately.

Viibration
  • 13
  • 3

1 Answers1

0

I encountered the same problem and I discovered the following solutions.

  1. Download and install Java Development Kit 8 https://www.oracle.com/java/technologies/downloads/#java8-mac
  2. Open TestSignAndStamp.java https://github.com/ETDA/PDFSigningAndTimestamp/blob/master/src/sample/TestSignAndStamp.java
  3. Change the certificate file and comment the timestamp server (the existing one has expired).
/**** Sample Input ****/
String passwordP12 = "password";
String inputFileP12 = "cert_sign_01_new.p12"; // Change the certificate file; the existing one has expired.
String inputFileName = "pdfA3.pdf";
String outputFile = "tsa_signed.pdf";
String filePath = "resources/";
String tsaUrl = ""; // "https://time-test.teda.th"; // Comment the timestamp server; the existing one has expired.
String keystorePath = "KeystorePath";
String keystorePassword = "KeystorePassword";
String keystoreType = "PKCS12";


// String passwordP12 = args[0];
// String inputFileP12 = args[1];
// String inputFileName = args[2];
// String outputFile = args[3];
// String filePath = args[4];
// String tsaUrl = args[5];
// String keystorePath = args[6];
// String keystorePassword = args[7];
// String keystoreType = args[8];
  1. Run TestSignAndStamp.java