0

I need to load BouncyCastle jars for mail encryption using the java loader. (ColdFusion 10 and no Application.cfc). When an older version of a jar exists in the lib directory, that version is loaded and not the one specified in the javaloader.

Even when I create a jar with BouncyCastle jars in the classpath and call a "facade" in ColdFusion, the jars in the lib directories are first loaded and it gives errors (the jar runs perfect in Java)

Does someone know if there is a way to ensure loading of the specified jars (new versions) and not those from the lib directories with the java loader?

Miguel-F
  • 13,450
  • 6
  • 38
  • 63
michel
  • 81
  • 1
  • 9
  • 1
    possibly related? - https://stackoverflow.com/q/25027957/1636917 – Miguel-F May 18 '18 at 15:26
  • Hi Miguel, thanks for your help. This is not really the same. I may not place jars in the ColdFusion directories because there are a lot of applications on the server and it could cause problems in another of them. I need load the jars from within my application. Of course I tried on my personal laptop with a developer version of ColdFusion, changed the jars in the ColdFusion/lib directory and everything runs smoothly but this is not a solution for production :) – michel May 19 '18 at 06:48
  • 1
    Is there a reason why you couldn't use Application.cfc? Using this.javaSettings in Application.cfc would be the easiest solution. – Scott Jibben May 19 '18 at 15:10
  • 1
    "*This is not really the same*" - @michel - It may not be a feasible solution for you, but it does sound like it's the same issue/cause. IIRC, BC is a signed jar, and also a security provider, so it might have different requirements than regular libraries. 1) You forgot to mention - what's the error you're getting? 2) It'd help to see some code. Did you try specifying the parent class loader 3) Like Scott suggested what happens when you use `this.javaSettings` instead of javaLoader? – SOS May 19 '18 at 18:43

0 Answers0