Sonarqube 7.6 fails startup failure: FATAL Log4j2 could not find a logging implementation

Sonarqube/Elasticsearch fails starting-up with log4j errors:

  • Sonarqube 7.6
2019.03.19 10:51:25 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
FATAL StatusLogger Interrupted before Log4j Providers could be loaded.
 java.lang.InterruptedException
	at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1220)
	at java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:335)
	at org.apache.logging.log4j.util.ProviderUtil.lazyInit(ProviderUtil.java:121)
	at org.apache.logging.log4j.util.ProviderUtil.hasProviders(ProviderUtil.java:108)
	at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:89)
	at org.elasticsearch.common.logging.ESLoggerFactory.getLogger(ESLoggerFactory.java:54)
	at org.elasticsearch.common.logging.Loggers.getLogger(Loggers.java:105)
	at org.elasticsearch.common.logging.Loggers.getLogger(Loggers.java:72)
	at org.elasticsearch.common.component.AbstractComponent.<init>(AbstractComponent.java:37)
	at org.elasticsearch.plugins.PluginsService.<init>(PluginsService.java:97)
	at org.elasticsearch.client.transport.TransportClient.newPluginService(TransportClient.java:101)
	at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:126)
	at org.elasticsearch.client.transport.TransportClient.<init>(TransportClient.java:254)
	at org.sonar.application.es.EsConnectorImpl$MinimalTransportClient.<init>(EsConnectorImpl.java:104)
	at org.sonar.application.es.EsConnectorImpl.buildTransportClient(EsConnectorImpl.java:90)
	at org.sonar.application.es.EsConnectorImpl.getTransportClient(EsConnectorImpl.java:75)
	at org.sonar.application.es.EsConnectorImpl.getClusterHealthStatus(EsConnectorImpl.java:62)
	at org.sonar.application.process.EsProcessMonitor.checkStatus(EsProcessMonitor.java:90)
	at org.sonar.application.process.EsProcessMonitor.checkOperational(EsProcessMonitor.java:75)
	at org.sonar.application.process.EsProcessMonitor.isOperational(EsProcessMonitor.java:60)
	at org.sonar.application.process.SQProcess.refreshState(SQProcess.java:161)
	at org.sonar.application.process.SQProcess$EventWatcher.run(SQProcess.java:220)
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
  • Sonarqube on CentOS7 and Openjdk version “1.8.0_201”
1 Like

I have fixed this, the problems was with some wrong Elasticsearch configs, Xms and Xmx were inverted

1 Like

Weird behavior! Thanks for the follow-up Federico.

Excuse me,I used it for the first time and have the same problem. Can you tell me how to solve it?
I don’t know what “Xms and Xmx were inverted” mean?

How did you fix it?

I had the same issue. I still have not resolved the log4j exception that is visible in the log file, but I found out there was some strange configuration in the sonar.properties file, and namely - I had an entry named sonar.search.javaOpts, which I commented out, and finally I have only sonar.jdbc.url/password/username in the configuration file.

Used JDK 15, had same issue

Installed OpenJDK 11 instead (https://jdk.java.net/java-se-ri/11)

opened “[path to sonarqube folder]\conf\wrapper.conf

replaced “wrapper.java.command=java

with “wrapper.java.command=C:\Program Files\Java\jdk-11\bin\java.exe

worked for me.

As an old topic with a good solution, I’m going to mark this closed :+1: