0

I'm facing issue while creating captcha using ColdFusion extension tag (cfx). And I'm getting the error message like com/sun/image/codec/jpeg/JPEGCodec. And I'm getting this issue in cf2021 server. My java version is 1.8. Anyone have any thoughts on this?

<cfx_captcha
        height="50"
        width = "100"
        background_image=""
        text="#client.word#"
        outfile="#result_dir#\#filename#.jpg"
        font="#listGetAt(fonts,randRange(1,listLen(fonts)))#"
        font_color="#listgetat(colors,randrange(1,10))#"
        fontsize="23"
        distortion_method="#randRange(1,3)#"
        font_opacity="100"
        quality="100"
        bgcolor1="eeeeee"
        bgcolor2="eeeeee">

Click here to view the error message

  • 2
    I haven't seen that `cfx_captcha` custom tag mentioned for many years. The error suggests that the custom tag has not been installed on your server. The question suggests to me that you're trying to migrate an old codebase to a new CF2021 server. If the code worked on an old server and you still have access to it, then you may be able to retrieve the compiled cfx_captcha library from there. If you are writing new code and trying `cfx_captcha` for the first time, I'd suggest using Google reCAPTCHA instead - either roll your own integration or use one of the cfc wrappers freely available. – Sev Roberts Apr 28 '21 at 12:29
  • You should also review all of your old and new CF Admin settings. There may be more missing `cfx` tags (JARs) that you haven't tested yet. There could also be some DSN settings you didn't migrate that will be needed. – Adrian J. Moreno Apr 28 '21 at 14:16
  • If you've verified the jar is present, might also problem with [deprecated classes in the JDK](https://stackoverflow.com/questions/8015291/how-to-replace-com-sun-image-codec-jpeg-jpegimageencoder-in-this-code). Though usually with Java 11. For those that can't switch to something more modern one suggestion is [adding the jvm flag `-XDignore.symbol.file`](https://stackoverflow.com/a/13082104/8895292). – SOS Apr 29 '21 at 13:54

0 Answers0