com.sun.pdfview.decrypt.PDFAuthenticationFailureException: Password failed authentication for both owner and user password

Atlassian JIRA | Niraj Bhawnani | 6 years ago
  1. 0

    When using the viewfile macro to view a password protected PDF file, the following exception is thrown 3 times, and then the user sees a message telling him that the PDF is still being rendered and to refresh the page later. Upon refreshing the same exception is thrown another 3 times. {noformat} com.sun.pdfview.decrypt.PDFAuthenticationFailureException: Password failed authentication for both owner and user password at com.sun.pdfview.decrypt.StandardDecrypter.<init>(StandardDecrypter.java:188) at com.sun.pdfview.decrypt.PDFDecrypterFactory.createStandardDecrypter(PDFDecrypterFactory.java:316) at com.sun.pdfview.decrypt.PDFDecrypterFactory.createDecryptor(PDFDecrypterFactory.java:99) at com.sun.pdfview.PDFFile.readTrailer(PDFFile.java:1085) at com.sun.pdfview.PDFFile.parseFile(PDFFile.java:1397) at com.sun.pdfview.PDFFile.<init>(PDFFile.java:129) at com.sun.pdfview.PDFFile.<init>(PDFFile.java:101) at com.benryan.conversion.SlideConversionThread.convertFile(SlideConversionThread.java:74) at com.benryan.conversion.SlideConversionThread.run(SlideConversionThread.java:127) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) {noformat} The fix could either be to support password protected PDFs by allowing the user to enter a password in a password field in the PDF viewer macro, or to display an appropriate error message such as "The file foo.pdf cannot be displayed because it is password protected." See attachment for example PDF.

    Atlassian JIRA | 6 years ago | Niraj Bhawnani
    com.sun.pdfview.decrypt.PDFAuthenticationFailureException: Password failed authentication for both owner and user password

    Root Cause Analysis

    1. com.sun.pdfview.decrypt.PDFAuthenticationFailureException

      Password failed authentication for both owner and user password

      at com.sun.pdfview.decrypt.StandardDecrypter.<init>()
    2. PDF Renderer
      PDFFile.<init>
      1. com.sun.pdfview.decrypt.StandardDecrypter.<init>(StandardDecrypter.java:188)
      2. com.sun.pdfview.decrypt.PDFDecrypterFactory.createStandardDecrypter(PDFDecrypterFactory.java:316)
      3. com.sun.pdfview.decrypt.PDFDecrypterFactory.createDecryptor(PDFDecrypterFactory.java:99)
      4. com.sun.pdfview.PDFFile.readTrailer(PDFFile.java:1085)
      5. com.sun.pdfview.PDFFile.parseFile(PDFFile.java:1397)
      6. com.sun.pdfview.PDFFile.<init>(PDFFile.java:129)
      7. com.sun.pdfview.PDFFile.<init>(PDFFile.java:101)
      7 frames
    3. com.benryan.conversion
      SlideConversionThread.run
      1. com.benryan.conversion.SlideConversionThread.convertFile(SlideConversionThread.java:74)
      2. com.benryan.conversion.SlideConversionThread.run(SlideConversionThread.java:127)
      2 frames
    4. Java RT
      Thread.run
      1. java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      2. java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      3. java.util.concurrent.FutureTask.run(FutureTask.java:138)
      4. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      5. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      6. java.lang.Thread.run(Thread.java:619)
      6 frames