Linux上kaptche报错java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager...

2019独角兽企业重金招聘Python工程师标准>>> hot3.png

环境:jdk1.7,tomcat8 报错信息: Exception

javax.servlet.ServletException: Servlet execution threw an exception org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) com.github.inspektr.common.web.ClientInfoThreadLocalFilter.doFilter(ClientInfoThreadLocalFilter.java:63) Root Cause

java.lang.UnsatisfiedLinkError: /iflytek/java/jdk1.7.0_65/jre/lib/i386/libfontmanager.so: libgcc_s.so.1: cannot open shared object file: No such file or directory java.lang.ClassLoader$NativeLibrary.load(Native Method) java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1965) java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1890) java.lang.ClassLoader.loadLibrary(ClassLoader.java:1872) java.lang.Runtime.loadLibrary0(Runtime.java:849) java.lang.System.loadLibrary(System.java:1088) sun.font.FontManagerNativeLibrary$1.run(FontManagerNativeLibrary.java:61) java.security.AccessController.doPrivileged(Native Method) sun.font.FontManagerNativeLibrary.(FontManagerNativeLibrary.java:32) sun.font.SunFontManager$1.run(SunFontManager.java:339) java.security.AccessController.doPrivileged(Native Method) sun.font.SunFontManager.(SunFontManager.java:335) java.lang.Class.forName0(Native Method) java.lang.Class.forName(Class.java:270) sun.font.FontManagerFactory$1.run(FontManagerFactory.java:82) java.security.AccessController.doPrivileged(Native Method) sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74) java.awt.Font.getFont2D(Font.java:490) java.awt.Font.access$000(Font.java:224) java.awt.Font$FontAccessImpl.getFont2D(Font.java:228) sun.font.FontUtilities.getFont2D(FontUtilities.java:180) sun.font.StandardGlyphVector.initFontData(StandardGlyphVector.java:1126) sun.font.StandardGlyphVector.init(StandardGlyphVector.java:1115) sun.font.StandardGlyphVector.(StandardGlyphVector.java:167) java.awt.Font.createGlyphVector(Font.java:2544) com.google.code.kaptcha.text.impl.DefaultWordRenderer.renderWord(DefaultWordRenderer.java:66) com.google.code.kaptcha.impl.DefaultKaptcha.createImage(DefaultKaptcha.java:43) com.google.code.kaptcha.servlet.KaptchaServlet.doGet(KaptchaServlet.java:81) javax.servlet.http.HttpServlet.service(HttpServlet.java:635) javax.servlet.http.HttpServlet.service(HttpServlet.java:742) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259) com.github.inspektr.common.web.ClientInfoThreadLocalFilter.doFilter(ClientInfoThreadLocalFilter.java:63) Note The full stack trace of the root cause is available in the server logs.

解决方案: 1.打开 %Tomcat_home%/bin/catalina.sh 文件在-Djava.io.tmpdir="$CATALINA_TMPDIR"后,启动Tomcat的脚本中加上:-Djava.awt.headless=true

重启之后报错: gcc的动态库找不到了/java/jdk1.7.0_79/jre/lib/i386/libfontmanager.so: libgcc_s.so.1

解决方案:执行命令 sudo yum install libgcc.i686 --setopt=protected_multilib=false

问题解决!

转载于:https://my.oschina.net/keke412/blog/3015230

你可能感兴趣的:(Linux上kaptche报错java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager...)