Graphics wont initialize

Help
chausel
2009-01-02
2013-04-25
  • chausel
    chausel
    2009-01-02

    Hi Paul,

    first: "Happy new Year"
    second: thank you for your work on domainhealth
    third: i have faced a problem.

    I have deployed DomainHealth on my Windows test machine an all was ok.
    When i deploy this on a Solaris 10 machine and start using it, i get the following error (see below) and i don't get the fancy graphics i see on the windows machine (the core statistics).
    Do you have a clue what to do about that?

    [weblogic.servlet.internal.WebAppServletContext@15767d - appName: 'domainhealth-07', name: 'domainhealth-07.war', context-path: '/domainhealth', spec-version: '2.5'] Root cause of ServletException. java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:169) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:68) at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1135) at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1395) at org.jfree.chart.JFreeChart.createBufferedImage(JFreeChart.java:1376) at domainhealth.display.ChartLineGraphGenerator.writeGraphImage(ChartLineGraphGenerator.java:97) at domainhealth.display.LineChartServlet.processs(LineChartServlet.java:157) at domainhealth.display.LineChartServlet.doGet(LineChartServlet.java:76) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292) at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175) at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498) at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs(Unknown Source) at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180) at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086) at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201) at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

     
    • chausel
      chausel
      2009-01-02

      Hi Paul,

      I solved the problem on my own.

      The parameter you must use in an non-graphics environment is:

      -Djava.awt.headless=true

      then everything runs fine.
      This parameter must be passed as a start parameter to the JVM for the weblogic server.

       
    • Paul Done
      Paul Done
      2009-01-02

      Nice one - I thought I had tested on a headless Solaris box - but maybe it depended on a specific version of Solaris and Java. I'll add your JVM param tip to the FAQ.

      Many Thanks and Happy New Year

      Paul