SonarQube 无法启动 Windows 10

Posted

技术标签:

【中文标题】SonarQube 无法启动 Windows 10【英文标题】:SonarQube does not start windows 10 【发布时间】:2021-01-18 05:07:58 【问题描述】:

我在使用 JAVA JDK-15 的 Windows 10 上启动 sonarqube-8.4.2.36762 时遇到问题。 在 Wrapper.conf 中,我设置了正确的 JDK 路径。

这是日志:

--> Wrapper Started as Console
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

2020.10.02 15:53:29 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\sonarqube-8.4.2.36762\temp
2020.10.02 15:53:29 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
2020.10.02 15:53:29 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [C:\sonarqube-8.4.2.36762\elasticsearch]: C:\Program Files\Java\jdk-15\bin\java -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -Des.networkaddress.cache.ttl=60 -Des.networkaddress.cache.negative.ttl=10 -XX:+AlwaysPreTouch -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -XX:-OmitStackTraceInFastThrow -Dio.netty.noUnsafe=true -Dio.netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Djava.io.tmpdir=C:\sonarqube-8.4.2.36762\temp -XX:ErrorFile=../logs/es_hs_err_pid%p.log -Xmx512m -Xms512m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\sonarqube-8.4.2.36762\elasticsearch -Des.path.conf=C:\sonarqube-8.4.2.36762\temp\conf\es -cp lib/* org.elasticsearch.bootstrap.Elasticsearch
2020.10.02 15:53:29 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
Unrecognized VM option 'UseConcMarkSweepGC'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
2020.10.02 15:53:30 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
2020.10.02 15:53:30 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
2020.10.02 15:53:30 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
FATAL StatusLogger Interrupted before Log4j Providers could be loaded.
 java.lang.InterruptedException
    at java.base/java.util.concurrent.locks.ReentrantLock$Sync.lockInterruptibly(ReentrantLock.java:159)
    at java.base/java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:372)
    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.unit.ByteSizeValue.<clinit>(ByteSizeValue.java:39)
    at org.elasticsearch.common.network.NetworkService.<clinit>(NetworkService.java:57)
    at org.elasticsearch.transport.TransportSettings.<clinit>(TransportSettings.java:74)
    at org.elasticsearch.client.transport.TransportClient.newPluginService(TransportClient.java:105)
    at org.elasticsearch.client.transport.TransportClient.buildTemplate(TransportClient.java:135)
    at org.elasticsearch.client.transport.TransportClient.<init>(TransportClient.java:277)
    at org.sonar.application.es.EsConnectorImpl$MinimalTransportClient.<init>(EsConnectorImpl.java:103)
    at org.sonar.application.es.EsConnectorImpl.buildTransportClient(EsConnectorImpl.java:89)
    at org.sonar.application.es.EsConnectorImpl.getTransportClient(EsConnectorImpl.java:74)
    at org.sonar.application.es.EsConnectorImpl.getClusterHealthStatus(EsConnectorImpl.java:61)
    at org.sonar.application.process.EsManagedProcess.checkStatus(EsManagedProcess.java:88)
    at org.sonar.application.process.EsManagedProcess.checkOperational(EsManagedProcess.java:73)
    at org.sonar.application.process.EsManagedProcess.isOperational(EsManagedProcess.java:58)
    at org.sonar.application.process.ManagedProcessHandler.refreshState(ManagedProcessHandler.java:220)
    at org.sonar.application.process.ManagedProcessHandler$EventWatcher.run(ManagedProcessHandler.java:285)
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
<-- Wrapper Stopped

JDK-15有什么问题吗?

【问题讨论】:

【参考方案1】:

这是Java 15的问题。你need to install Java 11执行程序:

SonarQube 需要 Java 11 才能运行

例如你可以从这个website下载它。

【讨论】:

【参考方案2】:

当我安装 JDK 11 版本并删除我之前安装的较新的 JDK 16 版本时,它也对我有用(必须卸载,否则我仍然会遇到同样的错误)。我从Oracle website得到了JDK 11

【讨论】:

以上是关于SonarQube 无法启动 Windows 10的主要内容,如果未能解决你的问题,请参考以下文章

SonarQube 8.5.1 - 无法启动服务 - 包装器错误

无法在 Windows 上安装 sonarqube 7.1

静态代码扫描工具 - sonarQube快速安装和启动(windows平台)

静态代码扫描工具 - sonarQube快速安装和启动(windows平台)

启动 SonarQube 7.1 Web 服务器时的问题

由于找不到分析配置文件,SonarQube 分析无法完成