Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-39636

Could not initialize class org.jfree.chart.JFreeChart

    Details

    • Type: Bug
    • Status: Reopened (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Component/s: core
    • Labels:
      None
    • Environment:
      Debian Testing
      Jenkins 2.19.2
      Java 1.8.0_111
    • Similar Issues:

      Description

      All graphs in Jenkins (eg. /buildTimeGraph/png) result in this error: "javax.servlet.ServletException: java.lang.NoClassDefFoundError: Could not initialize class org.jfree.chart.JFreeChart"

      JENKINS-21839 looked similar, but I've confirmed that -Djava.awt.headless=true is already being passed to the Java process.

      Full stack trace:

      javax.servlet.ServletException: java.lang.NoClassDefFoundError: Could not initialize class org.jfree.chart.JFreeChart
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:796)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      	at org.kohsuke.stapler.MetaClass$3.doDispatch(MetaClass.java:196)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      	at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:233)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      	at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:233)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
      	at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1669)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:135)
      	at hudson.plugins.greenballs.GreenBallFilter.doFilter(GreenBallFilter.java:59)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:132)
      	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:126)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:86)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      	at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      	at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
      	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:553)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
      	at org.eclipse.jetty.server.Server.handle(Server.java:499)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
      	at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:544)
      	at winstone.BoundedExecutorService$1.run(BoundedExecutorService.java:77)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      	at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NoClassDefFoundError: Could not initialize class org.jfree.chart.JFreeChart
      	at org.jfree.chart.ChartFactory.createStackedAreaChart(ChartFactory.java:1124)
      	at hudson.model.Job$3.createGraph(Job.java:1402)
      	at hudson.util.Graph.render(Graph.java:93)
      	at hudson.util.Graph.doPng(Graph.java:120)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:498)
      	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:324)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:167)
      	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:100)
      	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:124)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
      	... 68 more
      

        Attachments

          Activity

          Hide
          benbrummer Benjamin Brummer added a comment -

          I can confirm on Ubuntu using the openjdk-8-jdk solves this problem.

          Show
          benbrummer Benjamin Brummer added a comment - I can confirm on Ubuntu using the openjdk-8-jdk solves this problem.
          Hide
          andreasmandel Andreas Mandel added a comment -

          Not using the -headless install of the openjdk solved this here on ubuntu (apt install openjdk-8-jre).

          Show
          andreasmandel Andreas Mandel added a comment - Not using the -headless install of the openjdk solved this here on ubuntu ( apt install openjdk-8-jre ).
          Hide
          manuel_steurer Manuel Steurer added a comment -

          Using oracle jdk instead of open jdk solved it for me.

          Show
          manuel_steurer Manuel Steurer added a comment - Using oracle jdk instead of open jdk solved it for me.
          Hide
          tamasgal Tamas Gal added a comment -

          Commenting out the `assistive_technologies` line in `/etc/java-8-openjdk/accessibility.properties` solved it.

          Show
          tamasgal Tamas Gal added a comment - Commenting out the `assistive_technologies` line in `/etc/java-8-openjdk/accessibility.properties` solved it.
          Hide
          tamasgal Tamas Gal added a comment -

          I am also using Jenkins ver. 2.107.2 on Debian9 and have the same problem, but `libfontconfig` was already installed:

          Note, selecting 'libfontconfig1' instead of 'libfontconfig'
          libfontconfig1 is already the newest version (2.11.0-6.7+b1).

          I installed `libxext6 libxrender1 fontconfig libfontconfig` but it didn't help. After that I also installed `libjfreechart-java` but I still have the same problem.

          This is the top of the stack trace, which is printed when I open the image in a new tab:

          java.lang.NoClassDefFoundError: Could not initialize class org.jfree.chart.JFreeChart at org.jfree.chart.ChartFactory.createStackedAreaChart(ChartFactory.java:1124)

          Show
          tamasgal Tamas Gal added a comment - I am also using Jenkins ver. 2.107.2 on Debian9 and have the same problem, but `libfontconfig` was already installed: Note, selecting 'libfontconfig1' instead of 'libfontconfig' libfontconfig1 is already the newest version (2.11.0-6.7+b1). I installed `libxext6 libxrender1 fontconfig libfontconfig` but it didn't help. After that I also installed `libjfreechart-java` but I still have the same problem. This is the top of the stack trace, which is printed when I open the image in a new tab: java.lang.NoClassDefFoundError: Could not initialize class org.jfree.chart.JFreeChart at org.jfree.chart.ChartFactory.createStackedAreaChart(ChartFactory.java:1124)

            People

            • Assignee:
              Unassigned
              Reporter:
              daniel15 Daniel Lo Nigro
            • Votes:
              6 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

              • Created:
                Updated: