无法在Windows上将SonarQube 5.3作为服务运行

无法在Windows上将SonarQube 5.3作为服务运行,windows,service,sonarqube,windows-server-2012-r2,sonarqube5.3,Windows,Service,Sonarqube,Windows Server 2012 R2,Sonarqube5.3,我无法在Windows Server 2012或Windows 10上运行SonarQube 5.3作为服务。使用StartSonar.bat它可以正常运行,但在安装并作为服务运行时会出现错误 “本地计算机上的SonarQube服务启动后停止。如果其他服务或程序未使用某些服务,则会自动停止这些服务。” 我尝试了具有本地管理员访问权限的特定服务用户和具有相同结果的“本地系统帐户”用户 我已经测试过启动服务,指定一个具有本地管理员访问权限的桌面用户,这可以正常工作,但我们的策略是使用特定的服务用户进

我无法在Windows Server 2012或Windows 10上运行SonarQube 5.3作为服务。使用StartSonar.bat它可以正常运行,但在安装并作为服务运行时会出现错误

本地计算机上的SonarQube服务启动后停止。如果其他服务或程序未使用某些服务,则会自动停止这些服务。”

我尝试了具有本地管理员访问权限的特定服务用户和具有相同结果的“本地系统帐户”用户

我已经测试过启动服务,指定一个具有本地管理员访问权限的桌面用户,这可以正常工作,但我们的策略是使用特定的服务用户进行服务

我尝试使用JDK 8 64位和JDK 7 32位,结果相同

sonar.log的其他内容包括

Using tick timer.
--> Wrapper Started as Service
server listening on port 32000.
Launching a JVM...
command: "C:\Program Files\Java\jdk1.8.0_72\bin\java.exe" -Djava.awt.headless=true -Xms3m -Xmx3m -Djava.library.path="./lib" -classpath "../../lib/jsw/wrapper-3.2.3.jar;../../lib/sonar-application-5.3.jar" -Dwrapper.key="Rfo5GpLfYyokZuoo" -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.debug="TRUE" -Dwrapper.pid=7932 -Dwrapper.version="3.2.3" -Dwrapper.native_library="wrapper" -Dwrapper.service="TRUE" -Dwrapper.cpu.timeout="10" -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp org.sonar.application.App
JVM started (PID=3388)
WrapperManager class initialized by thread: main  Using classloader: sun.misc.Launcher$AppClassLoader@5c647e05
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

Wrapper Manager: JVM #1
Running a 64-bit JVM.
Wrapper Manager: Registering shutdown hook
Wrapper Manager: Using wrapper
Load native library.  One or more attempts may fail if platform specific libraries do not exist.
Loading native library failed: wrapper-windows-x86-64.dll  Cause: java.lang.UnsatisfiedLinkError: no wrapper-windows-x86-64 in java.library.path
Loaded native library: wrapper.dll
Calling native initialization method.
Initializing WrapperManager native library.
Java Executable: C:\Program Files\Java\jdk1.8.0_72\bin\java.exe
Windows version: 6.3.9600
Java Version   : 1.8.0_72-b15 Java HotSpot(TM) 64-Bit Server VM
Java VM Vendor : Oracle Corporation

Control event monitor thread started.
Startup runner thread started.
WrapperManager.start(org.tanukisoftware.wrapper.WrapperSimpleApp@4f023edb, args[]) called by thread: main
Communications runner thread started.
Open socket to wrapper...Wrapper-Connection
Opened Socket from 31000 to 32000
Send a packet KEY : Rfo5GpLfYyokZuoo
handleSocket(Socket[addr=/127.0.0.1,port=32000,localport=31000])
accepted a socket from 127.0.0.1 on port 31000
read a packet KEY : Rfo5GpLfYyokZuoo
Got key from JVM: Rfo5GpLfYyokZuoo
send a packet LOW_LOG_LEVEL : 1
send a packet PING_TIMEOUT : 0
send a packet PROPERTIES : (Property Values)
Start Application.
send a packet START : start
Received a packet LOW_LOG_LEVEL : 1
Wrapper Manager: LowLogLevel from Wrapper is 1
Received a packet PING_TIMEOUT : 0
PingTimeout from Wrapper is 0
Received a packet PROPERTIES : (Property Values)
Received a packet START : start
calling WrapperListener.start()
Waiting for WrapperListener.start runner thread to complete.
WrapperListener.start runner thread started.
WrapperSimpleApp: start(args) Will wait up to 2 seconds for the main method to complete.
WrapperSimpleApp: invoking main method
Wrapper Manager: ShutdownHook started
WrapperManager.stop(0) called by thread: Wrapper-Shutdown-Hook
Send a packet STOP : 0
Startup runner thread stopped.
read a packet STOP : 0
JVM requested a shutdown. (0)
wrapperStopProcess(0) called.
Sending stop signal to JVM
send a packet STOP : NULL
Send a packet START_PENDING : 5000
read a packet START_PENDING : 5000
JVM signalled a start pending with waitHint of 5000 millis.
Thread, Wrapper-Shutdown-Hook, handling the shutdown process.
shutdownJVM(0) Thread:Wrapper-Shutdown-Hook
Send a packet STOPPED : 0
read a packet STOPPED : 0
JVM signalled that it was stopped.
Closing socket.
socket read no code (closed?).
server listening on port 32002.
Send a packet START_PENDING : 5000
Wrapper Manager: ShutdownHook complete
WrapperSimpleApp: start(args) end.  Main Completed=false, exitCode=null
WrapperListener.start runner thread stopped.
JVM process exited with a code of 0, leaving the wrapper exit code set to 0.
JVM exited normally.
<-- Wrapper Stopped
--> Wrapper Started as Service
Using tick timer.
server listening on port 32000.
Launching a JVM...
command: "C:\Program Files\Java\jdk1.8.0_72\bin\java.exe" -Djava.awt.headless=true -Xms3m -Xmx3m -Djava.library.path="./lib" -classpath "../../lib/jsw/wrapper-3.2.3.jar;../../lib/sonar-application-5.3.jar" -Dwrapper.key="dvwrESWxTion4Weh" -Dwrapper.port=32000 -Dwrapper.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.debug="TRUE" -Dwrapper.pid=4304 -Dwrapper.version="3.2.3" -Dwrapper.native_library="wrapper" -Dwrapper.service="TRUE" -Dwrapper.cpu.timeout="10" -Dwrapper.jvmid=1 org.tanukisoftware.wrapper.WrapperSimpleApp org.sonar.application.App
JVM started (PID=376)
WrapperManager class initialized by thread: main  Using classloader: sun.misc.Launcher$AppClassLoader@5c647e05
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.

