运行时声纳运行器 SocketTimeoutException [英] sonar runner SocketTimeoutException when running

查看:9
本文介绍了运行时声纳运行器 SocketTimeoutException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用声纳,一切正常.然后在一个月左右不使用它后,我在运行 sonar-runner.bat 时开始收到以下异常

i was working with sonar and everything was working just fine. then after a month or so not using it i started receiving the following exception when running the sonar-runner.bat

我正在使用嵌入式 h2 db 服务器并使用默认端口.

i am using the embedded h2 db server and use the default ports.

INFO: Error stacktraces are turned on.
INFO: Runner configuration file: C:sonarsonar-runner-2.2.2confsonar-runner.properties
INFO: Project configuration file: c:eclipseworkspacesprojNamesonar-project.properties
INFO: Default locale: "iw_IL", source code encoding: "UTF-8"
INFO: Work directory: c:eclipseworkspacesprojName.sonar
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 1:00.553s
Final Memory: 1M/242M
INFO: ------------------------------------------------------------------------
ERROR: Error during Sonar runner execution
org.sonar.runner.kevinsawicki.HttpRequest$HttpRequestException: java.net.SocketTimeoutException: Read timed out
        at org.sonar.runner.kevinsawicki.HttpRequest.code(HttpRequest.java:1392)
        at org.sonar.runner.kevinsawicki.HttpRequest.ok(HttpRequest.java:1417)
        at org.sonar.runner.impl.ServerConnection.downloadString(ServerConnection.java:83)
        at org.sonar.runner.impl.ServerVersion.downloadVersion(ServerVersion.java:49)
        at org.sonar.runner.impl.ServerVersion.version(ServerVersion.java:40)
        at org.sonar.runner.impl.ServerVersion.is35Compatible(ServerVersion.java:64)
        at org.sonar.runner.impl.JarDownloader.download(JarDownloader.java:39)
        at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:59)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:57)
        at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
        at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:71)
        at org.sonar.runner.api.Runner.execute(Runner.java:89)
        at org.sonar.runner.Main.executeTask(Main.java:70)
        at org.sonar.runner.Main.execute(Main.java:59)
        at org.sonar.runner.Main.main(Main.java:41)
Caused by: java.net.SocketTimeoutException: Read timed out
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1491)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1485)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1139)
        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)
        at org.sonar.runner.kevinsawicki.HttpRequest.code(HttpRequest.java:1390)
        ... 15 more
Caused by: java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:129)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:697)
        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:640)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1195)
        at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2300)
        at org.sonar.runner.kevinsawicki.HttpRequest.header(HttpRequest.java:1903)
        at org.sonar.runner.kevinsawicki.HttpRequest.contentType(HttpRequest.java:2308)
        at org.sonar.runner.impl.ServerConnection.downloadString(ServerConnection.java:79)
        ... 13 more

推荐答案

  1. 转到:sonar-runner-2.3/conf/sonar-runner.properties
  2. 取消注释该行:#sonar.host.url=http://localhost:9000
  3. 用你的 IP 替换 localhost 并保存文件!示例:sonar.host.url=http://192.168.0.12:9000
  1. Go to: sonar-runner-2.3/conf/sonar-runner.properties
  2. Uncomment the line: #sonar.host.url=http://localhost:9000
  3. Replace localhost with your IP and save the file! example:sonar.host.url=http://192.168.0.12:9000

这篇关于运行时声纳运行器 SocketTimeoutException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