Home  >  Forum  >  Core Java
Post New Query

Caused by: java.lang.ClassNotFoundException: org.bouncycastle.asn1.ASN1Primitive


joined on
April 01,2014
Asked on February 06,2015
I need to resolve below error in my core java application with iText for PDF encryption.

Caused by: java.lang.ClassNotFoundException: org.bouncycastle.asn1.ASN1Primitive
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 3 more
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
joined on
August 11,2014
Replied on February 07,2015

Add JAR for iText to add PDF password security.
itextpdf:5.5.4
bcprov-jdk15on:1.51
bcpkix-jdk15on:1.51

If using gradle, add dependency as below.
dependencies {
    compile 'com.itextpdf:itextpdf:5.5.4'
    compile 'org.bouncycastle:bcprov-jdk15on:1.51'
    compile 'org.bouncycastle:bcpkix-jdk15on:1.51'
}

Write Answer








Copyright ©2017 concretepage.com, all rights reserved |Privacy Policy | Contact Us