Jenkins上的性能图导致“无法初始化类org.jfree.chart.JFreeChart".例外情况 [英] Performance graphs on Jenkins causing "Could not initialize class org.jfree.chart.JFreeChart" exceptions
问题描述
当 Jenkins 尝试生成 Performance Trends图时,总是会引发一些具有根本原因的异常:" java.lang.NoClassDefFoundError: Could not initialize class org.jfree.chart.JFreeChart
"
When Jenkins tries to generate the Performance Trends graphs there launches several exceptions always with root cause: "java.lang.NoClassDefFoundError: Could not initialize class org.jfree.chart.JFreeChart
"
这就是我所做的:
- 部署了Jenkins,并尝试使用 v1.532.2 ( stable )和 v1.539-SNAPSHOT
-
- 未配置安全性
- desployed Jenkins , tried with v1.532.2 (stable) and also with v1.539-SNAPSHOT
- didn't configured security
- 只需设置我的JDK(Oracle的jdk1.7.0_51),MAVEN(3.1.1)和GIT(1.8.1.2)的路径
- Checkstyle v3.39
- Jenkins Cobertura v1.9.3
- FindBugs v4.51
- 警告v4.39
- PMD v3.38
- 性能v.1.10
- Jenkins Git客户端v1.6.2
- Jenkins Git 2.0.1
然后,我创建了一个项目,该项目使用插件 jmeter-maven-plugin v1.9.0 从Java Web应用程序成功创建了JMeter报告文件,但是没有在项目页面上显示性能趋势"图.詹金斯(Jenkins)确实收集了结果,因为它显示了我的响应时间,但无法显示图表.总是使用根本原因启动多个异常:"
java.lang.NoClassDefFoundError: Could not initialize class org.jfree.chart.JFreeChart
".在这里,您将找到完整的StackTrace: http://pastebin.com/uhiNR7XDThen I created a project which successfully creates a JMeter report file from my Java webapp using the plugin jmeter-maven-plugin v1.9.0, but there doesn't appear the Performance Trend graphs on the project's page. Jenkins really gathers the results because it shows me the response times, but can't show me the graphs. There launches several Exceptions always with root cause: "
java.lang.NoClassDefFoundError: Could not initialize class org.jfree.chart.JFreeChart
" . Here you will find a complete StackTrace: http://pastebin.com/uhiNR7XDJenkins已经在
/WEB-INF/lib/
上具有 jcommon-1.0.12.jar 和 jfreechart-1.0.9.jar . 此其他帖子不适用.Jenkins already has jcommon-1.0.12.jar and jfreechart-1.0.9.jar at it's
/WEB-INF/lib/
. This other post doesn't apply.可以帮我吗?
提前谢谢!
/天使
推荐答案
Solved! Somebody helped me to solve it here : https://groups.google.com/forum/#!topic/jenkinsci-users/o_Dr7Tn0i3U
这不是詹金斯(Jenkins)的错误,而是配置错误.解决方案只是添加
-Djava.awt.headless=true
到Jenkin的运行时.It's not a bug in Jenkins but a miss-configuration. The solution is just adding
-Djava.awt.headless=true
to Jenkin's runtime.我在Tomcat上将Jenkins作为Web应用程序运行,然后我将此行添加到了/opt/tomcat/bin/catalina.sh :
CATALINA_OPTS=-Djava.awt.headless=true
I'm running Jenkins as a webapp on my Tomcat, then I just added this line to my /opt/tomcat/bin/catalina.sh :
CATALINA_OPTS=-Djava.awt.headless=true
我希望您分享此解决方案.来自巴塞罗那的欢呼声.
I wanted you to share this solution. Cheers from Barcelona.
/天使
这篇关于Jenkins上的性能图导致“无法初始化类org.jfree.chart.JFreeChart".例外情况的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!