java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider

Apache's JIRA Issue Tracker | Vladimir | 6 years ago
  1. 0

    All pdf files works fine. Except this one "http://www.rim.com/investors/documents/pdf/pressrelease/2011/Q1_press_release.pdf": public class PDFUtil { public static String getTransformed(InputStream inputStream) { PDDocument pdDocument = null; String document = null; try { PDFParser parser = new PDFParser(inputStream); parser.parse(); pdDocument = parser.getPDDocument(); PDFText2HTML pdf2html = new PDFText2HTML("UTF-8"); document = pdf2html.getText(pdDocument); } catch (IOException e) { e.printStackTrace(); Logger.DEBUG_MAIN.log(e.getMessage()); } finally { if (pdDocument != null) { try { pdDocument.getDocument().close(); } catch (IOException e) { e.printStackTrace(); Logger.DEBUG_MAIN.log(e.getMessage()); } } } return document; } public static void main(String[] args) throws IOException { String urlName = "http://www.rim.com/investors/documents/pdf/pressrelease/2011/Q1_press_release.pdf"; URL url = new URL(urlName); String result = getTransformed(url.openStream()); System.out.println(result); } } RETURNS: Exception in thread "main" java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider at org.apache.pdfbox.pdmodel.PDDocument.openProtection(PDDocument.java:1110) at org.apache.pdfbox.pdmodel.PDDocument.decrypt(PDDocument.java:591) at org.apache.pdfbox.util.PDFTextStripper.writeText(PDFTextStripper.java:246) at org.apache.pdfbox.util.PDFTextStripper.getText(PDFTextStripper.java:184) at com.selerityfinancial.wwwscraper.utils.PDFUtil.getTransformed(PDFUtil.java:25) at com.selerityfinancial.wwwscraper.utils.PDFUtil.main(PDFUtil.java:52) Caused by: java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 6 more

    Apache's JIRA Issue Tracker | 6 years ago | Vladimir
    java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider
  2. 0

    All pdf files works fine. Except this one "http://www.rim.com/investors/documents/pdf/pressrelease/2011/Q1_press_release.pdf": public class PDFUtil { public static String getTransformed(InputStream inputStream) { PDDocument pdDocument = null; String document = null; try { PDFParser parser = new PDFParser(inputStream); parser.parse(); pdDocument = parser.getPDDocument(); PDFText2HTML pdf2html = new PDFText2HTML("UTF-8"); document = pdf2html.getText(pdDocument); } catch (IOException e) { e.printStackTrace(); Logger.DEBUG_MAIN.log(e.getMessage()); } finally { if (pdDocument != null) { try { pdDocument.getDocument().close(); } catch (IOException e) { e.printStackTrace(); Logger.DEBUG_MAIN.log(e.getMessage()); } } } return document; } public static void main(String[] args) throws IOException { String urlName = "http://www.rim.com/investors/documents/pdf/pressrelease/2011/Q1_press_release.pdf"; URL url = new URL(urlName); String result = getTransformed(url.openStream()); System.out.println(result); } } RETURNS: Exception in thread "main" java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider at org.apache.pdfbox.pdmodel.PDDocument.openProtection(PDDocument.java:1110) at org.apache.pdfbox.pdmodel.PDDocument.decrypt(PDDocument.java:591) at org.apache.pdfbox.util.PDFTextStripper.writeText(PDFTextStripper.java:246) at org.apache.pdfbox.util.PDFTextStripper.getText(PDFTextStripper.java:184) at com.selerityfinancial.wwwscraper.utils.PDFUtil.getTransformed(PDFUtil.java:25) at com.selerityfinancial.wwwscraper.utils.PDFUtil.main(PDFUtil.java:52) Caused by: java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:303) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:248) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316) ... 6 more

    Apache's JIRA Issue Tracker | 6 years ago | Vladimir
    java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    Eclipse - Java - UniProtJapi import problem

    Stack Overflow | 7 years ago | Christian
    java.lang.ClassNotFoundException: org.springframework.core.io.Resource
  5. 0

    ireport + netbeans | Java México

    javamexico.org | 5 months ago
    java.lang.NoClassDefFoundError: org/apache/commons/collections/ReferenceMap

    12 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassNotFoundException

      org.bouncycastle.jce.provider.BouncyCastleProvider

      at java.net.URLClassLoader$1.run()
    2. Java RT
      ClassLoader.loadClassInternal
      1. java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      2. java.security.AccessController.doPrivileged(Native Method)
      3. java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      4. java.lang.ClassLoader.loadClass(ClassLoader.java:303)
      5. sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      6. java.lang.ClassLoader.loadClass(ClassLoader.java:248)
      7. java.lang.ClassLoader.loadClassInternal(ClassLoader.java:316)
      7 frames
    3. Apache PDFBox
      PDFTextStripper.getText
      1. org.apache.pdfbox.pdmodel.PDDocument.openProtection(PDDocument.java:1110)
      2. org.apache.pdfbox.pdmodel.PDDocument.decrypt(PDDocument.java:591)
      3. org.apache.pdfbox.util.PDFTextStripper.writeText(PDFTextStripper.java:246)
      4. org.apache.pdfbox.util.PDFTextStripper.getText(PDFTextStripper.java:184)
      4 frames
    4. com.selerityfinancial.wwwscraper
      PDFUtil.main
      1. com.selerityfinancial.wwwscraper.utils.PDFUtil.getTransformed(PDFUtil.java:25)
      2. com.selerityfinancial.wwwscraper.utils.PDFUtil.main(PDFUtil.java:52)
      2 frames