I upgraded an application from Lucee 4.5 to Lucee 5.1.0.34 yesterday and
now:
pdf action=“protect” […]
fails with the following error:
java.lang.ClassNotFoundException:
lucee.runtime.exp.NativeException: org.bouncycastle.asn1.DEREncodable not
found by bcprov [92]
at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1558)
at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1998)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at
org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1399)
at
org.apache.felix.framework.BundleWiringImpl.searchImports(BundleWiringImpl.java:1579)
at
org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1509)
at
org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79)
at
org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1998)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.lowagie.text.pdf.PdfEncryption.(Unknown Source)
at com.lowagie.text.pdf.PdfWriter.setEncryption(Unknown Source)
at org.lucee.extension.pdf.util.PDFUtil.encrypt(PDFUtil.java:264)
at org.lucee.extension.pdf.tag.PDF.doActionProtect(PDF.java:1085)
at org.lucee.extension.pdf.tag.PDF.doEndTag(PDF.java:583)
This has previously been reported here: [LDEV-1038] - Lucee and the workaround on
that issue (uninstalling the S3 extension) was not a good idea (or workable
in our case).
I figure I could try solving this myself by rebuilding the extension. Is
there a good step-by-step guide out there which would facilitate this?
The PDF Extension uses BC v1.38 but the S3 extension uses BC v1.52 and 1.52
overrides 1.38. Uninstalling the S3 extension is not an option so I tried
rebuilding the S3 extension using BC v1.38 but something keeps deploying
bcprov-1-52-0.jar to /opt/railo/tomcat/lucee-server/bundles/. No clue why
that’s happening but it’s probably deep within Lucee.
So, as of now you cannot use pdf action=“protect” in Lucee 5.1 (and
probably 5.0) and I can see why it’s been backlogged. Because fixing it
would require rebuilding the PDF Extension with a newer version of iText
which is probably a lot of work (and I don’t know if it presents licensing
issues).
Back to 4.5 for me, then, which is too bad because I really wanted to
upgrade to 5.1. Unless I workaround the need to use pdf action=“protect”.
The PDF Extension uses BC v1.38 but the S3 extension uses BC v1.52 and
1.52 overrides 1.38. Uninstalling the S3 extension is not an option so
I tried rebuilding the S3 extension using BC v1.38 but something keeps
deploying bcprov-1-52-0.jar to
/opt/railo/tomcat/lucee-server/bundles/. No clue why that’s happening
but it’s probably deep within Lucee.
So, as of now you cannot use pdf action=“protect” in Lucee 5.1 (and
probably 5.0) and I can see why it’s been backlogged. Because fixing
it would require rebuilding the PDF Extension with a newer version of
iText which is probably a lot of work (and I don’t know if it presents
licensing issues).
Back to 4.5 for me, then, which is too bad because I really wanted to
upgrade to 5.1. Unless I workaround the need to use pdf action=“protect”.
Get 10% off of the regular price for this years CFCamp in Munich,
Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp.
189€ instead of 210€. Visit CFCamp 2016