Bug 497986 - pdftk throws java exception
pdftk throws java exception
Product: Fedora
Classification: Fedora
Component: pdftk (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Jochen Schmitt
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-04-28 05:26 EDT by Jiri Cerny
Modified: 2009-04-29 21:32 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-04-29 12:34:46 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
add bcprov and bcmail to classpath (1.29 KB, patch)
2009-04-28 11:35 EDT, Orcan Ogetbil
no flags Details | Diff

  None (edit)
Description Jiri Cerny 2009-04-28 05:26:49 EDT
On recent rawhide (pdftk-1.41-17.fc11.x86_64), I get the following error.

pdftk concentration.pdf cat output bla.ps
java.lang.NoClassDefFoundError: com.lowagie.text.pdf.PdfReader
   at java.lang.Class.initializeClass(libgcj.so.10)
Caused by: java.lang.ClassNotFoundException: org.bouncycastle.cms.RecipientInformationStore not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:/usr/share/java/itext.jar], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}
   at java.net.URLClassLoader.findClass(libgcj.so.10)
   at java.lang.ClassLoader.loadClass(libgcj.so.10)
   at java.lang.ClassLoader.loadClass(libgcj.so.10)
   at java.lang.Class.initializeClass(libgcj.so.10)
Error: Unexpected Exception in open_reader()
Error: Failed to open PDF file: 
Errors encountered.  No output created.
Done.  Input errors, so no output created.

It is reproducible on all pdf files that I tried, so it should not be file specific.
Comment 1 Orcan Ogetbil 2009-04-28 11:34:41 EDT
Yes I confirm this. I first suspected the recent bouncycastle update. But it is not related, however wonder why it worked before.

The fix is replacing the pdftk-classpath.patch with the attached one. I added bcprov and bcmail to classpath.

Jochen, could you test it to verify?
Comment 2 Orcan Ogetbil 2009-04-28 11:35:45 EDT
Created attachment 341591 [details]
add bcprov and bcmail to classpath
Comment 3 Orcan Ogetbil 2009-04-28 23:09:51 EDT
Could you test this build that contains the updated patch? It works on my system but I just want to make sure. You can download the package for your arch from here:
Comment 4 Jiri Cerny 2009-04-29 05:35:56 EDT
The build from comment #3 fixes my problems. You can close this bug. Thanks a lot.
Comment 5 Jochen Schmitt 2009-04-29 12:34:46 EDT
I have create pdftk-1.41-18 for Rawhide and F-11. I create Ticket #1686 for tagging this release for F-11.
Comment 6 Orcan Ogetbil 2009-04-29 21:32:44 EDT
The new patch solves the issue, but I really don't understand why. The itext.jar file is only needed for font metrics. I also don't understand why it worked before, without these bouncycastle classpaths and why it stopped working now.

At least, I'm glad that the fix was easy.

But I do wonder if we will need to add other classpaths (for other itext dependencies) at some point in the future.

Note You need to log in before you can comment on or make changes to this bug.