Sonar 5.1.1 "Unable to create symbol table" error - sonarqube

I'm running a sonarqube server version 5.1.1, and when running maven analyzer with "mvn sonar:sonar" I get the following error:
[ERROR] [12:54:13.778] Unable to create symbol table for : /Users/rodrigouchoa/Java/git/spread/mj/wicket-exemplo/Build/Codigos_Fonte/wicket-exemplo-parent/wicket-exemplo-web/src/main/java/br/gov/mj/wicket/exemplo/web/service/SegurancaService.java
java.lang.IllegalStateException: Could not resolve type parameter: PK in class IGenericPersister
Is there a solution for this issue?

The java plugin for sonarqube was recently updated. Try to update it and check if the problem is fixed.

Related

Liquibase customPrecondition causes maven plugin to fail

We have our liquibase scripts setup in a maven project and we are using the liquibase maven plugin to execute the scripts on deploy of our software.
We need to ensure that only the liquibase scripts relevant to the version of the software being deployed are run.
I have created a custom PreCondition in liquibase for each changeset as follows:
<preConditions onFail="CONTINUE">
<customPrecondition className="class.CompatibleVersion">
<param name="version" value="1.0.0"/>
</customPrecondition>
</preConditions>
This preCondition throws a CustomPreconditionFailedException when the precondition version parameter is > deployedVersion.
The precondition is working unfortunately whenever it throws the CustomPreconditionFailedException instead of skipping the change set (onFail="CONTINUE") the maven plugin fails with the following:
Error setting up or running Liquibase: Migration failed for change set src/database/changelog/db.changelog-1.0.1.xml::1.0.1_script1::fred.smith:
[ERROR] Reason:
[ERROR] db.changelog-master.xml : liquibase.precondition.CustomPreconditionWrapper#2add4d24 : liquibase.exception.CustomPreconditionFailedException: Change set version : 1.0.1 incompatible with deploy version : 1.0.0. Skipping change set. Precondition Error
This is the exception I expect it to throw but I am expecting the change set to be skipped due to the onFail="CONTINUE".
What am I missing ?
Thanks.

sonar maven plugin fails to import project

I'm trying to import my project on a remote server via maven plugin but a got the following error:
Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar
(default-cli) on project prj: Error 405 on
https://sonarqubevc.scalefocus.com/api/ce/submit?projectKey=bg.prj.commerce:prj&projectName=prj%20Application :
{"errors":[{"msg":"HTTP method POST is required"}]}
The version of the server is - SonarQube version: 6.3.0
Any ideas? Is it a bug that I hit or there is some misconfiguration on my side?
Thx

Maven issue while Building for a latest fix given by WSO2

WSO2 has given a latest fix for Governance Registry5.3.0(Governance REST API Update issue). While building a code for applying a fix the below error is thrown.
Error when building code using Maven.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile (default-compile) on project org.wso2.carbon.governance.api: Compilation failure: Compilation failure:
[ERROR] \Users\a596500\Downloads\carbon-governance-master\components\governance\org.wso2.carbon.governance.api\src\main\java\org\wso2\carbon\governance\api\util\CheckpointTimeUtils.java:[22,30] error: package org.apache.commons.lang does not exist
[ERROR] Failed to execute goal on project org.wso2.carbon.governance.api: Could not resolve dependencies for projectorg.wso2.carbon.governance:org.wso2.carbon.governance.api:bundle:4.7.2-SNAPSHOT: The following artifacts could not beresolved: org.wso2.carbon.registry:org.wso2.carbon.registry.extensions:jar:4.6.1-SNAPSHOT, org.wso2.carbon.registry:org.wso2.carbon.registry.common:jar:4.6.1-SNAPSHOT, org.wso2.carbon.registry:org.wso2.carbon.registry.admin.api:jar:4.6.1-SNAPSHOT
org.wso2.carbon.registry:org.wso2.carbon.registry.indexing:jar:4.6.1-SNAPSHOT: Could not find artifact org.wso2.carbon.registry:org.wso2.carbon.registry.extensions:jar:4.6.1-SNAPSHOT in nexuspro-level0 (https://repo.fmr.com/content/groups/level0/)
Please clone below repos, Move to the relevant tag and run an mvn clean install -e on each and every repo accordingly.
https://github.com/wso2/carbon4-kernel.git tag : 4.4.7
https://github.com/wso2/carbon-registry.git tag : 4.6.0
https://github.com/wso2/carbon-governance.git tag : 4.7.1
https://github.com/wso2/carbon-governance-extensions.git tag : 4.5.2
https://github.com/wso2/jaggery-extensions.git tag : 1.5.5
https://github.com/wso2/carbon-store tag : 2.4.6
https://github.com/wso2/product-greg.git tag : 5.3.0
To apply the fix and generate the latest jar you have to apply the fix manually to 5.3.0 tag from your local machine and build the source.

Junit failures related to cobertura with multi-module maven project in jenkins

I am getting below test failures when building the multi-module maven project in jenkins.
JDK version - 1.8.51
junit - 4.12
org.codehaus.mojo/cobertura-maven-plugin - 2.7
powermock-easymock-release-full - 1.6.2
net.sourceforge.cobertura / cobertura - 2.1.1
All the above are latest plugins.
Test failures
Error 1
Error Message
net.sourceforge.cobertura.coveragedata.TouchCollector.registerClass(Ljava/lang/String;)V
Stacktrace
java.lang.NoSuchMethodError: net.sourceforge.cobertura.coveragedata.TouchCollector.registerClass(Ljava/lang/String;)V
Error 2
Error Message
Could not initialize class com.test.it.logging.EventLogHandler
Stacktrace
java.lang.NoClassDefFoundError: Could not initialize class com.test.it.logging.EventLogHandler
Error 3
Error Message
Failed to transform class with name com.test.it.ra.ReportArchiveConfProvider. Reason: cannot find net.sourceforge.cobertura.coveragedata.LightClassmapListener
Stacktrace
java.lang.IllegalStateException: Failed to transform class with name com.test.it.ra.ReportArchiveConfProvider. Reason: cannot find net.sourceforge.cobertura.coveragedata.LightClassmapListener
at
org.powermock.core.classloader.MockClassLoader.loadMockClass(MockClassLoader.java:266)
JFYI that it was working fine with JDK 7 and old version plugins. Have anyone faced this issue ? Please help.
I'm not on the same configurations as you, but ran into the same error around LightClassmapListener. I got past the issue by clearing my workspace.
In the jenkins job; click the workspace and select 'Wipe out Current Workspace'

First time SONAR setup with Maven, getting a error on RulePriority, analysis fails

I am trying to setup SONAR on a server. I have Maven 3.0.3 and using Sonar 3.1.1 with a Java project.
Part way through the mvn sonar:sonar, I am getting the following error:
[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project XXXXXXX-common: Can not execute Sonar: No enum const class org.sonar.api.rules.RulePriority.3 -> [Help 1]
I have setup Sonar before and never saw this, it has always been unzip and go. But on this particular server I keep getting this error.
I tried creating a blank rule set, but the error still pops up.
Any thoughts?
I think you are facing the same problem described here
http://sonar.15.n6.nabble.com/Xpath-rules-gt-Failed-startup-of-context-td3183230.html
You might find it useful

Resources