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
Related
I'm asking for help in building a project for Android (my knowledge in this tends to 0).
There is a rather old project. I'm trying to build it in AndroidStudio, I get the following error:
Build command failed.
Error while executing process C:\Users\User\AppData\Local\Android\Sdk\cmake\3.18.1\bin\ninja.exe with arguments {-C C:\Users\User\IdeaProjects\1\stouch-task-hardware-upgrade-investigation\app.cxx\RelWithDebInfo\2a9512e2\armeabi-v7a stouch}
ninja: Entering directory `C:\Users\User\IdeaProjects\1\stouch-task-hardware-upgrade-investigation\app.cxx\RelWithDebInfo\2a9512e2\armeabi-v7a'
[1/1] Linking CXX shared library ........\build\intermediates\cxx\RelWithDebInfo\2a9512e2\obj\armeabi-v7a\libstouch.so
I tried different versions of studio, java, gradle but the result is always the same.
How do I fix it?
Update:
2023-01-12 23:41:37,079 [e-1136-b06] WARN -
ea.gradle.project.sync.SdkSync - Replacing invalid NDK path
C:\Users\User\AppData\Local\Android\Sdk\ndk-bundle with
C:\Users\User\AppData\Local\Android\Sdk\ndk-bundle 2023-01-12
23:41:37,079 [e-1136-b06] INFO - e.project.sync.GradleSyncState -
Started sync with Gradle for project 'stouch'. 2023-01-12
23:41:37,080 [e-1136-b06] INFO - idea.project.IndexingSuspender -
Consuming IndexingSuspender activation event: SYNC_STARTED 2023-01-12
23:41:37,080 [e-1136-b06] INFO - idea.project.IndexingSuspender -
Starting batch update for project: Project
'C:\Users\User\IdeaProjects\AS\9\stouch' stouch 2023-01-12
23:41:37,087 [thread 116] INFO - s.plugins.gradle.GradleManager -
Instructing gradle to use java from C:/Program Files/Android/Android
Studio/jre 2023-01-12 23:41:37,088 [thread 116] INFO -
s.plugins.gradle.GradleManager - Instructing gradle to use java from
C:/Program Files/Android/Android Studio/jre 2023-01-12 23:41:37,101
[thread 116] INFO - xecution.GradleExecutionHelper - Passing
command-line args to Gradle Tooling API: -Didea.version=3.2
-Djava.awt.headless=true -Pandroid.injected.build.model.only=true -Pandroid.injected.build.model.only.advanced=true -Pandroid.injected.invoked.from.ide=true -Pandroid.injected.build.model.only.versioned=3 -Pandroid.injected.studio.version=3.2.1.0 -Pandroid.builder.sdkDownload=false --init-script C:\Users\User\AppData\Local\Temp\ijinit17.gradle 2023-01-12
23:41:37,770 [thread 116] INFO - .project.GradleProjectResolver -
Gradle project resolve error org.gradle.tooling.BuildException: Could
not run build action using Gradle distribution
'https://services.gradle.org/distributions/gradle-4.2-all.zip'. at
org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:51)
at
org.gradle.tooling.internal.consumer.ExceptionTransformer.transform(ExceptionTransformer.java:29)
at
org.gradle.tooling.internal.consumer.ResultHandlerAdapter.onFailure(ResultHandlerAdapter.java:41)
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 want to run Nutch 1.9 in Eclipse on Windows. I followed the tutorial from http://wiki.apache.org/nutch/RunNutchInEclipse and opened the project in Eclipse.
But when I run Nutch, I get the following error:
2014-09-19 17:45:48,039 INFO crawl.Injector (Injector.java:inject(283)) - Injector: starting at 2014-09-19 17:45:48
2014-09-19 17:45:48,043 INFO crawl.Injector (Injector.java:inject(284)) - Injector: crawlDb: K:/kumar/Nutch/apache-nutch-1.9/crawlresult
2014-09-19 17:45:48,043 INFO crawl.Injector (Injector.java:inject(285)) - Injector: urlDir: K:/kumar/Nutch/apache-nutch-1.9/urls
2014-09-19 17:45:48,043 INFO crawl.Injector (Injector.java:inject(294)) - Injector: Converting injected urls to crawl db entries.
2014-09-19 17:45:48,207 INFO jvm.JvmMetrics (JvmMetrics.java:init(71)) - Initializing JVM Metrics with processName=JobTracker, sessionId=
2014-09-19 17:45:48,252 WARN mapred.JobClient (JobClient.java:configureCommandLineOptions(661)) - No job jar file set. User classes may not be found. See JobConf(Class) or JobConf#setJar(String).
2014-09-19 17:45:48,268 INFO mapred.FileInputFormat (FileInputFormat.java:listStatus(192)) - Total input paths to process : 1
2014-09-19 17:45:48,485 INFO mapred.JobClient (JobClient.java:monitorAndPrintJob(1275)) - Running job: job_local_0001
2014-09-19 17:45:48,487 INFO mapred.FileInputFormat (FileInputFormat.java:listStatus(192)) - Total input paths to process : 1
2014-09-19 17:45:48,526 INFO mapred.MapTask (MapTask.java:runOldMapper(347)) - numReduceTasks: 0
2014-09-19 17:45:48,565 INFO plugin.PluginRepository (PluginManifestParser.java:parsePluginFolder(87)) - Plugins: looking in: K:\Nutch\apache-nutch-1.9\plugins
2014-09-19 17:45:48,566 WARN plugin.PluginRepository (PluginManifestParser.java:parsePluginFolder(101)) - java.io.FileNotFoundException: K:\Nutch\apache-nutch-1.9\plugins\creativecommons\plugin.xml (The system cannot find the file specified)
It seems that Hadoop is the causing error. I don't know how to solve this problem. I know Nutch requires Unix environment. But, I want to run Nutch in Eclipse on Windows.
Can anybody help me to solve this?
Download cygwin, then add that to your path of the environment variables. I think your problem is caused by the fact that windows can't invoke a unix native command. That is what I did however as soon as i got past that problem, I encountered other problems.
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.