hmvictor / radar-netbeans

A SonarQube plugin for Netbeans
Other
33 stars 22 forks source link

Proxy support #36

Closed rodolpheche closed 8 years ago

rodolpheche commented 9 years ago

Hi!

It seems that the radar-netbeans plugin doesn't support proxies (and doesn't inherit the netbeans proxy configuration). When I try to "Get Issues from Server", then "Load project list...", I get a "SocketTimeoutException: Connect timed out" It works when not passing through proxy.

So, I decided to inspect the plugin source code. The SonarQube class uses the Sonar class to retrieve projectKeys but this class doesn't handle proxy configuration.

Do you confirm ?

Here is the full stacktrace from netbeans, just after trying to "Get Issues from Server":

java.net.SocketTimeoutException: Connect timed out at java.net.SocksSocketImpl.readSocksReply(SocksSocketImpl.java:126) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:459) at java.net.Socket.connect(Socket.java:589) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:140) Caused: org.apache.commons.httpclient.ConnectTimeoutException: The host did not accept the connection within timeout of 30000 ms at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:155) at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:125) at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707) at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) at org.sonar.wsclient.connectors.HttpClient3Connector.executeRequest(HttpClient3Connector.java:102) Caused: org.sonar.wsclient.connectors.ConnectionException: Query: org.apache.commons.httpclient.methods.GetMethod@370fef53 at org.sonar.wsclient.connectors.HttpClient3Connector.executeRequest(HttpClient3Connector.java:115) at org.sonar.wsclient.connectors.HttpClient3Connector.execute(HttpClient3Connector.java:81) at org.sonar.wsclient.Sonar.findAll(Sonar.java:63) at qubexplorer.server.SonarQube.getProjectsKeys(SonarQube.java:216) at qubexplorer.server.SonarQube.existsProject(SonarQube.java:259) at qubexplorer.server.SonarQube.getSummary(SonarQube.java:269) at qubexplorer.ui.SummaryTask.execute(SummaryTask.java:28) at qubexplorer.ui.SummaryTask.execute(SummaryTask.java:16) at qubexplorer.ui.task.TaskExecutor$TaskWorker.doInBackground(TaskExecutor.java:62) at javax.swing.SwingWorker$1.call(SwingWorker.java:295) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at javax.swing.SwingWorker.run(SwingWorker.java:334) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [catch] at java.lang.Thread.run(Thread.java:745)

hmvictor commented 9 years ago

I will check this issue, thanks for your feedback.

rodolpheche commented 9 years ago

I made static tests using the method owned by the gshakhn sonar-intellij-plugin project and it worked.

This method is available here : https://github.com/gshakhn/sonar-intellij-plugin/blob/master/src/main/java/org/sonar/ide/intellij/utils/SonarUtils.java#L24

hmvictor commented 9 years ago

I've started to implement this feature.

So much thank you for your suggestions and useful information, rodolpheche.

rodolpheche commented 9 years ago

You're welcome

hmvictor commented 8 years ago

Hi, I've just implemented proxy support related to this issue. The fix is in branch 2.5.

rodolpheche commented 8 years ago

It works perfectly ! Thanks !

hmvictor commented 8 years ago

:)