com.octo.captcha.component.image.fontgenerator.RandomFontGenerator Constructor threw exception; nested exception is java.lang.Error: Probable fatal error: No fonts found
my os: centos linux
probable reason: in bean configuration are mentioned only windows fonts, that are not shipped by default with linux
<bean id="randomFontGenerator"
class="com.octo.captcha.component.image.fontgenerator.RandomFontGenerator">
<!-- Minimal font size -->
<constructor-arg index="0">
<value>40</value>
</constructor-arg>
<!-- Maximal font size -->
<constructor-arg index="1">
<value>50</value>
</constructor-arg>
<!-- Allowed font list -->
<constructor-arg index="2">
<list>
<ref bean="fontArial" />
<ref bean="fontVerdana" />
</list>
</constructor-arg>
</bean>
this is bean configuration example from emforge (WEB-INF/classes/META-INF/spring/emforge-security-web.xml)
solution: just install a package that includes windows fonts (Arisl and Verdana). for centos it is yum install liberation-fonts
my os: centos linux
probable reason: in bean configuration are mentioned only windows fonts, that are not shipped by default with linux
<bean id="randomFontGenerator"
class="com.octo.captcha.component.image.fontgenerator.RandomFontGenerator">
<!-- Minimal font size -->
<constructor-arg index="0">
<value>40</value>
</constructor-arg>
<!-- Maximal font size -->
<constructor-arg index="1">
<value>50</value>
</constructor-arg>
<!-- Allowed font list -->
<constructor-arg index="2">
<list>
<ref bean="fontArial" />
<ref bean="fontVerdana" />
</list>
</constructor-arg>
</bean>
this is bean configuration example from emforge (WEB-INF/classes/META-INF/spring/emforge-security-web.xml)
solution: just install a package that includes windows fonts (Arisl and Verdana). for centos it is yum install liberation-fonts

5 comments: