Weblogic Jacoco connection error wrong version - maven

I am trying to retrieve coverage dump from weblogic server using maven project.
after running mvn I am getting:
Failed to execute goal org.jacoco:jacoco-maven-plugin:0.7.7.201606060606:report (jacoco-report) on project jacocotest: An error has occurred in JaCoCo report generation. Error while creating report: Cannot read execution data version 0x1006. This version of JaCoCo uses execution data version 0x1007. -> [Help 1]
and in weblogic log:
org.jacoco.agent.rt.internal_6da5971.core.data.IncompatibleExecDataVersionException: Cannot read execution data version 0x1006. This version of JaCoCo uses execution data version 0x1007.
at org.jacoco.agent.rt.internal_6da5971.core.data.ExecutionDataReader.readHeader(ExecutionDataReader.java:129)
at org.jacoco.agent.rt.internal_6da5971.core.data.ExecutionDataReader.readBlock(ExecutionDataReader.java:109)
at org.jacoco.agent.rt.internal_6da5971.core.runtime.RemoteControlReader.readBlock(RemoteControlReader.java:47)
at org.jacoco.agent.rt.internal_6da5971.core.data.ExecutionDataReader.read(ExecutionDataReader.java:92)
at org.jacoco.agent.rt.internal_6da5971.output.TcpConnection.run(TcpConnection.java:59)
at org.jacoco.agent.rt.internal_6da5971.output.TcpServerOutput$1.run(TcpServerOutput.java:63)
at java.lang.Thread.run(Thread.java:724)
in pom I have:
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.7.201606060606</version>
and agent jar,
META-INF\Manifest.mf
Implementation-Version: 0.7.7.201606060606

"0x1006" is the version of data that was produced by JaCoCo versions 0.5.0 - 0.7.4. So check carefully that you don't execute WebLogic Server with an old version of JaCoCo, i.e. what is used in -javaagent parameter for java for start of WebLogic Server.

Related

Sonar error - Metric 'test_data' should not be computed by a Sensor

I'm using Sonar 6.4 with SonarJS 3.1.1 and I have configured Sonar Karma Test report plugin from https://github.com/acwatson/sonar-karma-test-report-plugin to get the test execution results on the Sonar dashboard.
When I trigger an analysis on my Js code, it fails with the following error
Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.0.2:sonar (default-cli) on project webui-parent: Metric 'test_data' should not be computed by a Sensor -> [Help 1]
Please advise.
Thanks.
In SonarQube 6.2 the way test data is handled was changed.
The most recent release of that plugin is nearly 2 years old (Oct 2015). So it looks like it's not compatible with recent releases on SonarQube.

SonarRunner Failing in Java 8

I have a java project with build system as Gradle. Recently we migrated to Java 8. After this migration sonarRunner task started failing with the following error :
05:10:51.823 INFO - Execute Findbugs 2.0.3...
05:10:56.502 INFO - Findbugs output report: /pathtoproject/build/sonar/findbugs-result.xml
The following errors occurred during analysis:
Unable to get XClass for java/util/function/BiConsumer
java.lang.ArrayIndexOutOfBoundsException: 1792
I started googling it and found out Findbugs 2.0.3 does not support I need to upgrade it and it was recommended that I should use Sonar server 5.x.x (my current sonar server is 5.4.x). I have some constraints yet I want my sonarRunner to be successful. Here are my constraints :
I can not upgrade the sonar server version (not in my hand)
Can not downgrade Java version.
I tried to search how to just upgrade the findbugs version in SonarRunner plugin that also I could not find. Please help me.

Inconsistent sonar reports

I ran sonar analysis on a project in two ways
From command prompt using sonar-runner -X command
As a maven goal using sonar:sonar(Java 1.8) and org.codehaus.mojo:sonar-maven-plugin:2.7.1:sonar (java 1.6)
Both scans resulted in two different reports. I don't know why this happened.
Below is my development environment configuration
Maven: 3.0.5
Sonarqube: 3.0.1
Sonar-runner: 2.4
Eclipse: Kepler
Java: 1.6
Sorry guys, my mistake. While analysing from command prompt sonar.source is set to scr. So sonar analysed test code also.
Where as mvn sonar:sonar analysed only src/main/java

local sonar analysis using a remote sonar server

I am doing a sonar analysis from my machine using a sonar instance on a remote server.
Local machine: Window7, apache-maven-3.2.5
Remote sonarcube server: sonarcube Version 3.7.3
I am using below command from command prompt:
mvn sonar:sonar -Dsonar.jdbc.url=<jdbcurl> -Dsonar.host.url=<sonarserver url>
I have defined a sonar profile for running the same
Whe I run the said mvn command, then I am getting below error:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project builder-allmodules: Can not execute SonarQube analysis: Can not execute Findbugs: java.lang.RuntimeException: edu.umd.cs.findbugs.NoClassesFoundToAnalyzeException: No classes found to analyze in mymavenproject\target\classes *xyz.jar *F:\m2\repository\commons-io\commons-io\2.4\commons-io-2.4.jar *abc.jar *lmn.jar aaa.jarbbb.jar *ggg.jar
mymavenproject\target\classes: doesn't have any classes, instead, there is bundled jar at mymavenproject\target\ which contains all the classes
Also, another issue is that it is trying to analyze all the dependent jars also which should not be the case as I need sonar analysis for my project only
Can you let me know what I might be missing?
Because you've included FindBugs rules in your analysis profile, you're required to provide unbundled classes to the analysis.

Integrating sonarqube with Jenkins

I am trying to run sonar sonar:sonar by integrating sonarqube and jenkins. While doing, am getting the below error.
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.6:sonar (default-cli) on project iwm_common: Can not execute SonarQube analysis: org.slf4j.impl.SimpleLoggerFactory cannot be cast to ch.qos.logback.classic.LoggerContext -> [Help 1]
Jenkins version - 1.612
Sonarqube version - 3.6
JDK-1.7.0_76
Maven - 3.1.1
Jenkins WAR is deployed in server A and sonarqube is deployed in server B. I have not installed sonar-jenkins plugin in Jenkins.
Can anyone let me know whether sonar-jenkins plugin is mandatory to be installed in jenkins to integrate jenkins with any sonar server (eg:sonarqube).
If the answer is YES, then after installation of the required plugin, will adding the sonar server (eg:sonarqube) information under Manage Jenkins -> Configure system -> sonar resolve the above error ?
The error is related to sonar-maven-plugin and this plugin is not used in any of the project's pom.xml. Can anyone please explain whether this plugin gets referred as a part of sonar:sonar goal. Thanks.
The versions you specified are not compatible for running sonar analysis.
Please upgrade SonarQube version (current is 5.1.1) which requires
Java 1.7-1.8
SonarQube 5.0 or 5.1.1
Sonar-runner 2.4
Using latest version of sonarqube resolved the issue mentioned.

Resources