Captcha not showing after a couple of failed attempts

Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.

Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

You have tried a couple of unsuccessful times to login to Bamboo until a captcha is triggered. The Captcha is however not showing any contents for the challenge. You have something virtually as the attached screenshot.

The atlassian-bamboo.log shows the following:

2014-09-09 09:53:15,947 ERROR [http-bio-8085-exec-18] [FiveOhOh] 500 Exception was thrown.
com.atlassian.util.concurrent.LazyReference$InitializationException: com.atlassian.spring.container.ComponentNotFoundException: Failed to find component: Error creating bean with name 'imageCaptchaService' defined in class path resource [applicationContextCaptcha.xml]: Cannot resolve reference to bean 'captchaEngine' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'captchaEngine' defined in class path resource [applicationContextCaptcha.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.octo.captcha.engine.image.gimpy.DefaultGimpyEngine]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
	at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149)
	at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:112)
	at com.atlassian.bamboo.servlet.BambooCaptchaServlet.getCaptchaImage(BambooCaptchaServlet.java:76)
	at com.atlassian.bamboo.servlet.BambooCaptchaServlet.doGet(BambooCaptchaServlet.java:47)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46)
	at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:66)
	at com.hindsighttesting.bamboo.cucumber.web.LegacyResourceFilter.doFilter(LegacyResourceFilter.java:28)
.
.
.
.
Caused by: com.atlassian.spring.container.ComponentNotFoundException: Failed to find component: Error creating bean with name 'imageCaptchaService' defined in class path resource [applicationContextCaptcha.xml]: Cannot resolve reference to bean 'captchaEngine' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'captchaEngine' defined in class path resource [applicationContextCaptcha.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.octo.captcha.engine.image.gimpy.DefaultGimpyEngine]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
	at com.atlassian.spring.container.SpringContainerContext.getComponent(SpringContainerContext.java:79)
	at com.atlassian.spring.container.ContainerManager.getComponent(ContainerManager.java:33)
	at com.atlassian.spring.container.LazyComponentReference.create(LazyComponentReference.java:43)
	at com.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:321)
	at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:143)
	... 118 more

Cause

The first thing will be to check whether or not you are running bamboo on a supported JDK. This should usually be OpenJDK 1.7 or Oracle JDK 1.6 or 1.7. Check this on our Supported platforms page. Another root cause could be that your server is headless which means that there s no graphic environment to load the captcha service.

Resolution

  1. Stop Bamboo
  2. Edit the HOME/xml-data/configuration/administration.xml file and you will see a block:

    <captchaConfiguration>
    <enableCaptcha>true</enableCaptcha>
    <enableCaptchaOnSignup>true</enableCaptchaOnSignup>
    <maxLoginAttempts>3</maxLoginAttempts>
    </captchaConfiguration>

    change it to below and restart Bamboo to disable captcha so that you can get access

    <captchaConfiguration>
    <enableCaptcha>false</enableCaptcha>
    <enableCaptchaOnSignup>true</enableCaptchaOnSignup>
    <maxLoginAttempts>3</maxLoginAttempts>
    </captchaConfiguration>
  3. Now verify from your system information page whether you have this environment variable set:  -Djava.awt.headless=true . If its not set, please set it based on the guide Configuring your system properties

Last modified on Jan 27, 2025

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.