Captcha fail to load with Internal Server Error
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs 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
Problem
Captcha picture fail to load with following appears in the atlassian-bamboo.log
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2019-04-15 15:11:01,145 ERROR [http-nio-8085-exec-23] [FiveOhOh] 500 Exception was thrown.
org.springframework.beans.factory.BeanCreationException: 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: Failed to instantiate [com.octo.captcha.engine.image.gimpy.DefaultGimpyEngine]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: Could not initialize class java.awt.Color
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:378)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:639)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:153)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1267)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1124)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:535)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:495)
...
Caused by: java.lang.NoClassDefFoundError: Could not initialize class java.awt.Color
at com.octo.captcha.engine.image.gimpy.GmailEngine.buildInitialFactories(GmailEngine.java:63)
at com.octo.captcha.engine.image.ListImageCaptchaEngine.<init>(ListImageCaptchaEngine.java:24)
at com.octo.captcha.engine.image.gimpy.GmailEngine.<init>(GmailEngine.java:49)
at com.octo.captcha.engine.image.gimpy.DefaultGimpyEngine.<init>(DefaultGimpyEngine.java:50)
at sun.reflect.GeneratedConstructorAccessor1091.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:170)
... 182 more
Cause
Bamboo server running on headless machine.
Resolution
Shutdown Bamboo
Add the following Java option into the file
<Bamboo install directory>/bin/setenv.sh
(Linux) orsetenv.bat
(Windows) as shown in Configuring your system properties1
-Djava.awt.headless=true
Restart Bamboo
Was this helpful?