gpt4 book ai didi

java - SonarQube Eclipse 插件 3.4 由于连接超时而无法到达 Sonar 服务器

转载 作者:太空宇宙 更新时间:2023-11-04 13:38:40 31 4
gpt4 key购买 nike

我已经在 RAD 9 (Eclipse 4.2) 上安装了 SonarQube Eclipse 插件 3.4我已经提供了服务器 URL(SonarQube 服务器 4.5.4)并测试了连接...一切正常。

当我将我的项目关联到 SonarQube 时,该项目被识别,但当它开始检索远程问题时(单击分析后),我收到此异常:

Retrieve remote issues of project myProject...
Start SonarQube analysis on myProject...
ERROR: Sonar server 'https://sonarServer/sonar' can not be reached
Exception in thread "main" org.sonar.runner.kevinsawicki.HttpRequest$HttpRequestException: java.net.ConnectException: Connection timed out: connect
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:90)
at org.sonar.runner.impl.ServerVersion.downloadVersion(ServerVersion.java:48)
at org.sonar.runner.impl.ServerVersion.version(ServerVersion.java:39)
at org.sonar.runner.impl.ServerVersion.is35Compatible(ServerVersion.java:63)
at org.sonar.runner.impl.JarDownloader.download(JarDownloader.java:39)
at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:71)
at java.security.AccessController.doPrivileged(AccessController.java:274)
at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:69)
at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
at org.sonar.runner.impl.BatchLauncherMain.execute(BatchLauncherMain.java:41)
at org.sonar.runner.impl.BatchLauncherMain.main(BatchLauncherMain.java:59)
Caused by: java.net.ConnectException: Connection timed out: connect
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:68)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:529)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1674)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1672)
at java.security.AccessController.doPrivileged(AccessController.java:330)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1670)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1243)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
at com.ibm.net.ssl.www2.protocol.https.b.getResponseCode(b.java:27)
at org.sonar.runner.kevinsawicki.HttpRequest.code(HttpRequest.java:1390)
... 12 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:85)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:358)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:219)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:201)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:180)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:616)
at com.ibm.jsse2.qc.connect(qc.java:46)
at sun.net.NetworkClient.doConnect(NetworkClient.java:175)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:395)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:490)
at com.ibm.net.ssl.www2.protocol.https.c.<init>(c.java:179)
at com.ibm.net.ssl.www2.protocol.https.c.a(c.java:172)
at com.ibm.net.ssl.www2.protocol.https.d.getNewHttpClient(d.java:21)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:931)
at com.ibm.net.ssl.www2.protocol.https.d.connect(d.java:62)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1299)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2677)
at com.ibm.net.ssl.www2.protocol.https.b.getHeaderField(b.java:35)
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:86)
... 10 more

编辑这是服务器访问.log

     127.0.0.1 - - [03/01/2016:10:26:58 +0200] "GET /sonar/api/server/index HTTP/1.1" 200 55 "-" "Apache-HttpClient/4.2.2 (java 1.5)"
127.0.0.1 - - [03/01/2016:10:27:05 +0200] "GET /sonar/api/authentication/validate HTTP/1.1" 200 14 "-" "Apache-HttpClient/4.2.2 (java 1.5)"
127.0.0.1 - - [03/01/2016:10:27:16 +0200] "GET /sonar/api/server/index HTTP/1.1" 200 55 "-" "Apache-HttpClient/4.2.2 (java 1.5)"
127.0.0.1 - - [03/01/2016:10:27:55 +0200] "GET /sonar/api/resources?resource=com.myproject%3Amymodule%3ASNAPSHOT&verbose=false& HTTP/1.1" 200 306 "-" "Apache-HttpClient/4.2.2 (java 1.5)"
127.0.0.1 - - [03/01/2016:10:28:04 +0200] "GET /sonar/api/issues/search?resolved=false&pageSize=-1&componentRoots=com.myproject:mymodule:SNAPSHOT&pageIndex=1 HTTP/1.1" 200 - "-" "Java/1.7.0"
127.0.0.1 - - [03/01/2016:10:28:09 +0200] "GET /sonar/api/issues/search?resolved=false&pageSize=-1&componentRoots=com.myproject:mymodule:SNAPSHOT&pageIndex=2 HTTP/1.1" 200 - "-" "Java/1.7.0"
127.0.0.1 - - [03/01/2016:10:28:13 +0200] "GET /sonar/api/issues/search?resolved=false&pageSize=-1&componentRoots=com.myproject:mymodule:SNAPSHOT&pageIndex=3 HTTP/1.1" 200 - "-" "Java/1.7.0"
127.0.0.1 - - [03/01/2016:10:28:17 +0200] "GET /sonar/api/issues/search?resolved=false&pageSize=-1&componentRoots=com.myproject:mymodule:SNAPSHOT&pageIndex=4 HTTP/1.1" 200 - "-" "Java/1.7.0"
127.0.0.1 - - [03/01/2016:10:28:21 +0200] "GET /sonar/api/issues/search?resolved=false&pageSize=-1&componentRoots=com.myproject:mymodule:SNAPSHOT&pageIndex=5 HTTP/1.1" 200 - "-" "Java/1.7.0"
127.0.0.1 - - [03/01/2016:10:28:24 +0200] "GET /sonar/api/issues/search?resolved=false&pageSize=-1&componentRoots=com.myproject:mymodule:SNAPSHOT&pageIndex=6 HTTP/1.1" 200 - "-" "Java/1.7.0"
127.0.0.1 - - [03/01/2016:10:28:36 +0200] "GET /sonar/api/resources?resource=com.myproject%3Amymodule%3ASNAPSHOT&metrics=&verbose=false& HTTP/1.1" 200 306 "-" "Apache-HttpClient/4.2.2 (java 1.5)"

sonar.log 文件中没有显示任何内容

编辑结束

有时它检索到问题的一部分,有时却没有检索到其中任何一个

谢谢

最佳答案

我发现使用eclipse启动analyze时会执行以下命令:

java.exe -cp C:\Users\xxxx\AppData\Local\Temp\sonar-runner-impl6867841822221012221.jar 
org.sonar.runner.impl.BatchLauncherMain
C:\Users\xxxx\AppData\Local\Temp\sonar-project3666940761827968492.properties

因为我正在 Eclipse 网络首选项部分中配置的代理后面工作,所以除非添加代理配置,否则它将无法到达服务器。因此,为了测试我已经使用 https 的代理配置选项(-Dhttps.proxyHost -Dhttps.proxyPort -Dhttps.proxyUser -Dhttps.proxyPassword)执行了命令行,并且命令已成功。

我认为这是一个错误。在创建和启动命令之前,插件必须检查代理配置是否存在

编辑

要解决该问题,请转到首选项>>SonarQube>>用于预览分析的 JVM 参数:将代理参数放入该字段中,它应该可以工作

关于java - SonarQube Eclipse 插件 3.4 由于连接超时而无法到达 Sonar 服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31433628/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com