1

Sonarqube started fine on windows but it stops itself after 5 seconds .it shows the blow log on CMd display.

C:\sonarqube\bin\windows-x86-64>StartSonar.bat
wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
jvm 1    | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1    |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
jvm 1    |
jvm 1    | 2018.01.09 10:05:37 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\sonarqube\temp
jvm 1    | 2018.01.09 10:05:37 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
jvm 1    | 2018.01.09 10:05:37 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [C:\sonarqube\elasticsearch]: C:\Program Files\jre\bin\java -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djdk.io.permissionsUseCanonicalPath=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -Xms512m -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\sonarqube\elasticsearch -cp lib/* org.elasticsearch.bootstrap.Elasticsearch -Epath.conf=C:\sonarqube\temp\conf\es
jvm 1    | 2018.01.09 10:05:37 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1    | 2018.01.09 10:05:38 INFO  app[][o.e.p.PluginsService] no modules loaded
jvm 1    | 2018.01.09 10:05:38 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
jvm 1    | 2018.01.09 10:05:39 WARN  app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1
jvm 1    | 2018.01.09 10:05:39 INFO  app[][o.s.a.SchedulerImpl] Process [es] is stopped
jvm 1    | 2018.01.09 10:05:39 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
wrapper  | <-- Wrapper Stopped
Chandela
  • 262
  • 5
  • 18
  • Please, provide readable details to your question, for example, your code or maybe some explanation of what you are trying to accomplish, writing tons of cryptic of error logs is not even useful for users willing to elaborate an answer to your problem, avoid asking such low-effort question, read this: https://stackoverflow.com/help/how-to-ask – henriquehbr Dec 10 '19 at 13:22
  • Do you run SonarQube as a [root user](https://stackoverflow.com/questions/47731102/cant-run-sonar-server-caused-by-elasticsearch-cannot-running-as-root/47733598)? – Jeroen Heier Dec 11 '19 at 16:59

1 Answers1

2

After spending a lot of time on this I found the answer

1.

first I got this error on my windows system even my system already has Java installed

java.lang.illegalstateexception: Sonarqube require java

To resolve this issue I found my system installed java version is 8 and Sonarcube required 11+. So I downloaded the JDK11.0.5 from oracle java site and replace the path of java in

\sonarqube-8.0\conf\wrapper.conf file present in Sonarqube directory I replaced from this

wrapper.java.command=java

to this

wrapper.java.command=C:\Program Files\Java\jdk-11.0.5\bin\java

Then this issue got resolved.

here the 11+ means it should only be java 11 version not other then that.

2.

Here the sonarqube run but got stoped just after it execution.

C:\sonarqube\bin\windows-x86-64>StartSonar.bat
wrapper  | --> Wrapper Started as Console
wrapper  | Launching a JVM...
jvm 1    | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1    |   Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.
jvm 1    |
jvm 1    | 2018.01.09 10:05:37 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\sonarqube\temp
jvm 1    | 2018.01.09 10:05:37 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
jvm 1    | 2018.01.09 10:05:37 INFO  app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [C:\sonarqube\elasticsearch]: C:\Program Files\jre\bin\java -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+AlwaysPreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djdk.io.permissionsUseCanonicalPath=true -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -Xms512m -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\sonarqube\elasticsearch -cp lib/* org.elasticsearch.bootstrap.Elasticsearch -Epath.conf=C:\sonarqube\temp\conf\es
jvm 1    | 2018.01.09 10:05:37 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1    | 2018.01.09 10:05:38 INFO  app[][o.e.p.PluginsService] no modules loaded
jvm 1    | 2018.01.09 10:05:38 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
jvm 1    | 2018.01.09 10:05:39 WARN  app[][o.s.a.p.AbstractProcessMonitor] Process exited with exit value [es]: 1
jvm 1    | 2018.01.09 10:05:39 INFO  app[][o.s.a.SchedulerImpl] Process [es] is stopped
jvm 1    | 2018.01.09 10:05:39 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
wrapper  | <-- Wrapper Stopped

There is no error shows on CMD screen. But I checked the logs in Sonarcube log file i.e. C:\Users\pathto\sonarqube-8.0\logs\es and here its mentioned about the java access denied. To Resolve this Just go to file manager and right-click on This PC and select properties from the list , after that select advance system setting that present at the top left side of the screen. Then a pop-up screen appear then select Environment variables and then add the path of your Sonarqube bin folder under the path tag like

Path
C:\Users\pathto\sonarqube-8.0\bin\windows-x86-64

And also add as variable

SONAR_RUNNER_HOME
C:\Users\Prashka\Videos\sonarqube-8.0\bin\

And after adding those variable clicks ok to pop up screen. And then click on SonarStart.bat file. Your SonarServer will start working then open http//:localhost:9000 in your browser and click on the login. then login to Sonar server with User admin and password admin Finally, SonarServer starts working with the Administrator panel.

Community
  • 1
  • 1
Chandela
  • 262
  • 5
  • 18
  • 1
    For a reference, you can also check how to do Sonarqube integration in android[link](https://tech.olx.com/sonarqube-integration-in-android-application-part-1-37041b0379) – Chandela Dec 24 '19 at 09:44