我在windows上创建了jsf应用程序,它运行正常。我将工作环境改为linux。现在我在我的应用程序上单击了一个fileupload控件(富面),它正在抛出应用程序错误
java.awt.HeadlessException异常。
请帮帮我。我是linux的新手。
提前致谢
堆栈跟踪
2011-03-07 08:43:34,856警告[javax.enterprise.resource.webcontainer.jsf.lifecycle]#{ServiceRequestProfilePM.addNewProfile}:java.awt.HeadlessException:
未设置X11 DISPLAY变量,但此程序执行了需要它的操作。
javax.faces.FacesException:#{ServiceRequestProfilePM.addNewProfile}:java.awt.HeadlessException:
未设置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)
引起:javax.faces.el.EvaluationException:java.awt.HeadlessException:
未设置X11 DISPLAY变量,但此程序执行了需要它的操作。
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
... 37 more
引起:java.awt.HeadlessException:
未设置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)
答案 0 :(得分:-1)
你能发布更多的堆栈跟踪吗?是下一行:
未设置X11 DISPLAY变量,但此程序执行了需要它的操作。
如果有,请尝试将-Djava.awt.headless=true
添加到您的JAVA_OPTS并重新启动您的应用服务器。
答案 1 :(得分:-1)
需要两个步骤:
启用X11转发:使用Putty,创建新会话并启用以下设置Connection > SSH > X11
选中复选框X11 forwarding
。
安装一些XServer:安装XMing Server并在会话期间保持运行。
GUI将通过XMing
进行隧道传输