NullPointerException in web service engine while displaying a rule

112 views
Skip to first unread message

sebastie...@neomades.com

unread,
Nov 17, 2015, 6:47:15 AM11/17/15
to SonarQube
Hi everyone,

I'm using SonarQube version 5.2 ad I'm experiencing a problem when I try to display the details of a rule: a tooltip indicates that the operation failed and there is a NullPointerException in the logs.

Steps to reproduce the bug:
 - select "Quality Profiles"
 - select "Sonar way"
 - click on the number of active rules to display the list of rules
 - the first rule is "Anon Inner Length"; click on this rule

Result: a red tooltip says "Failed".

I've displayed several other rules without any problem.

In sonar.log, the following error is reported:
2015.11.17 12:38:35 ERROR web[o.s.s.w.WebServiceEngine] Fail to process request http://<host>:9000/api/rules/show?key=checkstyle%3Acom.puppycrawl.tools.checkstyle.checks.sizes.AnonInnerLengthCheck&actives=true
java.lang.NullPointerException: null
    at org.sonarqube.ws.Rules$Active$Param$Builder.setValue(Rules.java:14919) ~[sonar-ws-5.2.jar:na]
    at org.sonar.server.rule.ws.ActiveRuleCompleter.buildActiveRuleResponse(ActiveRuleCompleter.java:121) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.rule.ws.ActiveRuleCompleter.completeShow(ActiveRuleCompleter.java:93) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.rule.ws.ShowAction.buildResponse(ShowAction.java:91) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.rule.ws.ShowAction.handle(ShowAction.java:82) ~[sonar-server-5.2.jar:na]
    at org.sonar.server.ws.WebServiceEngine.execute(WebServiceEngine.java:85) ~[sonar-server-5.2.jar:na]
    at sun.reflect.GeneratedMethodAccessor179.invoke(Unknown Source) ~[na:na]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_85]
    at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_85]
    at org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(JavaMethod.java:425) [jruby-complete-1.7.9.jar:na]
    at org.jruby.javasupport.JavaMethod.invokeDirect(JavaMethod.java:292) [jruby-complete-1.7.9.jar:na]
    at org.jruby.java.invokers.InstanceMethodInvoker.call(InstanceMethodInvoker.java:44) [jruby-complete-1.7.9.jar:na]
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:70) [jruby-complete-1.7.9.jar:na]
    at rubyjit.Api::JavaWsController$$index_F0093F46F7B98A69318D6BFF77A0745BB14C850A1743108370.__file__(/opt/sonar/web/WEB-INF/app/controllers/api/java_ws_controller.rb:34) [jruby-complete-1.7.9.jar:na]
    at rubyjit.Api::JavaWsController$$index_F0093F46F7B98A69318D6BFF77A0745BB14C850A1743108370.__file__(/opt/sonar/web/WEB-INF/app/controllers/api/java_ws_controller.rb) [jruby-complete-1.7.9.jar:na]
    at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:161) [jruby-complete-1.7.9.jar:na]
    at org.jruby.RubyClass.finvoke(RubyClass.java:527) [jruby-complete-1.7.9.jar:na]
    at org.jruby.RubyBasicObject.send(RubyBasicObject.java:2590) [jruby-complete-1.7.9.jar:na]
    at org.jruby.RubyKernel.send(RubyKernel.java:2223) [jruby-complete-1.7.9.jar:na]
    at org.jruby.RubyKernel$INVOKER$s$send.call(RubyKernel$INVOKER$s$send.gen) [jruby-complete-1.7.9.jar:na]
    at org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneOrNBlock.call(JavaMethod.java:350) [jruby-complete-1.7.9.jar:na]
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:326) [jruby-complete-1.7.9.jar:na]
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:170) [jruby-complete-1.7.9.jar:na]
    at rubyjit.ActionController::Base$$perform_action_DA0FC0A901DD1257EC969DB0C482DD8514B8F04B1743108370.__file__(/opt/sonar/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/base.rb:1333) [jruby-complete-1.7.9.jar:na]
    at rubyjit.ActionController::Base$$perform_action_DA0FC0A901DD1257EC969DB0C482DD8514B8F04B1743108370.__file__(/opt/sonar/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/base.rb) [jruby-complete-1.7.9.jar:na]
    at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:141) [jruby-complete-1.7.9.jar:na]
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:185) [jruby-complete-1.7.9.jar:na]
    at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:56) [jruby-complete-1.7.9.jar:na]
    at org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306) [jruby-complete-1.7.9.jar:na]
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136) [jruby-complete-1.7.9.jar:na]
    at rubyjit.ActionController::Filters::InstanceMethods$$call_filters_A7E1D3FFBF56E3CB7C0EBA850688505249A05AE91743108370.__file__(/opt/sonar/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/filters.rb:617) [jruby-complete-1.7.9.jar:na]
    at rubyjit.ActionController::Filters::InstanceMethods$$call_filters_A7E1D3FFBF56E3CB7C0EBA850688505249A05AE91743108370.__file__(/opt/sonar/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/filters.rb) [jruby-complete-1.7.9.jar:na]
    at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:261) [jruby-complete-1.7.9.jar:na]
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:236) [jruby-complete-1.7.9.jar:na]
    at rubyjit.ActionController::Filters::InstanceMethods$$perform_action_with_filters_4C7C67B4A5564FF5DC76344AF2372660F608839C1743108370.__file__(/opt/sonar/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/filters.rb:610) [jruby-complete-1.7.9.jar:na]
    at rubyjit.ActionController::Filters::InstanceMethods$$perform_action_with_filters_4C7C67B4A5564FF5DC76344AF2372660F608839C1743108370.__file__(/opt/sonar/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/filters.rb) [jruby-complete-1.7.9.jar:na]
    at org.jruby.internal.runtime.methods.JittedMethod.call(JittedMethod.java:141) [jruby-complete-1.7.9.jar:na]
    at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:185) [jruby-complete-1.7.9.jar:na]
    at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:56) [jruby-complete-1.7.9.jar:na]
    at org.jruby.internal.runtime.methods.AliasMethod.call(AliasMethod.java:56) [jruby-complete-1.7.9.jar:na]
    at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:134) [jruby-complete-1.7.9.jar:na]
[...]


I've truncated the stack trace because it is quite long but I can provide the full stack trace if necessary.

Please tell me if more information is needed.

Best regards,
--
Sébastien Christy

sebastie...@neomades.com

unread,
Nov 17, 2015, 8:13:39 AM11/17/15
to SonarQube, sebastie...@neomades.com
Hi,

I've found a workaround.
I had the same error as above while displaying the list of rules of one of the quality profiles. I made a copy of this profile and then removed it (keeping the copy) and the problem has disappeared. I can now display the "Anon Inner Length" rule without any error.

Teryk Bellahsene

unread,
Nov 26, 2015, 9:40:58 AM11/26/15
to SonarQube, sebastie...@neomades.com
Hi,

Ticket created: https://jira.sonarsource.com/browse/SONAR-7083

Sincerely,

Teryk
Reply all
Reply to author
Forward
0 new messages