出自:http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_19252
源问题如下:
[07-5-28 9:57:15:191 CST] f6eadb0 WebGroup E SRVE0026E: [Servlet 错误]-[sun/awt/motif/MToolkit]:java.lang.NoClassDefFoundError: sun/awt/motif/MToolkit
at java.lang.Class.forName1(Native Method)
at java.lang.Class.forName(Class.java(Compiled Code))
at java.awt.Toolkit$2.run(Toolkit.java:796)
at java.security.AccessController.doPrivileged1(Native Method)
at java.security.AccessController.doPrivileged(AccessController.java(Compiled Code))
at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:787)
at javax.swing.ImageIcon.<init>(ImageIcon.java:111)
at javax.swing.ImageIcon.<init>(ImageIcon.java:137)
at com.yc.ycportal.util.WaterMark.createMark(WaterMark.java:21)
at com.yc.ycportal.util.Upload.doPost(Upload.java:106)
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code))
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code))
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code))
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java(Compiled Code))
解决问题源文章如下:
Reason
This is most likely because the server doesn't have a graphical subsystem (i.e. a graphics card and monitor). The Flex server uses Java's AWT (Abstract Window Toolkit) to implement compile time image embedding and SVG. By default, the Java Virtual Machine tries to use the hardware-based graphical capabilities of the machine to implement AWT. For servers without a graphical interface, the above error will be thrown.
Solution
To resolve this issue, set the system propertyjava.awt.headless to true so that the JVM will implement AWT in software, rather than attempting to use non-existent hardware-based graphics.
Note: java.awt.headless is only available with JDK 1.4 and above. It is not available on previous versions of the JDK.
There are two ways to set java.awt.headless to true:
- Using the command line:
-Djava.awt.headless=true
- Configuring in /WEB-INF/flex/flex-config.xml as:
<compiler><headless-server>true</headless-server></compiler>
Note: java.awt.headless should only be set to true if no graphics card exists on your machine. If you set this property to true when a graphics card exists, it will cause the cfchart
tag in ColdFusion to throw an error.
If you are using WebSphere on Linux, you must set -Djava.awt.headless=true in the WebSphere administrator. Select Application Servers >your server instance> Process Definition > Java Virtual Machine > Generic JVM arguments, then add the setting.
You may see the following error if it is not set when you request the sample data model:
sun/awt/motif/MToolkit
Technical Information:
HTTP Status Code: 500
Exception Type: class java.lang.NoClassDefFoundError
Servlet Name: FlexMxmlServlet
Exception java.lang.NoClassDefFoundError
sun/awt/motif/MToolkit (View stack trace)Actual Results:
HTTP Status Code: 500Exception Type: class java.lang.NoClassDefFoundError Servlet
Name: FlexMxmlServlet
After you restart your server, the sample should work. If you still see the error, delete all your temporary internet files so that your browser is not serving up the cached page.
翻译如下:问题产生的原因最大可能是因为服务器没有一个图形设备。JAVA虚拟机试图通过硬件图形设备来实现AWT,所以服务器没有图形设备接口的就会抛出上面的错误。
解决办法:为了解决这个问题,设置系统属性java.awt.headless 为:true 从而使JVM用软件来实现SWT,而不是尝试使用已经存在的硬件来实现。
注意:java.awt.headless 这个属性仅仅当JDK大于等于1.4才可以使用。早期版本没有。
两种方法来实现设置java.awt.headless 这个为true
1.使用命令行:
-Djava.awt.headless=true
2.配置/WEB-INF/flex/flex-config.xml 如下:
<compiler><headless-server>true</headless-server></compiler>
注意:没有图形设备时应该设置成true;如果有图形设备会引起代码溢出错误
如果使用的是linux websphere,你必须设置-Djava.awt.headless=true 在websphere的管理控制台。
应用程序服务器 > server1 > 进程定义 > 一般 JVM 自变量
-Djava.awt.headless=true
修改后重新启动服务器,就应该好了,如果还有问题清除临时文件,就应该没有问题了。
分享到:
相关推荐
SyncApps\3d9ac40c-bcc2-49fd-a5fb-0abe3e5da50d.dsm - SyncApps - 7.0.0.6077 Start\bdaa2dd3-8d92-4994-b468-2f0fb4da9c9d.dsm - Start - 7.0.0.6077 SSPI\36f0218d-c900-43f4-ac08-7fc437844ec6.dsm - SSPI - 7.0...
Key:93E1B27C-47BA02BA-4328A229-587D2579-3B3BF5CE-75F6D43F-6B621E6E service@inmail.at A1178145VB3KQAII 93E1B27C-47BA02BA-4328A229-587D2579-3B3BF5CE-75F6D43F-6B621E6E service@inmail.at ...
利用win32gui、win32con、win32api和pyqt5编写,有代码源文件(.py) 已经打包为exe可执行文件32/64位 只能在windows7运行!win10运行黑屏! 为带有操作页面的windows7程序 是很好的Pyqt5实战项目,自用也很方便 ...
/20200207/dbd6a465c05987de92eadb3f5625b1e7.rar
如有任何问题、错误报告或功能请求,请随时访问论坛选项卡。 注意:要模拟箭头键,您可能需要关闭 NumLock。 VirusTotal 结果:...
用于进化算法的嵌入式数据存储引擎EADB(Evolutionary Algorithm Database)提供了简便灵活的数据存储接口,通过使用内存映射文件技术来实现数据的快速和大量存储。相较于传统文件I/O存储方式和一般的通用数据存储...