SonarQube: java.lang.IllegalStateException: Webapp did not start at..: SonarQube 服务器在我启动服务器后自动关闭

SonarQube: java.lang.IllegalStateException: Webapp did not start at..: the SonarQube server was automatically closed after I started the server

我试图在远程 Ubuntu 机器上部署 SonarQube。我启动了服务器,状态信息是 'SonarQube is running'。但是几分钟后,服务器就自动关闭了。我得到这个例外:

2016.11.08 16:41:53 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Object.wait(Native Method)
 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
 com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43)
2016.11.08 16:41:53 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Object.wait(Native Method)
 java.util.TimerThread.mainLoop(Timer.java:552)
 java.util.TimerThread.run(Timer.java:505)
2016.11.08 16:41:53 INFO  web[][o.a.c.h.Http11NioProtocol] Starting ProtocolHandler ["http-nio-127.0.0.1-9000"]
2016.11.08 16:41:53 INFO  web[][o.s.s.a.TomcatAccessLog] Web server is started
2016.11.08 16:41:53 INFO  web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2016.11.08 16:41:53 WARN  web[][o.s.p.ProcessEntryPoint] Fail to start web
java.lang.IllegalStateException: Webapp did not start
        at org.sonar.server.app.EmbeddedTomcat.isUp(EmbeddedTomcat.java:84) ~[sonar-server-6.1.jar:na]
        at org.sonar.server.app.WebServer.isUp(WebServer.java:46) [sonar-server-6.1.jar:na]
        at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:105) ~[sonar-process-6.1.jar:na]
        at org.sonar.server.app.WebServer.main(WebServer.java:67) [sonar-server-6.1.jar:na]
2016.11.08 16:41:53 INFO  web[][o.a.c.h.Http11NioProtocol] Pausing ProtocolHandler ["http-nio-127.0.0.1-9000"]
2016.11.08 16:41:54 INFO  web[][o.a.c.h.Http11NioProtocol] Stopping ProtocolHandler ["http-nio-127.0.0.1-9000"]
2016.11.08 16:41:54 INFO  web[][o.a.c.h.Http11NioProtocol] Destroying ProtocolHandler ["http-nio-127.0.0.1-9000"]
2016.11.08 16:41:54 INFO  web[][o.s.s.a.TomcatAccessLog] Web server is stopped
2016.11.08 16:41:54 INFO  app[][o.s.p.m.Monitor] Process[es] is stopping
2016.11.08 16:41:55 INFO   es[][o.s.p.StopWatcher]  Stopping process
2016.11.08 16:41:55 INFO   es[][o.elasticsearch.node]  [sonarqube] stopping ...
2016.11.08 16:41:55 INFO   es[][o.elasticsearch.node]  [sonarqube] stopped
2016.11.08 16:41:55 INFO   es[][o.elasticsearch.node]  [sonarqube] closing ...
2016.11.08 16:41:55 INFO   es[][o.elasticsearch.node]  [sonarqube] closed

以下是我的版本:

下面是完整的日志

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

WrapperSimpleApp: Unable to locate the class org.sonar.application.App: java.lang.UnsupportedClassVersionError: org/sonar/application/App : Unsupported major.minor version 52.0

WrapperSimpleApp Usage:
  java org.tanukisoftware.wrapper.WrapperSimpleApp {app_class} [app_arguments]

Where:
  app_class:      The fully qualified class name of the application to run.
  app_arguments:  The arguments that would normally be passed to the
                  application.
<-- Wrapper Stopped
--> Wrapper Started as Daemon
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

WrapperSimpleApp: Unable to locate the class org.sonar.application.App: java.lang.UnsupportedClassVersionError: org/sonar/application/App : Unsupported major.minor version 52.0

WrapperSimpleApp Usage:
  java org.tanukisoftware.wrapper.WrapperSimpleApp {app_class} [app_arguments]

Where:
  app_class:      The fully qualified class name of the application to run.
  app_arguments:  The arguments that would normally be passed to the
                  application.
<-- Wrapper Stopped
--> Wrapper Started as Daemon
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

WrapperSimpleApp: Unable to locate the class org.sonar.application.App: java.lang.UnsupportedClassVersionError: org/sonar/application/App : Unsupported major.minor version 52.0
"sonar.log" 21127L, 1883274C                                                                                                                                    1,1           Top
 java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:941)
 java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 java.lang.Thread.run(Thread.java:745)
2016.11.08 21:14:58 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [Abandoned connection cleanup thread] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Object.wait(Native Method)
 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
 com.mysql.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:43)
2016.11.08 21:14:58 WARN  web[][o.a.c.l.WebappClassLoaderBase] The web application [ROOT] appears to have started a thread named [Timer-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
 java.lang.Object.wait(Native Method)
 java.util.TimerThread.mainLoop(Timer.java:552)
 java.util.TimerThread.run(Timer.java:505)
2016.11.08 21:14:58 INFO  web[][o.a.c.h.Http11NioProtocol] Starting ProtocolHandler ["http-nio-127.0.0.1-9000"]
2016.11.08 21:14:58 INFO  web[][o.s.s.a.TomcatAccessLog] Web server is started
2016.11.08 21:14:58 INFO  web[][o.s.s.a.EmbeddedTomcat] HTTP connector enabled on port 9000
2016.11.08 21:14:58 WARN  web[][o.s.p.ProcessEntryPoint] Fail to start web
java.lang.IllegalStateException: Webapp did not start
        at org.sonar.server.app.EmbeddedTomcat.isUp(EmbeddedTomcat.java:84) ~[sonar-server-6.1.jar:na]
        at org.sonar.server.app.WebServer.isUp(WebServer.java:46) [sonar-server-6.1.jar:na]
        at org.sonar.process.ProcessEntryPoint.launch(ProcessEntryPoint.java:105) ~[sonar-process-6.1.jar:na]
        at org.sonar.server.app.WebServer.main(WebServer.java:67) [sonar-server-6.1.jar:na]
2016.11.08 21:14:58 INFO  web[][o.a.c.h.Http11NioProtocol] Pausing ProtocolHandler ["http-nio-127.0.0.1-9000"]
2016.11.08 21:14:59 INFO  web[][o.a.c.h.Http11NioProtocol] Stopping ProtocolHandler ["http-nio-127.0.0.1-9000"]
2016.11.08 21:14:59 INFO  web[][o.a.c.h.Http11NioProtocol] Destroying ProtocolHandler ["http-nio-127.0.0.1-9000"]
2016.11.08 21:14:59 INFO  web[][o.s.s.a.TomcatAccessLog] Web server is stopped
2016.11.08 21:14:59 INFO  app[][o.s.p.m.Monitor] Process[es] is stopping
2016.11.08 21:15:00 INFO   es[][o.s.p.StopWatcher]  Stopping process
2016.11.08 21:15:00 INFO   es[][o.elasticsearch.node]  [sonarqube] stopping ...
2016.11.08 21:15:00 INFO   es[][o.elasticsearch.node]  [sonarqube] stopped
2016.11.08 21:15:00 INFO   es[][o.elasticsearch.node]  [sonarqube] closing ...
2016.11.08 21:15:00 INFO   es[][o.elasticsearch.node]  [sonarqube] closed
2016.11.08 21:15:00 INFO  app[][o.s.p.m.Monitor] Process[es] is stopped

著名的消息 "Unsupported major.minor version 52.0" 表示 Java 8 未被使用,而它是必需的。 您应该检查 JDK 1.8.0_111 是否在 PATH 中。如果没有,另一种方法是在 conf/wrapper.conf.

中编辑 属性 wrapper.java.command