jsf应用程序在jboss上抛出java.awt.headlessexception

时间:2022-01-11 11:17:32

I created jsf application on windows, It is working fine. I changed my working environment to linux. Now I clicked a fileupload control(rich faces) on my application, it is throwing application error

我在windows上创建了jsf应用程序,它运行正常。我将工作环境改为linux。现在我在我的应用程序上单击了一个fileupload控件(富脸),它正在抛出应用程序错误

java.awt.headlessexception.

please help me. I am new to linux.

请帮我。我是linux的新手。

Thanks in advance

提前致谢

Stack Trace

2011-03-07 08:43:34,856 WARNING [javax.enterprise.resource.webcontainer.jsf.lifecycle] #{ServiceRequestProfilePM.addNewProfile}: java.awt.HeadlessException:

2011-03-07 08:43:34,856警告[javax.enterprise.resource.webcontainer.jsf.lifecycle]#{ServiceRequestProfilePM.addNewProfile}:java.awt.HeadlessException:

No X11 DISPLAY variable was set, but this program performed an operation which requires it.

没有设置X11 DISPLAY变量,但是该程序执行了需要它的操作。

javax.faces.FacesException: #{ServiceRequestProfilePM.addNewProfile}: java.awt.HeadlessException:

javax.faces.FacesException:#{ServiceRequestProfilePM.addNewProfile}:java.awt.HeadlessException:

No X11 DISPLAY variable was set, but this program performed an operation which requires it.

没有设置X11 DISPLAY变量,但是该程序执行了需要它的操作。

   at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)

   at javax.faces.component.UICommand.broadcast(UICommand.java:387)

   at org.ajax4jsf.component.UIDataAdaptorBase.broadcast(UIDataAdaptorBase.java:1387)

   at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:329)

   at org.ajax4jsf.component.AjaxViewRoot.broadcastEventsForPhase(AjaxViewRoot.java:304)

   at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:261)

   at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:474)

   at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)

   at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)

   at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

   at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)

   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

   at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:206)

   at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)

   at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:388)

   at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:515)

   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:525)

   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.ajp.AjpProcessor.process(AjpProcessor.java:436)

   at org.apache.coyote.ajp.AjpProtocol$AjpConnectionHandler.process(AjpProtocol.java:384)

   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)

   at java.lang.Thread.run(Thread.java:619)

Caused by: javax.faces.el.EvaluationException: java.awt.HeadlessException:

引起:javax.faces.el.E​​valuationException:java.awt.HeadlessException:

No X11 DISPLAY variable was set, but this program performed an operation which requires it.

没有设置X11 DISPLAY变量,但是该程序执行了需要它的操作。

   at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)

   at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)

   ... 37 more

Caused by: java.awt.HeadlessException:

引起:java.awt.HeadlessException:

No X11 DISPLAY variable was set, but this program performed an operation which requires it.

没有设置X11 DISPLAY变量,但是该程序执行了需要它的操作。

   at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)

   at java.awt.Window.<init>(Window.java:432)

   at java.awt.Frame.<init>(Frame.java:403)

   at java.awt.Frame.<init>(Frame.java:368)

   at javax.swing.SwingUtilities$SharedOwnerFrame.<init>(SwingUtilities.java:1727)

   at javax.swing.SwingUtilities.getSharedOwnerFrame(SwingUtilities.java:1804)

   at javax.swing.JOptionPane.getRootFrame(JOptionPane.java:1673)

   at javax.swing.JOptionPane.getWindowForComponent(JOptionPane.java:1614)

   at javax.swing.JFileChooser.createDialog(JFileChooser.java:762)

   at javax.swing.JFileChooser.showDialog(JFileChooser.java:714)

   at javax.swing.JFileChooser.showOpenDialog(JFileChooser.java:626)

   at de.db.mepit.recruitment.presentation.ServiceRequestProfilePM.addNewProfile(ServiceRequestProfilePM.java:708)

   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

   at java.lang.reflect.Method.invoke(Method.java:597)

   at org.apache.el.parser.AstValue.invoke(AstValue.java:170)

   at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:276)

   at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)

   at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)

2 个解决方案

#1


-1  

Could you post a bit more of your stacktrace? Is the next line:

你能发布一些你的堆栈跟踪吗?是下一行:

No X11 DISPLAY variable was set, but this program performed an operation which requires it.

没有设置X11 DISPLAY变量,但是该程序执行了需要它的操作。

If so try to add -Djava.awt.headless=true to your JAVA_OPTS and restart your app server.

如果是这样,请尝试将-Djava.awt.headless = true添加到您的JAVA_OPTS并重新启动您的应用服务器。

#2


-1  

Two Steps Required:

需要两个步骤:

  1. Enable X11 Forwarding: USe Putty, create new session with following setting enabled Connection > SSH > X11 check the checkbox X11 forwarding.

    启用X11转发:使用Putty,在启用以下设置的情况下创建新会话连接> SSH> X11选中复选框X11转发。

  2. Install some XServer: Install XMing Server and keep it running during the session.

    安装一些XServer:安装XMing Server并在会话期间保持运行。

The GUI will be tunneled through XMing

GUI将通过XMing进行隧道传输

#1


-1  

Could you post a bit more of your stacktrace? Is the next line:

你能发布一些你的堆栈跟踪吗?是下一行:

No X11 DISPLAY variable was set, but this program performed an operation which requires it.

没有设置X11 DISPLAY变量,但是该程序执行了需要它的操作。

If so try to add -Djava.awt.headless=true to your JAVA_OPTS and restart your app server.

如果是这样,请尝试将-Djava.awt.headless = true添加到您的JAVA_OPTS并重新启动您的应用服务器。

#2


-1  

Two Steps Required:

需要两个步骤:

  1. Enable X11 Forwarding: USe Putty, create new session with following setting enabled Connection > SSH > X11 check the checkbox X11 forwarding.

    启用X11转发:使用Putty,在启用以下设置的情况下创建新会话连接> SSH> X11选中复选框X11转发。

  2. Install some XServer: Install XMing Server and keep it running during the session.

    安装一些XServer:安装XMing Server并在会话期间保持运行。

The GUI will be tunneled through XMing

GUI将通过XMing进行隧道传输