Sonarcloud with travis, upload cppunit xml reports has some error


(Freeeyes) #1

Template for a good bug report:

  • versions used (SonarQube, Scanner, Plugin, and any relevant extension)
    sonar-scanner-3.0.3.778(travis addons version)

  • error observed
    [sonar error log]

    07:38:50.969 INFO: Sensor gcov [cpp] (done) | time=984ms
    07:38:50.969 INFO: Sensor cppunit [cpp]
    07:38:50.974 INFO: ------------------------------------------------------------------------
    07:38:50.974 INFO: EXECUTION FAILURE
    07:38:50.974 INFO: ------------------------------------------------------------------------
    07:38:50.975 INFO: Total time: 12.715s
    07:38:51.174 INFO: Final Memory: 61M/297M
    07:38:51.174 INFO: ------------------------------------------------------------------------
    07:38:51.174 ERROR: Error during SonarQube Scanner execution
    java.lang.NoClassDefFoundError: org/sonar/api/utils/StaxParser$XmlStreamHandler
    at com.sonar.cpp.plugin.A.B.execute(na:2017)
    at org.sonar.scanner.sensor.SensorWrapper.analyse(SensorWrapper.java:45)
    at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:88)
    at org.sonar.scanner.phases.SensorsExecutor.execute(SensorsExecutor.java:62)
    at org.sonar.scanner.phases.AbstractPhaseExecutor.execute(AbstractPhaseExecutor.java:74)
    at org.sonar.scanner.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:166)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
    at org.sonar.scanner.scan.ProjectScanContainer.scan(ProjectScanContainer.java:300)
    at org.sonar.scanner.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:295)
    at org.sonar.scanner.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:269)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
    at org.sonar.scanner.task.ScanTask.execute(ScanTask.java:48)
    at org.sonar.scanner.task.TaskContainer.doAfterStart(TaskContainer.java:82)
    at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
    at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
    at org.sonar.scanner.bootstrap.GlobalContainer.executeTask(GlobalContainer.java:131)
    at org.sonar.batch.bootstrapper.Batch.doExecuteTask(Batch.java:116)
    at org.sonar.batch.bootstrapper.Batch.executeTask(Batch.java:111)
    at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:63)
    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.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
    at com.sun.proxy.$Proxy0.execute(Unknown Source)
    at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:233)
    at org.sonarsource.scanner.api.EmbeddedScanner.runAnalysis(EmbeddedScanner.java:151)
    at org.sonarsource.scanner.cli.Main.runAnalysis(Main.java:123)
    at org.sonarsource.scanner.cli.Main.execute(Main.java:77)
    at org.sonarsource.scanner.cli.Main.main(Main.java:61)
    Caused by: java.lang.ClassNotFoundException: org.sonar.api.utils.StaxParser$XmlStreamHandler
    at org.sonar.classloader.ParentFirstStrategy.loadClass(ParentFirstStrategy.java:39)
    at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:87)
    at org.sonar.classloader.ClassRealm.loadClass(ClassRealm.java:76)
    … 32 more
    07:38:51.179 DEBUG: Execution getVersion
    07:38:51.180 DEBUG: Execution stop

  • steps to reproduce
    at sonar-project.properties

     sonar.sources=./
     sonar.cfamily.build-wrapper-output=./Linux_Bin/bw-output
     sonar.cfamily.gcov.reportsPath=./Linux_Bin
     sonar.cfamily.cppunit.reportsPath=./Linux_Bin/reports/cppunit
    
  • potential workaround
    travis

Travis LogURL:https://www.travis-ci.org/freeeyes/PSS/jobs/399015951

github: https://github.com/freeeyes/PSS


(Adam Gabryś) #2

The same as I use sonarcloud with travis,upload cppunit xml reports has some error


(Freeeyes) #3

How do you solve this problem? thanks.


(Adam Gabryś) #4

I didn’t solve it. I added the link to the other topic, so SonarSource folks know that more people hit it.

This class exists in 7.0 branch, but it has been deprecated in 5.6. There is a chance that the class has been removed from SonarCloud - I cannot verify it, because product is not an open source.