Could not initialize class sun.awt.X11GraphicsEnvironment

        今天一个简单的xls导出功能 , dat环境测试通过 , 发到vir居然报错了 .

     

        报错信息云云~~


17:58:46 DEBUG com.alibaba.dubbo.remoting.transport.DecodeHandler -  [DUBBO] Decode decodeable message com.alibaba.dubbo.rpc.protocol.dubbo.DecodeableRpcResult, dubbo version: 2.8.3, current host: 10.159.161.197

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

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:259)

at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:102)

at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:81)

at sun.awt.X11FontManager.isHeadless(X11FontManager.java:488)

at sun.awt.X11FontManager.getFileNameFromPlatformName(X11FontManager.java:168)

at sun.font.SunFontManager.initCompositeFonts(SunFontManager.java:3481)

at sun.font.SunFontManager.access$700(SunFontManager.java:65)

at sun.font.SunFontManager$2.run(SunFontManager.java:545)

at java.security.AccessController.doPrivileged(Native Method)

at sun.font.SunFontManager.<init>(SunFontManager.java:376)

at sun.awt.X11FontManager.<init>(X11FontManager.java:32)

at sun.reflect.GeneratedConstructorAccessor62.newInstance(Unknown Source)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.lang.reflect.Constructor.newInstance(Constructor.java:408)

at java.lang.Class.newInstance(Class.java:433)

at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)

at java.security.AccessController.doPrivileged(Native Method)

at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)

at java.awt.Font.getFont2D(Font.java:491)

at java.awt.Font.canDisplayUpTo(Font.java:2060)

at java.awt.font.TextLayout.singleFont(TextLayout.java:470)

at java.awt.font.TextLayout.<init>(TextLayout.java:531)

at org.apache.poi.ss.util.SheetUtil.getColumnWidth(SheetUtil.java:208)

at org.apache.poi.hssf.usermodel.HSSFSheet.autoSizeColumn(HSSFSheet.java:1954)

at org.apache.poi.hssf.usermodel.HSSFSheet.autoSizeColumn(HSSFSheet.java:1937)

at cn.gooday.logistics.web.util.poi.ExportUtil.exportIntoExcel(ExportUtil.java:147)


网上一搜 , 出现这问题多还挺多 , 破玩意儿 , 不知道用jxl有没有这个问题 .


解决办法 : 


修改${TOMCAT_HOME}/bin/catalina.sh (windows修改catalina.bat) 

查到-Djava.io.tmpdir="$CATALINA_TMPDIR"这行,并在这一行下加入: 

-Djava.awt.headless=true \ 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值