Issue 12811: Document issue with Tomcat and JFreeChart under Troubleshooting

issues
Status:closed
Assigned To:Guest
Type:Documentation
Area:Core
Priority:4
Milestone:11.3
Opened:2011-08-04 17:02 by Kristin
Changed:2011-11-30 18:21 by Kristin
Resolved:2011-11-16 17:13 by Brian Connolly
Resolution:Won't Fix
Support Ticket: 
Pull Requests:
Closed:2011-11-30 18:21 by Kristin
2011-08-04 17:02 Kristin
Title»Document issue with Tomcat and JFreeChart under Troubleshooting
Assigned To»Brian Connolly
Type»Documentation
Area»Core
Priority»4
Milestone»11.3
Potential problem that a user could run into if running on a Linux server (from http://web-cat.org/WCWiki/WebCatFaq#head-c3c4d636eba9f5e6d1b97ae9163a847c68e1650d).

Would be great to document the workaround in our troubleshooting section.

--------------------------------------

Error: java.lang.NoClassDefFoundError
Reason: Could not initialize class org.jfree.chart.JFreeChart

Or possibly:

Error: java.lang.NoClassDefFoundError
Reason: Could not initialize class sun.awt.X11GraphicsEnvironment

If this occurs, check the environment variables for the pseudo-user under which Tomcat is running. Check for any definition for the DISPLAY environment variable that is visible to Tomcat, an remove any such definitions.

This problem appears to be caused internally in Sun's AWT implementation, where Java is trying to connect to the X11 display identified by the DISPLAY environment variable, but the user id under which Tomcat is running does not have permission to connect (or there is no active DISPLAY). Removing the environment variable setting for the Tomcat user will fix this problem. You may also need to add -Djava.awt.headless=true to Tomcat's startup arguments as well.

2011-11-16 17:13 Brian Connolly
resolve as Won't Fix
Statusopen»resolved
Assigned ToBrian Connolly»kristinf
We cannot tell users to delete the DISPLAY variable as it is needed for R... which is pretty much required now.

Do you still have a way of repro-ing this on labkey.org that you can send me? I can then figure out a work around that will work for the LabKey server.


2011-11-30 10:52 Kristin
Forgot to include exception info initially:

Created from crash report: https://www.labkey.org/mothership/_mothership/showStackTraceDetail.view?exceptionStackTraceId=7159

java.lang.NoClassDefFoundError: Could not initialize class org.jfree.chart.JFreeChart
    at org.jfree.chart.ChartFactory.createStackedBarChart(ChartFactory.java:698)
    at org.labkey.core.admin.AdminController$MemoryChartAction.export(AdminController.java:2450)
    at org.labkey.core.admin.AdminController$MemoryChartAction.export(AdminController.java:2407)
    at org.labkey.api.action.ExportAction.getView(ExportAction.java:41)
    at org.labkey.api.action.SimpleViewAction.handleRequest(SimpleViewAction.java:61)
    at org.labkey.api.action.BaseViewAction.handleRequestInternal(BaseViewAction.java:166)
    at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
    at org.labkey.api.action.SpringActionController.handleRequest(SpringActionController.java:348)
    at org.labkey.api.module.DefaultModule.dispatch(DefaultModule.java:756)
    at org.labkey.api.view.ViewServlet.service(ViewServlet.java:164)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.labkey.api.data.TransactionFilter.doFilter(TransactionFilter.java:36)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.labkey.core.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:118)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.labkey.api.module.ModuleLoader.doFilter(ModuleLoader.java:609)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.labkey.api.security.AuthFilter.doFilter(AuthFilter.java:143)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)
    at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200)
    at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:291)
    at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:775)
    at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:704)
    at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:897)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
    at java.lang.Thread.run(Thread.java:662)

2011-11-30 18:21 Kristin
close
Statusresolved»closed
Assigned Tokristinf»Guest