gpt4 book ai didi

java - MuleESB - 无法初始化类 sun.awt.SunToolkit

转载 作者:行者123 更新时间:2023-12-01 18:41:48 28 4
gpt4 key购买 nike

我正在尝试按照 Brigilin Stanley 编写的示例通过 cxf 重现创建 Web 服务:http://confluex.com/blog/jax-ws-service-with-cxf-in-mule/

这在 Mule Studio 中运行良好,但是当我部署到 Linux Red Hat 服务器时遇到一个奇怪的问题:

java.lang.NoClassDefFoundError: Could not initialize class sun.awt.SunToolkit
at sun.awt.AppContext$2.run(AppContext.java:271)
at sun.awt.AppContext$2.run(AppContext.java:260)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.AppContext.initMainAppContext(AppContext.java:260)
at sun.awt.AppContext.access$200(AppContext.java:133)
at sun.awt.AppContext$3.run(AppContext.java:316)
at sun.awt.AppContext$3.run(AppContext.java:298)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.AppContext.getAppContext(AppContext.java:297)
at sun.awt.AppContext$6.getContext(AppContext.java:839)
at sun.misc.SharedSecrets.getJavaAWTAccess(SharedSecrets.java:201)
at java.util.TimeZone.getDefaultInAppContext(TimeZone.java:734)
at java.util.TimeZone.getDefaultRef(TimeZone.java:630)
at java.util.Calendar.getInstance(Calendar.java:968)
at org.apache.log4j.helpers.AbsoluteTimeDateFormat.<init>(AbsoluteTimeDa
teFormat.java:62)
at org.apache.log4j.helpers.ISO8601DateFormat.<init>(ISO8601DateFormat.j
ava:46)
at org.apache.log4j.helpers.PatternParser.finalizeConverter(PatternParse
r.java:256)
at org.apache.log4j.helpers.PatternParser.parse(PatternParser.java:186)
at org.apache.log4j.PatternLayout.<init>(PatternLayout.java:438)

有什么想法吗?谢谢

最佳答案

此异常通常表明该服务器没有 X 服务器。要告诉 awt 您处于“ headless ”服务器中,请使用以下 Java 系统属性:-Djava.awt.headless=true

关于java - MuleESB - 无法初始化类 sun.awt.SunToolkit,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19689116/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com