CAPTCHA image does not display when Confluence is hosted on a non-English system
Symptoms
When a CAPTCHA should be displayed after repeated failed login attempts, instead a broken image link is displayed.
The following appears in the atlassian-confluence.log
:
2012-10-05 15:01:27,053 ERROR [http-8090-1] [[Standalone].[localhost].[/].[jcaptcha]] log Servlet.service() for servlet jcaptcha threw exception
com.octo.captcha.CaptchaException: word is too tall: try to use less letters, smaller font or bigger background: text bounds = {text=tasble
...
Cause
The system default encoding is set to something other than UTF-8, which has caused the font used when generating the CAPTCHA image to be something other than what is normally used. This font generates CAPTCHA strings that are too large to fit in the image size, causing an exception. This is common for Chinese/Korean servers.
Resolution
Add the following system property to Confluence, using the instructions at Configuring System Properties:
-Dfile.encoding=UTF-8
Restart Confluence