*Captcha reports an error java.lang.arrayindexoutofboundsexception
The following error message was found when starting the program, which has been tangled for a long time
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at sun.font.CompositeFont.getSlotFont(CompositeFont.java:375)
at sun.font.CompositeGlyphMapper.initMapper(CompositeGlyphMapper.java:81)
at sun.font.CompositeGlyphMapper.<init>(CompositeGlyphMapper.java:62)
at sun.font.CompositeFont.getMapper(CompositeFont.java:433)
at sun.font.CompositeFont.canDisplay(CompositeFont.java:459)
at java.awt.Font.canDisplay(Font.java:1980)
at com.octo.captcha.component.image.fontgenerator.RandomFontGenerator.checkFontCanDisplayCharacters(RandomFontGenerator.java:207)
at com.octo.captcha.component.image.fontgenerator.RandomFontGenerator.cleanFontList(RandomFontGenerator.java:163)
at com.octo.captcha.component.image.fontgenerator.RandomFontGenerator.initializeFonts(RandomFontGenerator.java:79)
at com.octo.captcha.component.image.fontgenerator.RandomFontGenerator.<init>(RandomFontGenerator.java:75)
at lac.framework.captcha.ImageCaptchaServiceBean.afterPropertiesSet(ImageCaptchaServiceBean.java:74)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574)
... 35 more
Later, I checked some data and found that the deployed system did not use the font when using the verification code component
install the corresponding font and fix it. Fonts can refer to another documented article: installing fonts on Linux
Similar Posts:
- [Solved] Project Startup Error: Caused by: java.lang.ClassNotFoundException: com.sun.image.codec.jpeg.ImageFormatException
- [Solved] No qualifying bean of type ‘org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder’ available:
- [Solved] java.lang.IllegalStateException: Failed to introspect Class xxxx
- [Solved] Jedis:Exception in thread “main” java.lang.VerifyError: Bad type on operand stack
- [Solved] Springboot Use Redis Error: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘redisTemplate’ defined in class path resource
- [Solved] SpringbootExpection 1: Error creating bean with name ‘xxxImpl’: Unsatisfied dependency expressed through field
- [Solved] Dependency injection exception: org.springframework.beans.factory.UnsatisfiedDependencyException
- Error reported by feign component of springcloud microservice
- Exception encountered during context initialization – cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘userDaoImpl’ defined in file
- [Solved] Project Start Error: Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError