关于JBoss日志中的报错Exception in thread "AWT-EventQueue-0"的解决记录

一、前情提要

操作系统:Windows Server 2008 R2,JDK版本:1.6.0_45,应用容器:JBoss 4.2.3 GA。所部署的应用均为Web型项目,没有任何图形相关的项目。

二、症状诊断

查看JBoss的运行日志,经常会发现如下错误日志:

10:10:54,142 ERROR [STDERR] Exception in thread "AWT-EventQueue-0"
10:10:54,156 ERROR [STDERR] java.lang.ClassCastException: sun.java2d.HeadlessGraphicsEnvironment cannot be cast to sun.a
wt.Win32GraphicsEnvironment
10:10:54,158 ERROR [STDERR]     at sun.awt.windows.WToolkit$3.run(WToolkit.java:737)
10:10:54,159 ERROR [STDERR]     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
10:10:54,162 ERROR [STDERR]     at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:672)
10:10:54,167 ERROR [STDERR]     at java.awt.EventQueue.access$400(EventQueue.java:81)
10:10:54,168 ERROR [STDERR]     at java.awt.EventQueue$2.run(EventQueue.java:633)
10:10:54,168 ERROR [STDERR]     at java.awt.EventQueue$2.run(EventQueue.java:631)
10:10:54,170 ERROR [STDERR]     at java.security.AccessController.doPrivileged(Native Method)
10:10:54,170 ERROR [STDERR]     at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.jav
a:87)
10:10:54,173 ERROR [STDERR]     at java.awt.EventQueue.dispatchEvent(EventQueue.java:642)
10:10:54,173 ERROR [STDERR]     at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
10:10:54,176 ERROR [STDERR]     at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
10:10:54,176 ERROR [STDERR]     at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
10:10:54,178 ERROR [STDERR]     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
10:10:54,179 ERROR [STDERR]     at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
10:10:54,179 ERROR [STDERR]     at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

作为运维看到错误日志都是很不爽的,所以我飞要消除之!

三、资料查找

Google上查到两份资料,很有用,按照其中说明,去掉了-Djava.awt.headless = true,在我本机测试没有问题,将在服务器上使用,并继续观察。

资料一:https://confluence.atlassian.com/fishkb/getting-a-sun-java2d-headlessgraphicsenvironment-cannot-be-cast-to-sun-awt-win32graphicsenvironment-error-on-startup-178259867.html

资料二:http://dikar.iteye.com/blog/1417625

转载于:https://www.cnblogs.com/luodengxiong/p/5497335.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值