I'm trying to run a sonar analysis on my jave code. There are no files indexed.
INFO: Runner configuration file: C:\Program Files\Development\Tools\sonar-runner-2.4\conf\sonar-runner.properties
INFO: Project configuration file: C:\Program Files\Development\Tools\sonar-runner-2.4\Projects\sonar-project.properties
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Work directory: C:\Program Files\Development\Tools\sonar-runner-2.4\bin\.\.sonar
INFO: SonarQube Server 4.3
09:41:48.340 INFO - Load batch settings
09:41:49.535 INFO - User cache: C:\Users\z003bw5a\.sonar\cache
09:41:49.580 INFO - Install plugins
09:41:55.230 INFO - Install JDBC driver
09:41:55.272 INFO - Create JDBC datasource for jdbc:mysql://localhost:3306/sonar?useUnicode=true&characterEncoding=utf8
09:42:00.687 INFO - Initializing Hibernate
09:42:15.950 INFO - Load project settings
09:42:16.125 INFO - Apply project exclusions
09:42:16.812 INFO - ------------- Scan skuska 1
09:42:16.842 INFO - Load module settings
09:42:20.400 INFO - Language is forced to java
09:42:21.177 INFO - Loading technical debt model...
09:42:21.241 INFO - Loading technical debt model done: 64 ms
09:42:21.246 INFO - Loading rules...
09:42:22.359 INFO - Loading rules done: 1113 ms
09:42:22.430 INFO - Configure Maven plugins
09:42:22.730 INFO - Compare to previous analysis (2014-06-18)
09:42:22.767 INFO - Compare over 30 days (2014-05-19, analysis of 2014-06-18 09:12:14.0)
09:42:22.926 INFO - Loaded quality gate 'SonarQube way'
09:42:24.118 INFO - Base dir: C:\Program Files\Development\Tools\sonar-runner-2.4\bin\.
09:42:24.122 INFO - Working dir: C:\Program Files\Development\Tools\sonar-runner-2.4\bin\.\.sonar
09:42:24.126 INFO - Source encoding: UTF-8, default locale: en_US
09:42:24.137 INFO - Index files
09:42:24.228 INFO - 0 files indexed
09:42:24.238 INFO - Quality profile for java: Sonar way
09:42:24.254 INFO - JaCoCo report not found.
09:42:24.269 INFO - JaCoCo IT report not found.
09:42:24.274 INFO - JaCoCo reports not found.
09:42:24.328 INFO - Sensor QProfileSensor...
09:42:24.454 INFO - Sensor QProfileSensor done: 126 ms
09:42:24.458 INFO - Sensor InitialOpenIssuesSensor...
09:42:24.493 INFO - Sensor InitialOpenIssuesSensor done: 35 ms
09:42:24.498 INFO - Sensor ProfileEventsSensor...
09:42:24.581 INFO - Sensor ProfileEventsSensor done: 83 ms
09:42:24.585 INFO - Sensor ProjectLinksSensor...
09:42:24.612 INFO - Sensor ProjectLinksSensor done: 27 ms
09:42:24.615 INFO - Sensor VersionEventsSensor...
09:42:24.886 INFO - Sensor VersionEventsSensor done: 271 ms
09:42:24.890 INFO - Sensor FileHashSensor...
09:42:24.894 INFO - Sensor FileHashSensor done: 4 ms
09:42:24.905 INFO - Sensor CpdSensor...
09:42:24.908 INFO - SonarEngine is used for java
09:42:24.919 INFO - Sensor CpdSensor done: 14 ms
09:42:26.614 INFO - Execute decorators...
09:42:27.719 INFO - Store results in database
09:42:28.073 INFO - ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/skuska
09:42:28.629 INFO - Executing post-job class org.sonar.plugins.dbcleaner.ProjectPurgePostJob
09:42:28.739 INFO - -> Keep one snapshot per day between 2014-05-21 and 2014-06-17
09:42:28.753 INFO - -> Keep one snapshot per week between 2013-06-19 and 2014-05-21
09:42:28.781 INFO - -> Keep one snapshot per month between 2009-06-24 and 2013-06-19
09:42:28.785 INFO - -> Delete data prior to: 2009-06-24
09:42:28.856 INFO - -> Clean skuska 1 [id=3]
09:42:28.905 INFO - <- Clean snapshot 19
09:42:29.430 INFO - Executing post-job class org.sonar.plugins.core.issue.notification.SendIssueNotificationsPostJob
09:42:29.435 INFO - Executing post-job class org.sonar.plugins.core.batch.IndexProjectPostJob
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
Total time: 56.892s
Final Memory: 11M/212M
INFO: ------------------------------------------------------------------------
My sonar settings look like this:
# Section 1: required metadata
sonar.projectKey=skuska
sonar.projectName=skuska 1
sonar.projectVersion=0.1
# Section 2: project directories
# path to source directories (required)
sonar.sources=C:\Program Files\Development\Tools\sonar-runner-2.4\Projects\skuska
# path to test source directories (optional)
#sonar.tests=
# path to project binaries (optional), for example directory of Java
# bytecode
#sonar.binaries=
# Section 3: Java and libraries settings
# optional comma-separated list of paths to libraries. Only path to JAR file
# and path to directory of classes are supported.
#libraries=path/to/library.jar
# Uncomment those lines if some features of java 5 or java 6 like
# annotations, enum, ...
# are used in the source code to be analysed
#sonar.java.source=1.5
#sonar.java.target=1.5
# Section 4: Advanced parameters
# Uncomment this line to analyse a project which is not a java project.
# The value of the property must be the key of the language.
sonar.language=java
# Advanced parameters
#sonar.my.property=value
sonar.sourceEncoding=UTF-8
Analysis is successful, but the web server is only the name of the project and no data about metrics and code coverage.
Please help me!
As you can read in the documentation, you should put the sonar-project.properties file at the root of your project and launch the analysis from this folder, and therefore replace the "sonar.sources" property with a relative path instead of an absolute one.
Related
I want to Deploy Alluxio on a Cluster with HA.My CDH version: 3.0.0+cdh6.3.2.
I build Alluxio with a specific Hadoop release version:
mvn install -Phadoop-3 -Dhadoop.version=3.0.0 -DskipTests
I put alluxio-assembly-server-2.4.1-2-SNAPSHOT-jar-with-dependencies.jar and alluxio-underfs-hdfs-2.4.1-2-SNAPSHOT-jar-with-dependencies.jar in the lib/ folder of Alluxio every node.
/opt/alluxio-2.4.1-1/conf/alluxio-site.properties:
alluxio.master.mount.table.root.ufs=hdfs://nameservice1/alluxio/data
alluxio.master.journal.type=UFS
alluxio.master.journal.folder=hdfs://nameservice1/alluxio/journal/
alluxio.master.security.impersonation.root.users=*
alluxio.worker.tieredstore.level0.dirs.quota=10GB
alluxio.worker.tieredstore.level1.dirs.quota=10GB
alluxio.worker.tieredstore.level2.dirs.quota=10GB
alluxio.zookeeper.enabled=true
alluxio.zookeeper.address=test-cdh001:2181,test-cdh002:2181,test-cdh003:2181
alluxio.underfs.hdfs.configuration=/etc/hadoop/conf/core-site.xml:/etc/hadoop/conf/hdfs-site.xml
when I format Alluxio cluster with the following command in one of the master nodes:
./bin/alluxio format
I got a error:
Executing the following command on all worker nodes and logging to /opt/alluxio-2.4.1-1/logs/task.log: /opt/alluxio-2.4.1-1/bin/alluxio formatWorker
Waiting for tasks to finish...
All tasks finished
Formatting Alluxio Master # test-cdh001
2021-01-07 18:35:58,766 INFO Format - Formatting master journal: hdfs://nameservice1/alluxio/journal/
2021-01-07 18:35:58,806 INFO ExtensionFactoryRegistry - Loading core jars from /opt/alluxio-2.4.1-1/lib
2021-01-07 18:35:58,869 INFO ExtensionFactoryRegistry - Loading extension jars from /opt/alluxio-2.4.1-1/extensions
2021-01-07 18:35:58,886 WARN ExtensionFactoryRegistry - No factory implementation supports the path hdfs://nameservice1/alluxio/journal/BlockMaster
2021-01-07 18:35:58,887 INFO ExtensionFactoryRegistry - Loading core jars from /opt/alluxio-2.4.1-1/lib
2021-01-07 18:35:58,906 INFO ExtensionFactoryRegistry - Loading extension jars from /opt/alluxio-2.4.1-1/extensions
2021-01-07 18:35:58,915 WARN ExtensionFactoryRegistry - No factory implementation supports the path hdfs://nameservice1/alluxio/journal/BlockMaster
2021-01-07 18:35:58,915 ERROR Format - Failed to format
java.lang.IllegalArgumentException: No Under File System Factory found for: hdfs://nameservice1/alluxio/journal/BlockMaster
at alluxio.underfs.UnderFileSystem$Factory.create(UnderFileSystem.java:95)
at alluxio.master.journal.ufs.UfsJournal.<init>(UfsJournal.java:149)
at alluxio.master.journal.ufs.UfsJournalSystem.createJournal(UfsJournalSystem.java:73)
at alluxio.master.journal.ufs.UfsJournalSystem.createJournal(UfsJournalSystem.java:47)
at alluxio.cli.Format.format(Format.java:120)
at alluxio.cli.Format.main(Format.java:97)
Any help would be much appreciated.
Add your hadoop version to the mount command with "--option alluxio.underfs.version="
Ex. alluxio fs mount --option alluxio.underfs.version=3.2 /mnt/hdfs/emr hdfs://hostname:8020/tmp/emr
I am trying to use SonarQube 5.0 with Hudson 3.2.1.
Sonar runner version 2.4.
Once Hudson invokes a sonar analysis, it ends with a build failure.
SonarQube is configured with Oracle 12c database using ojdbc7.jar driver.
The log output -
[workspace] $ /opt/sonar-runner-2.4/bin/sonar-runner -Dsonar.jdbc.driver=oracle.jdbc.xa.client.OracleXADataSource -Dsonar.jdbc.url=jdbc:oracle:thin:#//host:port/URL id pass -Dsonar.host.url=http://host:port id pass -Dsonar.projectBaseDir=/basedir -Dsonar.projectName=prjName -Dsonar.projectVersion=1.0 -Dsonar.projectKey=org:prj -Dsonar.sources=.
SonarQube Runner 2.4
Java 1.7.0_75 Oracle Corporation (64-bit)
Linux 2.6.18-308.el5 amd64
INFO: Runner configuration file: /opt/sonar-runner-2.4/conf/sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Work directory: /basedir
INFO: SonarQube Server 5.0
04:04:54.792 INFO - Load global referentials...
04:04:55.100 INFO - Load global referentials done: 311 ms
04:04:55.105 INFO - User cache: /var/lib/hudson/.sonar/cache
04:04:55.116 INFO - Install plugins
04:04:55.196 INFO - Install JDBC driver
04:04:55.205 INFO - Create JDBC datasource for jdbcURL
04:04:59.095 INFO - Initializing Hibernate
04:05:01.906 INFO - Load project referentials...
04:05:02.242 INFO - Load project referentials done: 336 ms
04:05:02.242 INFO - Load project settings
04:05:02.594 INFO - Loading technical debt model...
04:05:02.616 INFO - Loading technical debt model done: 21 ms
04:05:02.622 INFO - Apply project exclusions
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 9.050s
Final Memory: 16M/242M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: Error getting generated key or setting result to parameter object. Cause: java.lang.NullPointerException
ERROR:
ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with the -e switch.
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Finished: FAILURE
I have replaced the actual parameters like host,port, jdbcurl with placeholders.
Chances are that you are running Oracle 12c version 12.1.0.1.0 and using the JDBC drivers that came with it. The Oracle 12c JDBC driver that comes with 12.1.0.1.0 has a bug with the oracle.jdbc.driver.AutoKeyInfo.initMetaDataColumnIndexes() method, which is now fixed with the 12.2.0 patch. I am guessing that your error "getting generated key" is related to this issue. You should enable logging within SonarQube so that you can verify the root cause.
Full post is here.
I have a Jenkins Job that runs SonarRunner on a Maven project composed of several modules. The build fails when I configure SonarRunner to import Cobertura coverage reports.
SonarQube Runner 2.4
Java 1.7.0_55 Oracle Corporation (64-bit)
Windows 7 6.1 amd64
INFO: Error stacktraces are turned on.
INFO: Runner configuration file: C:\Jenkins\tools\hudson.plugins.sonar.SonarRunnerInstallation\Sonar_Runner\conf\sonar-runner.properties
INFO: Project configuration file: NONE
INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
INFO: Work directory: C:\Jenkins\workspace\Sprint3\Application\.sonar
INFO: SonarQube Server 4.3
11:07:44.407 INFO - Load batch settings
11:07:44.609 INFO - User cache: C:\.sonar\cache
11:07:44.625 INFO - Install plugins
11:07:44.765 INFO - Install JDBC driver
11:07:44.781 WARN - H2 database should be used for evaluation purpose only
11:07:44.781 INFO - Create JDBC datasource for jdbc:h2:tcp://localhost/sonar
11:07:45.951 INFO - Initializing Hibernate
11:07:47.885 INFO - Load project settings
11:07:47.963 INFO - Apply project exclusions
11:07:48.229 INFO - ------------- Scan JmsUtils
11:07:48.229 INFO - Load module settings
11:07:49.508 INFO - Loading technical debt model...
11:07:49.523 INFO - Loading technical debt model done: 15 ms
11:07:49.523 INFO - Loading rules...
11:07:49.789 INFO - Loading rules done: 266 ms
11:07:49.804 INFO - Configure Maven plugins
11:07:49.976 INFO - Compare to previous analysis (2014-05-21)
11:07:50.007 INFO - Compare over 30 days (2014-04-21, analysis of 2014-05-08 15:55:35.699)
11:07:50.007 INFO - No quality gate is configured.
11:07:50.147 INFO - Base dir: C:\Jenkins\workspace\Sprint3\Application\JmsUtils
11:07:50.147 INFO - Working dir: C:\Jenkins\workspace\Sprint3\Application\.sonar\WSM_Application_JmsUtils
11:07:50.147 INFO - Source dirs: C:\Jenkins\workspace\Sprint3\Application\JmsUtils\src\main\java
11:07:50.147 INFO - Test dirs: C:\Jenkins\workspace\Sprint3\Application\JmsUtils\src\test\java
11:07:50.147 INFO - Binary dirs: C:\Jenkins\workspace\Sprint3\Application\JmsUtils\target\classes
11:07:50.147 INFO - Source encoding: windows-1252, default locale: en_US
11:07:50.147 INFO - Index files
11:07:50.350 INFO - 4 files indexed
11:07:50.428 INFO - Quality profile for java: WSM way with Findbugs - Server Code
11:07:50.444 INFO - Sensor JavaSquidSensor...
11:07:50.491 INFO - Java Main Files AST scan...
11:07:50.506 INFO - 2 source files to be analyzed
11:07:50.740 INFO - 2/2 source files analyzed
11:07:50.756 INFO - Java Main Files AST scan done: 265 ms
11:07:50.756 INFO - Java bytecode scan...
11:07:50.787 WARN - Class 'javax/jms/Session' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/Connection' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'org/apache/log4j/Logger' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/Session' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/MessageProducer' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/Message' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'org/apache/log4j/Logger' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/ConnectionFactory' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/Connection' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/Session' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/Session' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/Session' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'org/apache/log4j/Logger' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'org/apache/log4j/Logger' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'mil/navy/aif/domain/AuditRecord' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'mil/navy/aif/domain/AuditRecord' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'mil/navy/aif/domain/AuditRecord' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'mil/navy/aif/domain/AuditRecord' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'mil/navy/aif/domain/AuditRecord' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'mil/navy/aif/domain/AuditRecord' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'javax/jms/JMSException' is not accessible through the ClassLoader.
11:07:50.787 WARN - Class 'org/apache/log4j/Logger' is not accessible through the ClassLoader.
11:07:50.803 WARN - Class 'org/apache/log4j/Logger' is not accessible through the ClassLoader.
11:07:50.803 INFO - Java bytecode scan done: 47 ms
11:07:50.803 INFO - Java Test Files AST scan...
11:07:50.803 INFO - 2 source files to be analyzed
11:07:50.849 INFO - Java Test Files AST scan done: 46 ms
11:07:50.849 INFO - 2/2 source files analyzed
11:07:50.849 INFO - Package design analysis...
11:07:50.865 INFO - Package design analysis done: 16 ms
11:07:50.881 INFO - Sensor JavaSquidSensor done: 437 ms
11:07:50.881 INFO - Sensor QProfileSensor...
11:07:50.881 INFO - Sensor QProfileSensor done: 0 ms
11:07:50.881 INFO - Sensor FindbugsSensor...
11:07:50.896 INFO - Execute Findbugs 2.0.3...
11:07:52.269 INFO - Findbugs output report: C:\Jenkins\workspace\Sprint3\Application\.sonar\WSM_Application_JmsUtils\findbugs-result.xml
The following classes needed for analysis were missing:
javax.jms.Session
javax.jms.Connection
org.apache.log4j.Logger
javax.jms.ConnectionFactory
javax.jms.Message
javax.jms.MessageProducer
mil.navy.aif.domain.AuditRecord
javax.jms.JMSException
javax.jms.Topic
javax.jms.Destination
11:07:54.609 INFO - Execute Findbugs 2.0.3 done: 3698 ms
11:07:54.609 INFO - Sensor FindbugsSensor done: 3728 ms
11:07:54.609 INFO - Sensor JaCoCoItSensor...
11:07:54.609 INFO - Project coverage is set to 0% as no JaCoCo execution data has been dumped: C:\Jenkins\workspace\Sprint3\Application\JmsUtils\target\jacoco-it.exec
11:07:54.672 INFO - Sensor JaCoCoItSensor done: 63 ms
11:07:54.672 INFO - Sensor JaCoCoOverallSensor...
11:07:54.672 INFO - Sensor JaCoCoOverallSensor done: 0 ms
11:07:54.672 INFO - Sensor CoberturaSensor...
11:07:54.687 INFO - parsing C:\Jenkins\workspace\Sprint3\Application\JmsUtils\target\site\cobertura\coverage.xml
11:07:54.765 INFO - Sensor CoberturaSensor done: 93 ms
11:07:54.765 INFO - Sensor CpdSensor...
11:07:54.765 INFO - SonarEngine is used for java
11:07:54.765 INFO - Cross-project analysis disabled
11:07:54.812 INFO - Sensor CpdSensor done: 47 ms
11:07:54.812 INFO - Sensor InitialOpenIssuesSensor...
11:07:54.890 INFO - Sensor InitialOpenIssuesSensor done: 78 ms
11:07:54.890 INFO - Sensor ProfileEventsSensor...
11:07:54.906 INFO - Sensor ProfileEventsSensor done: 16 ms
11:07:54.906 INFO - Sensor ProjectLinksSensor...
11:07:54.906 INFO - Sensor ProjectLinksSensor done: 0 ms
11:07:54.906 INFO - Sensor VersionEventsSensor...
11:07:54.921 INFO - Sensor VersionEventsSensor done: 15 ms
11:07:54.921 INFO - Sensor FileHashSensor...
11:07:54.921 INFO - Sensor FileHashSensor done: 0 ms
11:07:54.921 INFO - Sensor SurefireSensor...
11:07:54.921 INFO - parsing C:\Jenkins\workspace\Sprint3\Application\JmsUtils\target\surefire-reports
11:07:54.937 INFO - Sensor SurefireSensor done: 16 ms
11:07:54.937 INFO - Sensor JaCoCoSensor...
11:07:54.937 INFO - Project coverage is set to 0% as no JaCoCo execution data has been dumped: C:\Jenkins\workspace\Sprint3\Application\JmsUtils\target\jacoco.exec
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 11.513s
Final Memory: 21M/674M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:91)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:75)
at java.security.AccessController.doPrivileged(Native Method)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:102)
at org.sonar.runner.api.Runner.execute(Runner.java:100)
at org.sonar.runner.Main.executeTask(Main.java:70)
at org.sonar.runner.Main.execute(Main.java:59)
at org.sonar.runner.Main.main(Main.java:53)
Caused by: org.sonar.api.utils.SonarException: Can not add twice the same measure on org.sonar.api.resources.File#318c8090[key=src/main/java/mil/navy/wsm/jmsutils/Auditor.java,deprecatedKey=mil.navy.wsm.jmsutils.Auditor,path=src/main/java/mil/navy/wsm/jmsutils/Auditor.java,dir=mil/navy/wsm/jmsutils,filename=Auditor.java,language=Java]: org.sonar.api.measures.Measure#7f4c8759[id=<null>,metricKey=lines_to_cover,metric=Metric[id=38,formula=<null>,key=lines_to_cover,description=Lines to cover,type=INT,direction=1,domain=Tests,name=Lines to cover,qualitative=false,userManaged=false,enabled=true,origin=JAV,worstValue=<null>,bestValue=<null>,optimizedBestValue=false,hidden=false,deleteHistoricalData=false],value=28.0,data=<null>,description=<null>,alertStatus=<null>,alertText=<null>,tendency=<null>,date=<null>,variation1=<null>,variation2=<null>,variation3=<null>,variation4=<null>,variation5=<null>,url=<null>,characteristic=<null>,requirement=<null>,personId=<null>,persistenceMode=FULL]
at org.sonar.batch.index.Bucket.addMeasure(Bucket.java:95)
at org.sonar.batch.index.DefaultIndex.addMeasure(DefaultIndex.java:209)
at org.sonar.batch.DefaultSensorContext.saveMeasure(DefaultSensorContext.java:168)
at org.sonar.plugins.jacoco.JaCoCoSensor$UnitTestsAnalyzer.saveMeasures(JaCoCoSensor.java:86)
at org.sonar.plugins.jacoco.AbstractAnalyzer.readExecutionData(AbstractAnalyzer.java:151)
at org.sonar.plugins.jacoco.AbstractAnalyzer.analyse(AbstractAnalyzer.java:107)
at org.sonar.plugins.jacoco.JaCoCoSensor.analyse(JaCoCoSensor.java:61)
at org.sonar.batch.phases.SensorsExecutor.executeSensor(SensorsExecutor.java:79)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:70)
at org.sonar.batch.phases.PhaseExecutor.execute(PhaseExecutor.java:131)
at org.sonar.batch.scan.ModuleScanContainer.doAfterStart(ModuleScanContainer.java:178)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ProjectScanContainer.scan(ProjectScanContainer.java:199)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:194)
at org.sonar.batch.scan.ProjectScanContainer.scanRecursively(ProjectScanContainer.java:192)
at org.sonar.batch.scan.ProjectScanContainer.doAfterStart(ProjectScanContainer.java:187)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:56)
at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:44)
at org.sonar.batch.bootstrap.TaskContainer.doAfterStart(TaskContainer.java:82)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrap.BootstrapContainer.executeTask(BootstrapContainer.java:175)
at org.sonar.batch.bootstrap.BootstrapContainer.doAfterStart(BootstrapContainer.java:163)
at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:92)
at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74)
at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:87)
... 9 more
ERROR:
ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.
Build step 'Invoke Standalone Sonar Analysis' marked build as failure
Finished: FAILURE
Here are the project properties that I've configured in Jenkins for the SonarRunner analysis:
sonar.projectKey=WSM:Application
sonar.projectName=Application
sonar.projectVersion=1.0.2.4-SNAPSHOT
sonar.sources=src/main/java
sonar.binaries=target/classes
sonar.tests=src/test/java
sonar.junit.reportsPath=target/surefire-reports
sonar.java.coveragePlugin=cobertura
sonar.cobertura.reportPath=target/site/cobertura/coverage.xml
sonar.modules=JmsUtils,MsgGenerationUtils,WsmCopyAsNew,WsmGeomCreator,WsmGoldMsgParser,WsmJpa,WsmMsgGenerator
If I remove the sonar.java.coveragePlugin and the sonar.cobertura.reportPath properties, the build succeeds, however I will not have any coverage metrics.
I believe the issue is occurring because there is a conflict with Cobertura and JaCoCo trying to both measure the same files. You can see in the stack trace that the JaCoCo sensor is involved in the error. I do not wish to use JaCoCo at all.
Jenkins version: 1.560
Jenkins Sonar Plugin version: 2.1
Sonar version: 4.3
Sonar Cobertura Plugin version: 1.6.1
Sonar Java Plugin version: 2.2
A workaround with version 2.2. ist to set
sonar.jacoco.reportMissing.force.zero=False
in sonar-project.properties.
Please use the Java plugin version 2.2.1 that was released to fix this very issue.
In version 2.2 if no report is present JaCoCo sets coverage to 0 which provoke the issue you face. Whereas in 2.2.1 if no report is present, coverage is not set.
In my case the error was produced because I tried to upload Jacoco and Cobertura report at the same time. You have to choose one of the coverage plugins.
I installed pig on centos 6. I am new to pig.
I opened pig in local mode using $pig -x local.
only getting error while doing DUMP.
error message is : ERROR 2998: Unhandled internal error. org.apache.hadoop.mapred.jobcontrol.JobControl.addJob(Lorg/apache/hadoop/mapred/jobcontrol/Job;)Ljava/lang/String;
I have set JAVA_HOME and java version is 1.7. But hadoop is not installed.
=================
grunt> A = load '/etc/passwd' using PigStorage(':');
grunt> B = foreach A generate $0 as id; grunt> dump B;
2014-06-13 16:24:33,039 [main] INFO org.apache.pig.tools.pigstats.ScriptState - Pig features used in the script: UNKNOWN
2014-06-13 16:24:33,040 [main] INFO org.apache.pig.newplan.logical.optimizer.LogicalPlanOptimizer - {RULES_ENABLED=[AddForEach, ColumnMapKeyPrune, GroupByConstParallelSetter, LimitOptimizer, LoadTypeCastInserter, MergeFilter, MergeForEach, NewPartitionFilterOptimizer, PartitionFilterOptimizer, PushDownForEachFlatten, PushUpFilter, SplitFilter, StreamTypeCastInserter], RULES_DISABLED=[FilterLogicExpressionSimplifier]}
2014-06-13 16:24:33,041 [main] INFO org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MRCompiler - File concatenation threshold: 100 optimistic? false
2014-06-13 16:24:33,042 [main] INFO org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MultiQueryOptimizer - MR plan size before optimization: 1
2014-06-13 16:24:33,042 [main] INFO org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.MultiQueryOptimizer - MR plan size after optimization: 1
2014-06-13 16:24:33,043 [main] INFO org.apache.hadoop.metrics.jvm.JvmMetrics - Cannot initialize JVM Metrics with processName=JobTracker, sessionId= - already initialized
2014-06-13 16:24:33,044 [main] INFO org.apache.pig.tools.pigstats.ScriptState - Pig script settings are added to the job
2014-06-13 16:24:33,044 [main] INFO org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler - mapred.job.reduce.markreset.buffer.percent is not set, set to default 0.3
2014-06-13 16:24:33,052 [main] INFO org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.JobControlCompiler - Setting up single store job
2014-06-13 16:24:33,052 [main] INFO org.apache.pig.data.SchemaTupleFrontend - Key [pig.schematuple] is false, will not generate code.
2014-06-13 16:24:33,053 [main] INFO org.apache.pig.data.SchemaTupleFrontend - Starting process to move generated code to distributed cache
2014-06-13 16:24:33,053 [main] INFO org.apache.pig.data.SchemaTupleFrontend - Distributed cache not supported or needed in local mode. Setting key [pig.schematuple.local.dir] with code temp directory: /tmp/1402656873052-0
2014-06-13 16:24:33,062 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2998: Unhandled internal error. org.apache.hadoop.mapred.jobcontrol.JobControl.addJob(Lorg/apache/hadoop/mapred/jobcontrol/Job;)Ljava/lang/String;
Details at logfile: /home/ripsme/pig/pig_1402655166073.log
grunt>
Thank you very much.
for Redhat systems, pls do
$sudo yum install pig
and open pig in local mode. this worked for me.
After configure the sonar tools (SonarQube, MySql database and Sonar-runner) I perform an analysis over an Android project without any problem. But after install the Android Plugin for sonar and repeat the analysis, this one fails getting the next error:
INFO - Preview mode
Load batch settings
User cache: /home/user/.sonar/cache
INFO - Install plugins
INFO - Exclude plugins: devcockpit, jira, pdfreport, views, report, buildstability, scmactivity, buildbreaker
INFO - Create JDBC datasource for jdbc:h2:/home/user/workspace/myAndroidProject/.sonar/.sonartmp/preview1394469024394-0
INFO - Initializing Hibernate
INFO - Load project settings
INFO - Apply project exclusions
INFO - ------------- Scan myAndroidProject
INFO - Load module settings
INFO - Language is forced to java
INFO - Loading technical debt model...
INFO - Loading technical debt model done: 424 ms
INFO - Configure Maven plugins
INFO - Base dir: /home/user/workspace/myAndroidProject
INFO - Working dir: /home/user/workspace/myAndroidProject/.sonar
INFO - Source dirs: /home/user/workspace/myAdnroidProject/src
INFO - Source encoding: UTF-8, default locale: en_EN
INFO - Index files
INFO - Included sources:
INFO - src/**
INFO - 116 files indexed
WARN - Accessing the filesystem before the Sensor phase is deprecated and will not be supported in the future. Please update your plugin.
INFO - Index files
INFO - Included sources:
INFO - src/**
INFO - 116 files indexed
WARN - Accessing the filesystem before the Sensor phase is deprecated and will not be supported in the future. Please update your plugin.
INFO - Index files
INFO - Included sources:
INFO - src/**
INFO - 116 files indexed
INFO - Quality profile for java: Sonar way
INFO - Sensor JavaSourceImporter...
INFO - Sensor JavaSourceImporter done: 49 ms
INFO - Sensor JavaSquidSensor...
INFO - Java AST scan...
INFO - 116 source files to be analyzed
INFO - 116/116 source files analyzed
INFO - Java AST scan done: 6693 ms
WARN - Java bytecode has not been made available to the analyzer. The Depth of Inheritance Tree (DIT) metric, Response for Class (RFC) metric, Number of Children (NOC) metric, Lack of Cohesion (LCOM4) metric, deperecated dependencies metrics, UnusedPrivateMethod rule, RedundantThrowsDeclarationCheck rule, S1160 rule, S1217 rule are disabled.
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 18.440s
Final Memory: 12M/357M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
ERROR: Unable to execute Sonar
ERROR: Caused by: org.sonar.api.resources.Directory cannot be cast to org.sonar.api.resources.JavaPackage
My sonar-project.properties file is the enxt:
#Required metadata
sonar.projectKey=mKey
sonar.projectName=myAndroidProject
sonar.projectVersion=1.0
# Paths to source directories.
# Paths are relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# Do not put the "sonar-project.properties" file in the same directory with the source code.
# (i.e. never set the "sonar.sources" property to ".")
sonar.sources=src
# The value of the property must be the key of the language.
sonar.language=java
# Encoding of the source code
sonar.sourceEncoding=UTF-8
# Analysis mode
sonar.analysis.mode=preview
#Enables the Lint profile to analyze the code using the Lint rules.
#sonar.profile=Android Lint
I'm using the next environment:
SonarQube 4.2 RC1
Sonar-runner 2.3
Database: MySQL
Ubuntu 12.04 LTS
Java 1.7
I tryed uninstalling the Android plugin but the problem persists. The unique way that I've found to solve it is deleting the database and the user and create them again.
As stated on http://docs.codehaus.org/pages/viewpage.action?pageId=236224987, the Android plugin is not yet compatible with SonarQube 4.2-RC1. See also http://jira.codehaus.org/browse/SONARPLUGINS-3483.
You need to provide the binaries (bytecode .class files) to the sonar executor.
Add the following line to your sonar-project.properties
# Path to the class files
sonar.binaries=build\\classes\\main
If the above line doesn't work , then check your binaries actual path and place it in sonar.binaries property