35

I am facing strange issue with sonarqube 5.0.1 , one one of the machine it is not starting. Here is the error log - sonar.log -

--> Wrapper Started as Daemon
Launching a JVM...
Unable to start JVM: No such file or directory (2)
JVM exited while loading the application.
JVM Restarts disabled.  Shutting down.
<-- Wrapper Stopped

Machine is x86_64 GNU/Linux - Centos 5.1.

this box has java installed -

$java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

The same sonarqube package works on another machine.

Any idea what could be the issue here?

Thanks.

Rishi
  • 5,869
  • 7
  • 34
  • 45
  • Did you sort this out? I have the same issue. – Barry Pitman Apr 08 '15 at 08:49
  • I have found that I can start sonar if I login as the "sonar" user, and run "sonar start", but if I try start it as root using "service sonar start", I get the same error as you. – Barry Pitman Apr 08 '15 at 09:00
  • After trial and error going through lot of possible solutions I isolated the issue to be in wrapper.conf .. I am testing this fix. will post the answer with the details. – Rishi Apr 10 '15 at 22:35

8 Answers8

38

Issue was in the wrapper.conf where the java wrapper command was not getting resolved. It worked if I give the absolute path - ‘wrapper.java.command=/path/to/my/jdk/bin/java’

This could be an issue with an environment on a host.. not sure.

Few things that helped me in troubleshooting this -

  • log level changed to DEBUG in wrapper.conf
  • comments given in the wrapper.conf!

Thanks all for chiming in! Appreciate your inputs.

Rishi
  • 5,869
  • 7
  • 34
  • 45
5

1.Just close all running jvm from task manager 2. Change the port of the sonar runner from the properties

ramesh027
  • 796
  • 1
  • 10
  • 27
4

I had the same symptoms (wrapper starts then immediately stops). I tried these steps and finally succeeded (on a windows 10 pc):

1) in wrapper.conf, specified the java command:
wrapper.java.command=C:\Program Files\Java\jdk1.7...\bin\java.exe

That did not help.

2) Finally this fixed the problem. In the windows Services, open the Sonar service and then open Log On tab. Changed the Log On to myself as follows:

enter image description here

ΦXocę 웃 Пepeúpa ツ
  • 47,427
  • 17
  • 69
  • 97
8xomaster
  • 175
  • 11
1

I was facing the same issue on sonar startup. After reading this post , i modified the JDK path in below file and it works.

  1. Modify the JDK path in wrapper.conf

  2. wrapper.java.command=%JAVA_HOME%/bin/java

Waqas Ahmed
  • 4,801
  • 3
  • 36
  • 45
1

Install jdk 11 sudo yum install java-11-openjdk -y sudo alternatives --config java

Select the JDK 11 version

Set the JDK 11 version in wrapper.conf vi /opt/sonar/conf/wrapper.conf wrapper.java.command=/usr/lib/jvm/java-11-openjdk-11.0.13.0.8-3.el8_5.x86_64/bin/java

Vishwas
  • 11
  • 1
0

Could you verify the Java version on the machine starting?

Java 6 is no more supported http://docs.sonarqube.org/display/SONAR/Requirements#Requirements-Prerequisite but from your error message, I don't know if this is the problem you meet.

Qualilogy
  • 789
  • 5
  • 6
  • That's a good point, but the machine where the sonarqube works also has same java package - java version "1.6.0_45" – Rishi Apr 01 '15 at 21:55
0

Solution 1

Set java path globally

Solution 2

  • Go to sonarqube-{version}/conf directory
  • Edit wrapper.conf file
  • Replace wrapper.java.command=java with wrapper.java.command= {path-to-your-java-bin-directory}/java

    eg: wrapper.java.command=/usr/java/bin/java

pvrforpranavvr
  • 2,708
  • 2
  • 24
  • 34
0

Try using a relative path, if your Sonar Folder is located in the same root folder as your jdk. For me my sonar and jdk are both under "Program Files", which has restrictive permission, hence the error.

E.g:

wrapper.java.command=../../../Java/jdk-11.0.4/bin/java

Mr. M
  • 37
  • 4