0
votes

When I do the local analysis in sonar eclipse plugin, I'm getting the following output in the console

Registered 104 metrics
Registered repository findbugs/java with 384 rules
Registered repository checkstyle/java with 122 rules
Registered repository pmd/java with 224 rules
Registered repository squid/java with 12 rules

and then an error

An internal error occurred during: "Sonar Analysis". org.sonar.wsclient.connectors.ConnectionException: Can not read response

Can anyone help me out with this?

Edit:I tried in both modes "Run as normal user" and "Run as administrator". One more thing is it is working in Windows7 and not in Vista. Is it OS problem?

Edit:Getting this stack trace in the sonar console

jvm 1    | 2012-03-27 04:30:49.146:INFO::org.mortbay.io.nio.SelectorManager$Sele
ctSet@a0199a JVM BUG(s) - recreating selector 1 times, canceled keys 0 times
jvm 1    | 2012-03-27 04:31:14.306:WARN:/:Error: Couldn't handle error: response
 committed
jvm 1    | org.jruby.exceptions.RaiseException: Native Exception: 'class org.mor
tbay.jetty.EofException'; Message: timeout; StackTrace: org.mortbay.jetty.EofExc
eption: timeout<|?at org.mortbay.jetty.AbstractGenerator$Output.blockForOutput(A
bstractGenerator.java:547)<|?at org.mortbay.jetty.AbstractGenerator$Output.flush
(AbstractGenerator.java:571)<|?at org.mortbay.jetty.HttpConnection$Output.flush(
HttpConnection.java:1010)<|?at org.mortbay.jetty.AbstractGenerator$Output.write(
AbstractGenerator.java:650)<|?at org.mortbay.jetty.AbstractGenerator$Output.writ
e(AbstractGenerator.java:590)<|?at sun.reflect.NativeMethodAccessorImpl.invoke0(
Native Method)<|?at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)<
|?at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)<|?at java.l
ang.reflect.Method.invoke(Unknown Source)<|?at org.jruby.javasupport.JavaMethod.
invokeDirectWithExceptionHandling(JavaMethod.java:525)<|
jvm 1    |      at org.mortbay.jetty.AbstractGenerator$Output.blockForOutput(Abs
tractGenerator.java:547)
jvm 1    |      at org.mortbay.jetty.AbstractGenerator$Output.flush(AbstractGene
rator.java:571)
jvm 1    |      at org.mortbay.jetty.HttpConnection$Output.flush(HttpConnection.
java:1010)
jvm 1    |      at org.mortbay.jetty.AbstractGenerator$Output.write(AbstractGene
rator.java:650)
jvm 1    |      at org.mortbay.jetty.AbstractGenerator$Output.write(AbstractGene
rator.java:590)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
jvm 1    |      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)
jvm 1    |      at java.lang.reflect.Method.invoke(Unknown Source)
jvm 1    |      at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHan
dling(JavaMethod.java:525)

Edit: Tried by changing database from derby to mysql but of no use. But Java Runner is working okay. Why the eclipse plug-in is failing?

1
look at this Issue, it may help you SONARIDE-192 - Chandra Sekhar
@ChandraSekhar I am not getting NPE. I am getting "Can not read response" and there is no reason why it is giving that error. - Ravindra Gullapalli
Ravindra, can you try to catch the HTTP request that is sent to the Sonar server and that fails? I can't see from the log where it can come from. Also, this is weird that it works on Win7 but not on Vista, as nothing is OS specific. Are you sure you have exactly the same configuration? - Fabrice - SonarSource Team
@Fabrice-SonarTeam Yes I am using Eclipse Indigo in both Win7 and Vista and it is failing only in vista. - Ravindra Gullapalli
@Fabrice-SonarTeam Should I reinstall eclipse and sonar plug-in again? - Ravindra Gullapalli

1 Answers

2
votes

Running in tomcat solved my issue. Now I am able to use Sonar in Windows vista too. Procedure to configure sonar in tomcat is very simple and is available in Sonar Installation Instructions. Check Mode 2 - Deploy on Java EE Server in that page. If not working, just login into sonar as admin/admin and go to configure and change the default quality profile between Sonar way and Sonar way with Findbugs. This worked for me.