SonarLint (Eclipse) - Null Pointer Exception - Unable to open Rule Description Web View

705 views
Skip to first unread message

markus.m...@gmx.at

unread,
Feb 12, 2018, 5:55:22 AM2/12/18
to SonarLint
Hi,

Im using Eclipse Oxygen.2 (4.7.2, 20171218-0600, x64) and JDK 1.8.0_131 (x64) with SonarLint for Eclipse 3.3.1.201712071600.

SonarLint Analysis is successful and issues are listed in "SonarLint Issues" view.
But when I right-click on Issue and open "Rule Description" I got the below NullPointerException with error message "Unable to open Rule Description Web View":

Unable to open Rule Description Web View
java
.lang.NullPointerException
 at org
.sonarlint.eclipse.ui.internal.SonarLintImages.getTypeImage(SonarLintImages.java:101)
 at org
.sonarlint.eclipse.ui.internal.views.RuleDescriptionWebView.open(RuleDescriptionWebView.java:105)
 at org
.sonarlint.eclipse.ui.internal.views.RuleDescriptionWebView.open(RuleDescriptionWebView.java:1)
 at org
.sonarlint.eclipse.ui.internal.views.AbstractLinkedSonarWebView.setInput(AbstractLinkedSonarWebView.java:198)
 at org
.sonarlint.eclipse.ui.internal.command.ShowRuleDescriptionCommand.execute(ShowRuleDescriptionCommand.java:33)
 at org
.sonarlint.eclipse.ui.internal.command.AbstractIssueCommand.execute(AbstractIssueCommand.java:63)
 at org
.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:291)
 at org
.eclipse.ui.internal.handlers.E4HandlerProxy.execute(E4HandlerProxy.java:92)
 at sun
.reflect.GeneratedMethodAccessor161.invoke(Unknown Source)
 at sun
.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java
.lang.reflect.Method.invoke(Method.java:498)
 at org
.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:55)
 at org
.eclipse.e4.core.internal.di.InjectorImpl.invokeUsingClass(InjectorImpl.java:305)
 at org
.eclipse.e4.core.internal.di.InjectorImpl.invoke(InjectorImpl.java:239)
 at org
.eclipse.e4.core.contexts.ContextInjectionFactory.invoke(ContextInjectionFactory.java:132)
 at org
.eclipse.e4.core.commands.internal.HandlerServiceHandler.execute(HandlerServiceHandler.java:152)
 at org
.eclipse.core.commands.Command.executeWithChecks(Command.java:494)
 at org
.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:487)
 at org
.eclipse.e4.core.commands.internal.HandlerServiceImpl.executeHandler(HandlerServiceImpl.java:210)
 at org
.eclipse.e4.ui.workbench.renderers.swt.HandledContributionItem.executeItem(HandledContributionItem.java:431)
 at org
.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.handleWidgetSelection(AbstractContributionItem.java:446)
 at org
.eclipse.e4.ui.workbench.renderers.swt.AbstractContributionItem.lambda$2(AbstractContributionItem.java:472)
 at org
.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:86)
 at org
.eclipse.swt.widgets.Display.sendEvent(Display.java:4428)
 at org
.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1079)
 at org
.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4238)
 at org
.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3817)
 at org
.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$5.run(PartRenderingEngine.java:1150)
 at org
.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
 at org
.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1039)
 at org
.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:153)
 at org
.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:680)
 at org
.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
 at org
.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
 at org
.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
 at org
.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
 at org
.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
 at org
.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
 at org
.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
 at org
.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
 at org
.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
 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:498)
 at org
.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
 at org
.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
 at org
.eclipse.equinox.launcher.Main.run(Main.java:1499)

This is very similar to the issue described in SonarLint - Null Pointer Exception - Unable to open Rule Description Web View, but the comments on the github-issue linked in that other thread indicate that that bug only occured in development of SonarLint 3.0 and never went public. Well here I have it. 

Julien HENRY

unread,
Feb 12, 2018, 6:38:05 AM2/12/18
to Markus Mitterauer, SonarLint
Hi Markus,

Can you precise:
1) The key of the rule you are opening description for (you can add column "Rule key" in the SonarLint On-the-fly view)
2 If you are in connected mode, and if yes, what is your server version

++

Julien Henry | SonarSource

Developer

https://sonarsource.com


--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarlint/4c21ee98-9fec-4f49-93f4-ed27ac1b0e68%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

markus.m...@gmx.at

unread,
Feb 12, 2018, 7:55:34 AM2/12/18
to SonarLint
Hi Julien,

1) The issue I'm currently experiencing the problem with is squid:S3725 ("Replace this with a call to the "toFile().exists()" method").
2) Yes, I'm in connected mode, and the server version is 6.1. 

Regards, Markus

Julien HENRY

unread,
Feb 12, 2018, 8:42:10 AM2/12/18
to Markus Mitterauer, SonarLint
Can you open in a web browser:
<your QS server>/api/rules/search?f=repo,name,severity,lang,htmlDesc,htmlNote,internalKey,isTemplate,templateKey,actives&statuses=BETA,DEPRECATED,READY&q=squid:S3725

and check that the issue type is there in the response. Example:

Images intégrées 1

Julien Henry | SonarSource

Developer

https://sonarsource.com


--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.

markus.m...@gmx.at

unread,
Feb 12, 2018, 8:49:11 AM2/12/18
to SonarLint
Hi Julien,
yes, the type is there:


Julien HENRY

unread,
Feb 12, 2018, 8:52:25 AM2/12/18
to Markus Mitterauer, SonarLint
Can you try to open the SonarQube server view, then right click on your server and do "Update all project bindings". It should fix your issue.

Julien Henry | SonarSource

Developer

https://sonarsource.com


--
You received this message because you are subscribed to the Google Groups "SonarLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarlint+unsubscribe@googlegroups.com.

markus.m...@gmx.at

unread,
Feb 12, 2018, 9:14:37 AM2/12/18
to SonarLint
Yup. That did the trick.

Thanks a lot, Julien.

Actually, my Eclipse had "lost" the access token for my SonarQube server, so authentication against the server failed and I had to generate a new token before I could update the project bindings.
It would be helpful, if SonarLint would throw a corresponding exception instead of an NPE. 
However, it could be that SonarLint had tried to inform me about that authentication problem before, but as this SonarLint-had-a-problem window pops-up quite often, due to some flaky access-problems to its .metadata, I usually dismiss this pop-up without further attention. My bad.

All the Best,
Markus
Reply all
Reply to author
Forward
0 new messages