Could not initialize class sun.awt.X11GraphicsEnvironment 关于tomcat上传图片报错问题
[DUBBO] Got unchecked and undeclared exception which called by 127.0.0.1. service: com.edocClient.EdocWxPictureUploadFacade, method: glorityWxImageUpload, exception: java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment, dubbo version: 2.8.4, current host: 10.7.2.7 java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
at java.lang.Class.forName0(Native Method) ~[?:1.8.0_144]
报错原因始终无法解决,网上案例试了也没用,
md,最后重新复制一份 重启服务,正常,就正常了,。。。
如下,原来的配置:
#
# UMASK (Optional) Override Tomcat's default UMASK of 0027
#
# USE_NOHUP (Optional) If set to the string true the start command will
# use nohup so that the Tomcat process will ignore any hangup
# signals. Default is "false" unless running on HP-UX in which
# case the default is "true"
# -----------------------------------------------------------------------------
CATALINA_OPTS=-Djava.awt.headless=true
# OS specific support. $var _must_ be set to either true or false.
cygwin=false
darwin=false
os400=false
hpux=false
case "`uname`" in
CYGWIN*) cygwin=true;;
Darwin*) darwin=true;;
OS400*) os400=true;;
HP-UX*) hpux=true;;
修改后如下:
# UMASK (Optional) Override Tomcat's default UMASK of 0027
#
# USE_NOHUP (Optional) If set to the string true the start command will
# use nohup so that the Tomcat process will ignore any hangup
# signals. Default is "false" unless running on HP-UX in which
# case the default is "true"
# -----------------------------------------------------------------------------
#CATALINA_OPTS=-Djava.awt.headless=true
# OS specific support. $var _must_ be set to either true or false.
CATALINA_OPTS=-Djava.awt.headless=true
cygwin=false
darwin=false
os400=false
hpux=false
case "`uname`" in
CYGWIN*) cygwin=true;;
Darwin*) darwin=true;;
OS400*) os400=true;;
HP-UX*) hpux=true;;
把原来的屏蔽,重新拷贝一份
对比如下: