Fop2, Java8, Tomcat7 and Bouncy Castle

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Fop2, Java8, Tomcat7 and Bouncy Castle

Dave Thorn
Hi,

The page at

https://xmlgraphics.apache.org/fop/2.0/pdfencryption.html

says "The PDF encryption implemented in FOP does not need
external libraries to perform encryption. A recent JDK (1.5+) is
sufficient. "

Yet I deployed my fop-using webapp to centos7, tomcat7,
java8(Oracle jdk) and it complained:

java.lang.NoClassDefFoundError:
org/bouncycastle/jce/provider/BouncyCastleProvider
org.apache.pdfbox.pdmodel.encryption.PDEncryption.<init>(PDEncryption.java:96)
org.apache.pdfbox.pdfparser.PDFParser.prepareDecryption(PDFParser.java:263)
org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:196)
org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:230)
org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:972)
org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:876)


It's fixed easily enough with

      <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcprov-jdk15on</artifactId>
        <version>1.53</version>
      </dependency>

but I thought I'd enquire into the discrepancy.

ta,

--
dave thorn

Bad to the bone.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Fop2, Java8, Tomcat7 and Bouncy Castle

Luis Bernardo

You are using PDFBox, maybe because you are using the PDF Plugin, and that is why you need BoucyCastle. FOP does not need it.

On Fri, Nov 6, 2015 at 10:01 AM, Dave Thorn <[hidden email]> wrote:
Hi,

The page at

https://xmlgraphics.apache.org/fop/2.0/pdfencryption.html

says "The PDF encryption implemented in FOP does not need
external libraries to perform encryption. A recent JDK (1.5+) is
sufficient. "

Yet I deployed my fop-using webapp to centos7, tomcat7,
java8(Oracle jdk) and it complained:

java.lang.NoClassDefFoundError:
org/bouncycastle/jce/provider/BouncyCastleProvider
org.apache.pdfbox.pdmodel.encryption.PDEncryption.<init>(PDEncryption.java:96)
org.apache.pdfbox.pdfparser.PDFParser.prepareDecryption(PDFParser.java:263)
org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:196)
org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:230)
org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:972)
org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:876)


It's fixed easily enough with

      <dependency>
        <groupId>org.bouncycastle</groupId>
        <artifactId>bcprov-jdk15on</artifactId>
        <version>1.53</version>
      </dependency>

but I thought I'd enquire into the discrepancy.

ta,

--
dave thorn

Bad to the bone.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]


Reply | Threaded
Open this post in threaded view
|

Re: Fop2, Java8, Tomcat7 and Bouncy Castle

Dave Thorn
On Fri, Nov 06, 2015 at 10:03:37AM +0100, Luis Bernardo wrote:
> You are using PDFBox, maybe because you are using the PDF Plugin, and that
> is why you need BoucyCastle. FOP does not need it.

You read my stacktrace more closely than I did.  I am shamefaced.

:)

Thank you.

I was running pdfbox to count the pages of the pdf after
production.

--
dave thorn

Well you know, I have days.

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]