cancel
Showing results for 
Search instead for 
Did you mean: 

'No X11 DISPLAY' Exception running 5.4 on Linux

bernd_ruecker
Champ in-the-making
Champ in-the-making
We tested the current 5.4 tag on our production Linux machine (without X) and got the following exception when trying to access any web app, anybody any idea what that is and how we can disable it? The problem first occured with 5.4, 5.2 did work…


javax.servlet.ServletException: Servlet.init() for servlet Spring MVC Dispatcher Servlet threw exception
   org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)
   org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)
   org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
   org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
   org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)

root cause

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'scriptDebugger' defined in URL [jar:file:/home/tomcat/Tomcat/tomcat-6.0.29/webapps/activiti-cycle/WEB-INF/lib/spring-webscripts-1.0.0-RC2.jar!/org/springframework/extensions/webscripts/spring-webscripts-application-context.xml]: Invocation of init method failed; nested exception is java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1401)
   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
   org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
   org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
   org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
   org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
   org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
   org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
   org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
   org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
   org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
   org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
   org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
   javax.servlet.GenericServlet.init(GenericServlet.java:212)
   org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)
   org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)
   org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
   org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
   org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)

root cause

java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
   java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
   java.awt.Window.<init>(Window.java:431)
   java.awt.Frame.<init>(Frame.java:403)
   javax.swing.JFrame.<init>(JFrame.java:202)
   org.mozilla.javascript.tools.debugger.SwingGui.<init>(SwingGui.java:152)
   org.springframework.extensions.webscripts.ScriptDebugger$AlfrescoGui.<init>(ScriptDebugger.java:159)
   org.springframework.extensions.webscripts.ScriptDebugger.activate(ScriptDebugger.java:80)
   org.springframework.extensions.webscripts.ScriptDebugger.start(ScriptDebugger.java:61)
   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   java.lang.reflect.Method.invoke(Method.java:597)
   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1529)
   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1468)
   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:512)
   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:450)
   org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:290)
   org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
   org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:287)
   org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
   org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:557)
   org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:842)
   org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:416)
   org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:443)
   org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:459)
   org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:340)
   org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:307)
   org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
   javax.servlet.GenericServlet.init(GenericServlet.java:212)
   org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:195)
   org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:159)
   org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:141)
   org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:90)
   org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:417)
6 REPLIES 6

frederikherema1
Star Contributor
Star Contributor

frederikherema1
Star Contributor
Star Contributor

gerardo1
Champ in-the-making
Champ in-the-making
Hi all,

in order to solve the issue, I defined the logger:

<logger name="org.springframework.extensions.webscripts.ScriptDebugger">
  <level value="info" />
</logger>
I added this logger to the log4j.xml in the WEB-INF/classes-folder of the four web-apps:
  • activiti-cycle

  • activiti-rest

  • activiti-probe

  • activiti-explorer
I even defined a log4j.xml in the ${TOMCAT_HOME}/conf.

Nothing changed. I still get the BeanInstantiation-Exception and the resulting headless-Exception.

Is there anything else I have to do? Maybe you have another advice for me?

Best Regards,

Gerardo

PS: The root-logger of the activiti-explorer, -cycle, -probe was already assigned to log-level=WARN. The ScriptDebugger should already be affected by the root-logger, shouldn't it. And because WARN is lower than DEBUG the scriptDebugger-Bean should not be instantiated in the first place. Did I miss something?

frederikherema1
Star Contributor
Star Contributor
Gerardo,

I'm also puzzled by this, the debugger shouldn't be started in the first place…

bernd_ruecker
Champ in-the-making
Champ in-the-making
Hi Frederik.

In the meanwhile we found the root source: A log4j.jar in the tomcat lib (required by a JIRA deployed on the server as well) caused no log4j configuration being read from the places we expected. Then the default was DEBUG, which caused this bug to be fired.  Seems we need a dedicated TOmcat for it (on JBoss the webapps are still not running)…

Thanks for your help!
Cheers
Bernd

hewlet
Champ in-the-making
Champ in-the-making
Hi all,

in order to solve the issue, I defined the logger:

<logger name="org.springframework.extensions.webscripts.ScriptDebugger">
  <level value="info" />
</logger>
I added this logger to the log4j.xml in the WEB-INF/classes-folder of the four web-apps:
  • activiti-cycle

  • activiti-rest

  • activiti-probe

  • activiti-explorer
I even defined a log4j.xml in the ${TOMCAT_HOME}/conf.

Nothing changed. I still get the BeanInstantiation-Exception and the resulting headless-Exception.

Is there anything else I have to do? Maybe you have another advice for me?

Best Regards,

Gerardo

PS: The root-logger of the activiti-explorer, -cycle, -probe was already assigned to log-level=WARN. The ScriptDebugger should already be affected by the root-logger, shouldn't it. And because WARN is lower than DEBUG the scriptDebugger-Bean should not be instantiated in the first place. Did I miss something?
Will try it myself to make out what's the  reason.
~hewlet