Captcha fail to load with Internal Server Error
Problem
Captcha picture fail to load with following appears in the atlassian-bamboo.log
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 properties-Djava.awt.headless=true
- Restart Bamboo
Last modified on May 30, 2019
Powered by Confluence and Scroll Viewport.