linux 环境 java web 验证码失效
访问验证码报错:
2020-07-05 20:09:05.610 ERROR 23483 --- [nio-8877-exec-8] c.z.m.a.c.h.ExceptionHandlerAdvice : Exception:Handler dispatch failed; nested exception is j ava.lang.UnsatisfiedLinkError: /usr/java/jdk1.8.0_181/jre/lib/i386/libfontmanager.so: libgcc_s.so.1: cannot open shared object file: No such file or directory org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.UnsatisfiedLinkError: /usr/java/jdk1.8.0_181/jre/l ib/i386/libfontmanager.so: libgcc_s.so.1: cannot open shared object file: No such file or directory at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1053) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897) ... 2020-07-05 20:11:00.232 ERROR 23483 --- [nio-8877-exec-5] c.z.m.a.c.h.ExceptionHandlerAdvice : Exception:Handler dispatch failed; nested exception is j ava.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class s un.awt.X11FontManager ...
在解决过程中尝试了以下方法,但是没效果。
- 在
java
命令后面追加-Djava.awt.headless=true
- 在验证码方法class添加
static { System.setProperty("java.awt.headless", "true"); }
我的解决办法是在linux中安装以下:
[ /]# yum install libgcc.i686 --setopt=protected_multilib=false [ /]# yum grouplist [ /]# yum groupinstall Font
相关推荐
farwang 2020-11-25
星愿心愿 2020-11-24
tianhuak 2020-11-24
zhjn0 2020-11-24
昭君出塞 2020-11-23
bluecarrot 2020-11-23
linuxwcj 2020-10-21
以梦为马不负韶华 2020-10-20
彼岸随笔 2020-10-20
yutou0 2020-10-17
applecarelte 2020-10-16
ourtimes 2020-10-16
waterhorse 2020-09-19
MRFENGG 2020-11-11
rainandtear 2020-10-30
kyssfanhui 2020-10-20
liuhangtiant 2020-10-20