我无法在Windows 7上运行Sonarqube 6.7。
我刚从网站上下载了它。我使用JDK 1.8.0_144作为Java运行时。当我运行" StartSonar.bat"我得到以下异常:
wrapper | --> Wrapper Started as Console
wrapper | Launching a JVM...
jvm 1 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
jvm 1 |
jvm 1 | 2017.12.11 14:17:21 INFO app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\Tools\sonarqube-6.7\temp
jvm 1 | 2017.12.11 14:17:21 INFO app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
jvm 1 | 2017.12.11 14:17:21 INFO app[][o.s.a.p.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [C:\Tools\sonarqube-6.
7\elasticsearch]: C:\Java\jdk1.8.0_144\jre\bin\java -XX:+UseConcMarkSweepGC -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly -XX:+Always
PreTouch -server -Xss1m -Djava.awt.headless=true -Dfile.encoding=UTF-8 -Djna.nosys=true -Djdk.io.permissionsUseCanonicalPath=true -Dio.netty.noUnsafe=true -Dio.
netty.noKeySetOptimization=true -Dio.netty.recycler.maxCapacityPerThread=0 -Dlog4j.shutdownHookEnabled=false -Dlog4j2.disable.jmx=true -Dlog4j.skipJansi=true -X
ms512m -Xmx512m -XX:+HeapDumpOnOutOfMemoryError -Delasticsearch -Des.path.home=C:\Tools\sonarqube-6.7\elasticsearch -cp lib/* org.elasticsearch.bootstrap.Elasti
csearch -Epath.conf=C:\Tools\sonarqube-6.7\temp\conf\es
jvm 1 | 2017.12.11 14:17:21 INFO app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
jvm 1 | 2017.12.11 14:17:21 INFO app[][o.e.p.PluginsService] no modules loaded
jvm 1 | 2017.12.11 14:17:21 INFO app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
jvm 1 | 2017.12.11 14:17:22 WARN app[][o.e.t.n.Netty4Transport] exception caught on transport layer [[id: 0xcd8d6c6a, L:/127.0.0.1:63293 - R:/127.0.0.1:9001
]], closing connection
jvm 1 | io.netty.handler.codec.DecoderException: java.io.StreamCorruptedException: invalid internal transport message format, got (48,54,54,50)
jvm 1 | at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:459)
jvm 1 | at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)
jvm 1 | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
jvm 1 | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
jvm 1 | at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
jvm 1 | at io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:241)
jvm 1 | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
jvm 1 | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
jvm 1 | at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)
jvm 1 | at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1334)
jvm 1 | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)
jvm 1 | at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)
jvm 1 | at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:926)
jvm 1 | at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134)
jvm 1 | at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:644)
jvm 1 | at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:579)
jvm 1 | at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:496)
jvm 1 | at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:458)
jvm 1 | at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858)
jvm 1 | at java.lang.Thread.run(Thread.java:748)
jvm 1 | Caused by: java.io.StreamCorruptedException: invalid internal transport message format, got (48,54,54,50)
jvm 1 | at org.elasticsearch.transport.TcpTransport.validateMessageHeader(TcpTransport.java:1276)
jvm 1 | at org.elasticsearch.transport.netty4.Netty4SizeHeaderFrameDecoder.decode(Netty4SizeHeaderFrameDecoder.java:36)
jvm 1 | at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489)
jvm 1 | at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428)
jvm 1 | ... 19 common frames omitted

关于发生了什么的任何想法?感谢。
答案 0 :(得分:4)
我也遇到了同样的问题。经过一些故障排除后,意识到SonarQube使用的默认Elasticsearch端口已在我的Windows环境中使用
在COMMAND提示符下输出netstat -ao
Proto Local Address Foreign Address State PID
TCP 0.0.0.0:9001 UserX:0 LISTENING 4
这是sonar.properties中的默认Elasticsearch配置部分
# Elasticsearch port. Default is 9001. Use 0 to get a free port.
# As a security precaution, should be blocked by a firewall and not exposed to the Internet.
# sonar.search.port=9001
因此,我将sonar.properties中的Elasticsearch端口更改为9005,它的工作原理很吸引人。您也可以按照此处的指示使用端口0来使用空闲端口。
# Elasticsearch port. Default is 9001. Use 0 to get a free port.
# As a security precaution, should be blocked by a firewall and not exposed to the Internet.
sonar.search.port=9005
答案 1 :(得分:1)
错误是由于ElasicSearch端口与另一个端口冲突造成的。我重新配置它使用一个自由端口(看到它为0),一切正常。
答案 2 :(得分:0)
在Windows上,您可以尝试终止该进程:
netstat -ano | findstr :PORT_NUMBER
然后使用PID做下一步:
taskkill /PID PID /F
在某些情况下,例如gitbash必须使用双斜杠
taskkill //PID PID //F