Bug 1311132

Summary: Error using Cobertura plugin with Fedora 23 jenkins
Product: [Fedora] Fedora Reporter: Aaron Conole <aconole>
Component: jenkinsAssignee: Michal Srb <msrb>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 23CC: java-sig-commits, mizdebsk, msrb
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: jenkins-1.625.3-3.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-17 20:54:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Aaron Conole 2016-02-23 13:10:07 UTC
Description of problem:
Cobertura plugin fails with the fedora23 bundled jenkins


Version-Release number of selected component (if applicable):
Jenkins - 1.625.3
Cobertura plugin - 1.9.7


How reproducible:
Very


Steps to Reproduce:
1. installed jenkins from the Fedora 23 repository.
2. installed cobertura plugin, and git client plugin
3. Added a single job building a c/makefile project (openvswitch).
4. Used gcovr to make a cobertura coverage.xml file from the unit test output
5. Added 'Publish Cobertura Coverage results' post-build action

Actual results:
Got the following exception:
Running gcov: 'gcov /var/lib/jenkins/jobs/openvswitch-build/workspace/lib/dirs.gcda --branch-counts --branch-probabilities --preserve-paths --object-directory /var/lib/jenkins/jobs/openvswitch-build/workspace/lib' in '/var/lib/jenkins/jobs/openvswitch-build/workspace/lib'
Parsing coverage data for file /var/lib/jenkins/jobs/openvswitch-build/workspace/lib/dirs.c.in

Parsing coverage data for file /var/lib/jenkins/jobs/openvswitch-build/workspace/include/openvswitch/thread.h
Gathered coveraged data for 302 files
[Cobertura] Publishing Cobertura coverage report...
ERROR: Step ‘Publish Cobertura Coverage Report’ aborted due to exception:
java.lang.NoClassDefFoundError: org/codehaus/stax2/XMLInputFactory2
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:421)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:383)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:370)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at javax.xml.stream.FactoryFinder$1.run(FactoryFinder.java:353)
at java.security.AccessController.doPrivileged(Native Method)
at javax.xml.stream.FactoryFinder.findServiceProvider(FactoryFinder.java:341)
at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:313)
at javax.xml.stream.FactoryFinder.find(FactoryFinder.java:227)
at javax.xml.stream.XMLInputFactory.newInstance(XMLInputFactory.java:154)
at hudson.plugins.cobertura.CoberturaPublisher$ParseReportCallable.invoke(CoberturaPublisher.java:538)
at hudson.plugins.cobertura.CoberturaPublisher$ParseReportCallable.invoke(CoberturaPublisher.java:525)
at hudson.FilePath.act(FilePath.java:991)
at hudson.FilePath.act(FilePath.java:969)
at hudson.plugins.cobertura.CoberturaPublisher.perform(CoberturaPublisher.java:343)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:45)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:785)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:726)
at hudson.model.Build$BuildExecution.post2(Build.java:185)
at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:671)
at hudson.model.Run.execute(Run.java:1766)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:98)
at hudson.model.Executor.run(Executor.java:408)
Caused by: java.lang.ClassNotFoundException: org.codehaus.stax2.XMLInputFactory2
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:430)
at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:383)
... 36 more
Finished: FAILURE


Expected results:
Cobertura plugin would be able to run with all dependencies satisfied


Additional info:
Installing Jenkins from the official repo fixed this problem.
I tried the following (before making that change):
* Modifying the cobertura plugin pom.xml to include the stax2 dependency
* Adding the stax2 jar contents to the plugin classes/ directory
* Adding the stax2 jar to the plugin lib/ directory
* Uninstalling/reinstalling the cobertura plugin

Comment 1 Michal Srb 2016-03-02 19:05:14 UTC
Thanks for the detailed bug report Aaron.

Comment 2 Fedora Update System 2016-03-03 13:02:20 UTC
jenkins-1.625.3-3.fc23 jenkins-remoting-2.53.3-1.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2016-641c8b4eb2

Comment 3 Fedora Update System 2016-03-03 21:57:43 UTC
jenkins-1.625.3-3.fc23, jenkins-remoting-2.53.3-1.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-641c8b4eb2

Comment 4 Fedora Update System 2016-03-17 20:54:18 UTC
jenkins-1.625.3-3.fc23, jenkins-remoting-2.53.3-1.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.