SonarLint does not work in IntelliJ 2019.1 EAP + JBR11

sonarlint
intellij

(Dmitry Cherkas) #1

SonarLint IntelliJ plugin fails to load on fresh IntelliJ 2019.1 EAP + JBR11 build.

Steps to reproduce:

  1. Install latest " INTELLIJ IDEA + JETBRAINS RUNTIME 11" EAP build from https://www.jetbrains.com/idea/nextversion/ (I used IntelliJ IDEA Ultimate, but probably would also reproduce on Community)
  2. Start intelliJ IDEA, install SonarLint plugin and check the idea.log:
2019-02-11 15:08:45,631 [  71699]  ERROR - llij.ide.plugins.PluginManager - com.intellij.ide.plugins.PluginManager$StartupAbortedException: Fatal error initializing plugin org.sonarlint.idea 
java.lang.RuntimeException: com.intellij.ide.plugins.PluginManager$StartupAbortedException: Fatal error initializing plugin org.sonarlint.idea
	at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:215)
	at com.intellij.idea.IdeaApplication.lambda$initApplication$0(IdeaApplication.java:74)
	at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
	at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:776)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727)
	at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:746)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:322)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Caused by: com.intellij.ide.plugins.PluginManager$StartupAbortedException: Fatal error initializing plugin org.sonarlint.idea
	at com.intellij.ide.plugins.PluginManager.handleComponentError(PluginManager.java:253)
	at com.intellij.openapi.components.impl.PlatformComponentManagerImpl.handleInitComponentError(PlatformComponentManagerImpl.java:43)
	at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:504)
	at com.intellij.openapi.components.impl.ComponentManagerImpl.createComponents(ComponentManagerImpl.java:104)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$createComponents$9(ApplicationImpl.java:449)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:586)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:86)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
	at com.intellij.openapi.application.impl.ApplicationImpl.createComponents(ApplicationImpl.java:473)
	at com.intellij.openapi.components.impl.ComponentManagerImpl.init(ComponentManagerImpl.java:88)
	at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:407)
	at com.intellij.openapi.application.impl.ApplicationImpl.load(ApplicationImpl.java:393)
	at com.intellij.idea.IdeaApplication.run(IdeaApplication.java:208)
	... 15 more
Caused by: com.intellij.diagnostic.PluginException:  [Plugin: org.sonarlint.idea]
	... 30 more
Caused by: java.lang.ExceptionInInitializerError
	at org.sonarsource.sonarlint.shaded.com.google.gson.internal.reflect.ReflectionAccessor.<clinit>(ReflectionAccessor.java:36)
	at org.sonarsource.sonarlint.shaded.com.google.gson.internal.ConstructorConstructor.<init>(ConstructorConstructor.java:51)
	at org.sonarsource.sonarlint.shaded.com.google.gson.Gson.<init>(Gson.java:205)
	at org.sonarsource.sonarlint.shaded.com.google.gson.GsonBuilder.create(GsonBuilder.java:597)
	at org.sonarsource.sonarlint.core.telemetry.TelemetryStorage.createGson(TelemetryStorage.java:67)
	at org.sonarsource.sonarlint.core.telemetry.TelemetryStorage.load(TelemetryStorage.java:71)
	at org.sonarsource.sonarlint.core.telemetry.TelemetryStorage.tryLoad(TelemetryStorage.java:83)
	at org.sonarsource.sonarlint.core.telemetry.TelemetryManager.<init>(TelemetryManager.java:48)
	at org.sonarlint.intellij.telemetry.TelemetryManagerProvider.get(TelemetryManagerProvider.java:57)
	at org.sonarlint.intellij.telemetry.SonarLintTelemetryImpl.<init>(SonarLintTelemetryImpl.java:48)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at org.picocontainer.defaults.InstantiatingComponentAdapter.newInstance(InstantiatingComponentAdapter.java:193)
	at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.doGetComponentInstance(CachingConstructorInjectionComponentAdapter.java:92)
	at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.instantiateGuarded(CachingConstructorInjectionComponentAdapter.java:66)
	at com.intellij.util.pico.CachingConstructorInjectionComponentAdapter.getComponentInstance(CachingConstructorInjectionComponentAdapter.java:48)
	at com.intellij.openapi.components.impl.ComponentManagerImpl$ComponentConfigComponentAdapter.getComponentInstance(ComponentManagerImpl.java:462)
	... 27 more
Caused by: java.lang.NumberFormatException: For input string: "11-ea"
	at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.base/java.lang.Integer.parseInt(Integer.java:652)
	at java.base/java.lang.Integer.parseInt(Integer.java:770)
	at org.sonarsource.sonarlint.shaded.com.google.gson.util.VersionUtils.determineMajorJavaVersion(VersionUtils.java:28)
	at org.sonarsource.sonarlint.shaded.com.google.gson.util.VersionUtils.<clinit>(VersionUtils.java:24)
	... 46 more
2019-02-11 15:08:45,636 [  71704]  ERROR - llij.ide.plugins.PluginManager - IntelliJ IDEA 2019.1 Snapshot  Build #IU-191.5109.14 
2019-02-11 15:08:45,636 [  71704]  ERROR - llij.ide.plugins.PluginManager - JDK: 11-ea; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o 
2019-02-11 15:08:45,636 [  71704]  ERROR - llij.ide.plugins.PluginManager - OS: Windows 10 
2019-02-11 15:08:45,643 [  71711]  ERROR - llij.ide.plugins.PluginManager - Plugin to blame: SonarLint version: 4.0.2.3009 

The root cause is JDK version is not parsable (“11-ea”).

PS. Sorry, I failed to figure how to file a ticket to https://jira.sonarsource.com/browse/SLCORE


(Julien Henry) #2

Hi,

I created a ticket and merged your PR, thanks!
https://jira.sonarsource.com/browse/SLCORE-227