Wrapper Manager: JVM #1
Running a 64-bit JVM.
Wrapper Manager: Registering shutdown hook
Wrapper Manager: Using wrapper
Load native library.  One or more attempts may fail if platform specific libraries do not exist.
Loading native library failed: wrapper-windows-x86-64.dll  Cause: java.lang.UnsatisfiedLinkError: no wrapper-windows-x86-64 in java.library.path
Loaded native library: wrapper.dll
Calling native initialization method.
Initializing WrapperManager native library.
Java Executable: C:\Program Files\Java\jdk1.8.0_72\bin\java.exe
Windows version: 6.3.9600
Java Version   : 1.8.0_72-b15 Java HotSpot(TM) 64-Bit Server VM
Java VM Vendor : Oracle Corporation

Control event monitor thread started.
Startup runner thread started.
WrapperManager.start(org.tanukisoftware.wrapper.WrapperSimpleApp@4f023edb, args[]) called by thread: main
Communications runner thread started.
Open socket to wrapper...Wrapper-Connection
Opened Socket from 31000 to 32000
Send a packet KEY : dvwrESWxTion4Weh
handleSocket(Socket[addr=/127.0.0.1,port=32000,localport=31000])
accepted a socket from 127.0.0.1 on port 31000
read a packet KEY : dvwrESWxTion4Weh
Got key from JVM: dvwrESWxTion4Weh
send a packet LOW_LOG_LEVEL : 1
send a packet PING_TIMEOUT : 0
send a packet PROPERTIES : (Property Values)
Start Application.
send a packet START : start
Received a packet LOW_LOG_LEVEL : 1
Wrapper Manager: LowLogLevel from Wrapper is 1
Received a packet PING_TIMEOUT : 0
PingTimeout from Wrapper is 0
Received a packet PROPERTIES : (Property Values)
Received a packet START : start
calling WrapperListener.start()
Waiting for WrapperListener.start runner thread to complete.
WrapperListener.start runner thread started.
WrapperSimpleApp: start(args) Will wait up to 2 seconds for the main method to complete.
WrapperSimpleApp: invoking main method
Wrapper Manager: ShutdownHook started
WrapperManager.stop(0) called by thread: Wrapper-Shutdown-Hook
Send a packet STOP : 0
Startup runner thread stopped.
read a packet STOP : 0
JVM requested a shutdown. (0)
wrapperStopProcess(0) called.
Sending stop signal to JVM
send a packet STOP : NULL
Send a packet START_PENDING : 5000
read a packet START_PENDING : 5000
JVM signalled a start pending with waitHint of 5000 millis.
Thread, Wrapper-Shutdown-Hook, handling the shutdown process.
shutdownJVM(0) Thread:Wrapper-Shutdown-Hook
Send a packet STOPPED : 0
read a packet STOPPED : 0
JVM signalled that it was stopped.
Closing socket.
socket read no code (closed?).
server listening on port 32002.
Send a packet START_PENDING : 5000
Wrapper Manager: ShutdownHook complete
WrapperSimpleApp: start(args) end.  Main Completed=false, exitCode=null
WrapperListener.start runner thread stopped.
JVM process exited with a code of 0, leaving the wrapper exit code set to 0.
JVM exited normally.
<-- Wrapper Stopped

通过包装器启动sonar是否需要某种分叉权限?

通过本地添加的windows服务用户和给定的桌面交互权限,我现在可以启动SonarQube服务

将SonarQube服务配置为不使用本地系统帐户,而是使用其他具有更多权限的用户

请参见


另一种解决方案,不需要从LocalSystem更改用户或授予额外权限,就是在
conf\wrapper.conf
中指定
java.exe
二进制文件的完整路径。例如:

wrapper.java.command=C:\Program Files\Java\jdk1.8.0_144\bin\java.exe
andyd提出的包装器在分叉Java进程时失败的假设正是我的情况,日志文件(在
logs\sonar.log
中)中的一条错误消息揭示了这一点


在我的情况下,指定普通用户帐户不是一个实用的解决方案,因为公司密码策略要求每隔几周更改一次密码。

这基本上是正确的答案,但问题是我不知道缺少哪些权限。事实证明,授予用户桌面交互权限可以让它工作。我认为这是因为包装器需要它来分叉java进程
wrapper.java.command=C:\Program Files\Java\jdk1.8.0_144\bin\java.exe