收藏
回答

布署java项目,验证码显示报错?

java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager

12/30 14:18:50

springboot-jl47-005

at java.lang.Class.forName0(Native Method) ~[na:1.8.0_292]

12/30 14:18:50

springboot-jl47-005

at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_292]

12/30 14:18:50

springboot-jl47-005

at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:82) ~[na:1.8.0_292]

12/30 14:18:50

springboot-jl47-005

at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_292]

12/30 14:18:50

springboot-jl47-005

at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74) ~[na:1.8.0_292]

12/30 14:18:50

springboot-jl47-005

at java.awt.Font.getFont2D(Font.java:491) ~[na:1.8.0_292]

12/30 14:18:50

springboot-jl47-005

at java.awt.Font.access$000(Font.java:224) ~[na:1.8.0_292]

12/30 14:18:50

springboot-jl47-005

at java.awt.Font$FontAccessImpl.getFont2D(Font.java:228) ~[na:1.8.0_292]

12/30 14:18:50

springboot-jl47-005

at sun.font.FontUtilities.getFont2D(FontUtilities.java:180) ~[na:1.8.0_292]

12/30 14:18:50

springboot-jl47-005

at sun.font.StandardGlyphVector.initFontData(StandardGlyphVector.java:1126) ~[na:1.8.0_292]

12/30 14:18:50

springboot-jl47-005

at sun.font.StandardGlyphVector.init(StandardGlyphVector.java:1115) ~[na:1.8.0_292]

12/30 14:18:50

springboot-jl47-005

at sun.font.StandardGlyphVector.<init>(StandardGlyphVector.java:167) ~[na:1.8.0_292]

12/30 14:18:50

springboot-jl47-005

at java.awt.Font.createGlyphVector(Font.java:2549) ~[na:1.8.0_292]

12/30 14:18:50

springboot-jl47-005

at com.google.code.kaptcha.text.impl.DefaultWordRenderer.renderWord(DefaultWordRenderer.java:66) ~[kaptcha-2.3.2.jar!/:2.3.2]

12/30 14:18:50

springboot-jl47-005

at com.google.code.kaptcha.impl.DefaultKaptcha.createImage(DefaultKaptcha.java:43) ~[kaptcha-2.3.2.jar!/:2.3.2]

12/30 14:18:50

springboot-jl47-005

at com.example.demo.KaptchaController.kaptcha(KaptchaController.java:55) ~[classes!/:0.0.1-SNAPSHOT]

12/30 14:18:50

springboot-jl47-005

at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source) ~[na:na]

12/30 14:18:50

springboot-jl47-005

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_292]

12/30 14:18:50

springboot-jl47-005

at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_292]

12/30 14:18:50

springboot-jl47-005

at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-5.3.14.jar!/:5.3.14]

12/30 14:18:50

springboot-jl47-005

at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150) ~[spring-web-5.3.14.jar!/:5.3.14]

12/30 14:18:50

springboot-jl47-005

at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117) ~[spring-webmvc-5.3.14.jar!/:5.3.14]

更多

12/30 14:18:50

springboot-jl47-005

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.3.14.jar!/:5.3.14]

更多

12/30 14:18:50

springboot-jl47-005

at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808) ~[spring-webmvc-5.3.14.jar!/:5.3.14]

更多

12/30 14:18:50

springboot-jl47-005

at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.3.14.jar!/:5.3.14]

12/30 14:18:50

springboot-jl47-005

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067) ~[spring-webmvc-5.3.14.jar!/:5.3.14]

回答关注问题邀请回答
收藏

2 个回答

  • 挨踢
    挨踢
    2021-12-31

    在微信云托管里没有相关进入容器的地方啊

    2021-12-31
    有用
    回复
  • 疯狂的小辣椒
    疯狂的小辣椒
    2021-12-30

    你好,需要安装下字体,RUN yum install dejavu-sans-fonts fontconfig -y


    2021-12-30
    有用
    回复 3
    • 挨踢
      挨踢
      2021-12-31
      在微信云托管里没有相关进入容器的地方啊
      2021-12-31
      回复
    • 疯狂的小辣椒
      疯狂的小辣椒
      2022-01-05回复挨踢
      构建镜像时安装字体,dockerfile增加命令
      2022-01-05
      回复
    • zhuoyx
      zhuoyx
      2022-05-01
      微信云托管在那里可以增加dockerFile命令?
      2022-05-01
      回复
登录 后发表内容
问题标签