错误:无法使用“localhost:10.0”作为DISPLAY变量的值连接到X11窗口服务器

时间:2014-04-29 07:47:31

标签: excel spring java-ee window weblogic

除了1个功能的生产环境外,我有2个应用程序正常运行。此功能是简单表格中的excel生成。在我所有的其他环境中,excel的生成是可以的,但是当我尝试在生产环境中使用它时。我的日志中出现此错误,并且在我的应用中出现了错误的错误500

  

2014-04-29 09:27:05,690 [[ACTIVE] ExecuteThread:' 4'对于队列:   ' weblogic.kernel.Default(自我调整)']错误com.btoc.reporting   .web.misc.MiscServletFilter - 错误处理请求   org.springframework.web.util.NestedServletException:处理程序   处理失败;嵌套异常是java.lang.InternalError:可以' Ť   使用' localhost:10.0'连接到X11窗口服务器作为的价值   DISPLAY变量。           在org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:949)           在org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:827)           在org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)           在org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)           在javax.servlet.http.HttpServlet.service(HttpServlet.java:707)           在javax.servlet.http.HttpServlet.service(HttpServlet.java:820)           在weblogic.servlet.internal.StubSecurityHelper $ ServletServiceAction.run(StubSecurityHelper.java:227)           在weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)           在weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)           在weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:183)           在weblogic.servlet.internal.RequestDispatcherImpl.invokeServlet(RequestDispatcherImpl.java:523)           在weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImpl.java:253)           at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)           在org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)           at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)           at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)           at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)           在weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)           在com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:65)           在weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)   147)           在org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)           在weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)           在org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:311)           在org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)   )           在org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)           在org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)           在org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)           在org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:101)           在org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)   AVA:113)           在org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)   ationFilter.java:139)           在org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)   eRequestFilter.java:54)           在org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)           在org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)           在org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)   ProcessingFilter.java:182)           在org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)           在org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:105)           在org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)   VA:87)           在org.springframework.security.web.FilterChainProxy $ VirtualFilterChain.doFilter(FilterChainProxy.java:323)           在org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:173)

我可以遵循哪些线索?我已经比较了我所有的java版本。就像我使用weblogic服务器一样,我所有的java版本都是一样的。

我正在使用(针对excel一代)来自 apache 的API:

<dependency>
    <groupId>org.apache.poi</groupId>
    <artifactId>poi</artifactId>
    <version>3.7</version>
</dependency>

2 个答案:

答案 0 :(得分:6)

您可以尝试以下几种选择:

  • 在启动时指定-Djava.awt.headless=true参数(适用于您的应用程序或服务器本身在Server Start选项卡或startWebLogic.sh的JVM_ARGS中。

  • 在启动weblogic服务器之前尝试export DISPLAY=:0

  • 检查X服务器是否在另一个端口上运行

  • 尝试在启动服务器之前完全取消设置显示unset DISPLAY

答案 1 :(得分:1)

一个简单的解决方案是执行以下命令:

unset DISPLAY

重新开始申请。