wang2222 2010-01-13 09:06 采纳率: 0%
浏览 367
已采纳

jboss运行程序出错

jboss+seam+jsf开发遇到这样一个问题,虽然出这样的错误,但运行不受影响,
ERROR [[default]] Servlet.service() for servlet default threw exception
java.lang.NoClassDefFoundError: Could not initialize class sun.awt.Win32GraphicsEnvironment
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(Unknown Source)
at java.awt.image.BufferedImage.createGraphics(Unknown Source)
at org.ajax4jsf.resource.Java2Dresource.getImage(Java2Dresource.java:115)
at org.ajax4jsf.resource.Java2Dresource.send(Java2Dresource.java:89)
at org.ajax4jsf.resource.ResourceLifecycle.sendResource(ResourceLifecycle.java:215)
at org.ajax4jsf.resource.ResourceLifecycle.send(ResourceLifecycle.java:154)
at org.ajax4jsf.resource.InternetResourceService.load(InternetResourceService.java:335)
at org.ajax4jsf.cache.LRUMapCache.load(LRUMapCache.java:116)
at org.ajax4jsf.cache.LRUMapCache.get(LRUMapCache.java:87)
at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:195)
at org.ajax4jsf.resource.InternetResourceService.serviceResource(InternetResourceService.java:141)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:488)
at org.jboss.seam.web.Ajax4jsfFilter.doFilter(Ajax4jsfFilter.java:56)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.web.LoggingFilter.doFilter(LoggingFilter.java:60)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:69)
at org.jboss.seam.servlet.SeamFilter$FilterChainImpl.doFilter(SeamFilter.java:73)
at org.jboss.seam.servlet.SeamFilter.doFilter(SeamFilter.java:158)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Unknown Source)
不知怎么解决

  • 写回答

4条回答 默认 最新

  • wocsok 2010-01-13 10:35
    关注

    是jboss在运行时没有找到这个JAR,把这个JAR放到能加载的地方就行,如果你觉得jboss的加载顺序不太爽,你也可以自己配置下,让它按你的顺寻加载,就不会出现这种找不到的错误了。最简单的方法就是把JAR放到war里,让JBOSS找到这个类就好了。
    下面是我以前总结的,希望对你有帮助:
    如果JAR得顺序平级 就按字典顺序加载。 注意此方法可以写个自己的排序 并配置在JBOSS-SERVICE.XML文件里。
    如果需要获取Jboss的配置信息可以从 org.jboss.system.server.ServerConfigLocator获取。

    还有个问题,如果要让自己写的类能加载,还需要修改启动参数:

    set JAVA_OPTS=%JAVA_OPTS% -Djboss.boot.library.list=log4j-boot.jar,jboss-common.jar,jboss-system.jar,jboss-xml-binding.jar,namespace.jar,xxx.jar

    在原来几个jar包基础上增加自己的xxx.jar。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 爬取网页内容并保存需要完整的python代码
  • ¥30 NIRfast软件使用指导
  • ¥20 matlab仿真问题,求功率谱密度
  • ¥15 求micropython modbus-RTU 从机的代码或库?
  • ¥15 铜与钢双金属板叠加在一起每种材料300mm长,18mm宽,4mm厚一端固定并加热至80℃,当加热端温度保持不变时另一端的稳态温度。ansys
  • ¥15 django5安装失败
  • ¥15 Java与Hbase相关问题
  • ¥15 后缀 crn 游戏文件提取资源
  • ¥15 ANSYS分析简单钎焊问题
  • ¥20 bash代码推送不上去 git fetch origin master #失败了