执行扫描时声纳错误(java.lang.ExceptionInInitializerErrorjava.lang.ExceptionInInitializerError)
sonarqube error while execute scan(java.lang.ExceptionInInitializerErrorjava.lang.ExceptionInInitializerError)
当我尝试使用 sonarqube 扫描我的代码时,出现以下错误:
myMac% sonar-scanner
INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/4.3.0.2102/libexec/conf/sonar-scanner.properties
INFO: Project root configuration file: /Users/jack/Desktop/XX/Projects/XXXX/Project/sonar-project.properties
INFO: SonarScanner 4.3.0.2102
INFO: Java 13-ea Oracle Corporation (64-bit)
INFO: Mac OS X 10.13.6 x86_64
INFO: User cache: /Users/jack/.sonar/cache
INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/4.3.0.2102/libexec/conf/sonar-scanner.properties
INFO: Project root configuration file: ...path/project/sonar-project.properties
INFO: Analyzing on SonarQube server 7.9.4
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=87ms
INFO: Server id: BF41A1F2-AXRr6UD6H1saInOfj60W
INFO: User cache: /Users/jzhu321/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load/download plugins (done) | time=70ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1.609s
INFO: Final Memory: 4M/27M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.ExceptionInInitializerError
at com.google.gson.internal.reflect.ReflectionAccessor.<clinit>(ReflectionAccessor.java:36)
at com.google.gson.internal.ConstructorConstructor.<init>(ConstructorConstructor.java:51)
at com.google.gson.Gson.<init>(Gson.java:205)
at com.google.gson.Gson.<init>(Gson.java:185)
at org.sonar.scanner.bootstrap.ScannerPluginInstaller.listInstalledPlugins(ScannerPluginInstaller.java:104)
at org.sonar.scanner.bootstrap.ScannerPluginInstaller.loadPlugins(ScannerPluginInstaller.java:76)
at org.sonar.scanner.bootstrap.ScannerPluginInstaller.installRemotes(ScannerPluginInstaller.java:60)
at org.sonar.scanner.bootstrap.ScannerPluginRepository.start(ScannerPluginRepository.java:59)
at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.start(StartableCloseableSafeLifecyleStrategy.java:40)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
at org.picocontainer.behaviors.Stored.start(Stored.java:110)
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.NumberFormatException: For input string: "13-ea"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68)
at java.base/java.lang.Integer.parseInt(Integer.java:658)
at java.base/java.lang.Integer.parseInt(Integer.java:776)
at com.google.gson.util.VersionUtils.determineMajorJavaVersion(VersionUtils.java:28)
at com.google.gson.util.VersionUtils.<clinit>(VersionUtils.java:24)
... 32 more
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
我想也许我的 JDK 版本错了?这些错误没有显示任何提示或告诉如何解决它,我不知道现在该怎么做。有人可以帮忙吗?
更新:
我将 SonarScanner 升级到最新版本,我在这里遇到了一些新错误:
INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/4.3.0.2102/libexec/conf/sonar-scanner.properties
INFO: Project root configuration file: /Users/jzhu321/Desktop/PwC/Projects/Risk_Command/RC_UI_NEW/Digital_RC/RC_UI/sonar-project.properties
INFO: SonarScanner 4.4.0.2170
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Mac OS X 10.13.6 x86_64
INFO: User cache: /Users/jzhu321/.sonar/cache
INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/4.3.0.2102/libexec/conf/sonar-scanner.properties
INFO: Project root configuration file: /Users/jzhu321/Desktop/PwC/Projects/Risk_Command/RC_UI_NEW/Digital_RC/RC_UI/sonar-project.properties
INFO: Analyzing on SonarQube server 7.9.4
INFO: Default locale: "en_US", source code encoding: "en_US"
INFO: Load global settings
INFO: Load global settings (done) | time=109ms
INFO: Server id: BF41A1F2-AXRsELIlICCBnUbeLAM-
INFO: User cache: /Users/jzhu321/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=89ms
INFO: Load/download plugins (done) | time=251ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=3ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 2.829s
INFO: Final Memory: 5M/24M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.ProjectLock
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
at org.sonar.core.platform.ComponentContainer.getComponentByType(ComponentContainer.java:281)
at org.sonar.scanner.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:153)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:134)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.api.batch.fs.internal.DefaultInputProject
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
at org.picocontainer.parameters.BasicComponentParameter.resolveInstance(BasicComponentParameter.java:118)
at org.picocontainer.parameters.ComponentParameter.resolveInstance(ComponentParameter.java:136)
at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
at org.picocontainer.injectors.ConstructorInjector.run(ConstructorInjector.java:335)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
... 22 more
Caused by: java.nio.charset.UnsupportedCharsetException: en_US
at java.base/java.nio.charset.Charset.forName(Unknown Source)
at org.sonar.api.batch.fs.internal.AbstractProjectOrModule.initEncoding(AbstractProjectOrModule.java:76)
at org.sonar.api.batch.fs.internal.AbstractProjectOrModule.<init>(AbstractProjectOrModule.java:69)
at org.sonar.api.batch.fs.internal.DefaultInputProject.<init>(DefaultInputProject.java:37)
at org.sonar.scanner.scan.InputProjectProvider.provide(InputProjectProvider.java:47)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129)
at org.picocontainer.injectors.MethodInjector.access[=12=]0(MethodInjector.java:39)
at org.picocontainer.injectors.MethodInjector.run(MethodInjector.java:113)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
... 36 more
更新2:
以上错误是由于路径名的改变
sonar.sources=.
到
sonar.sources=./
将解决问题。
Gson(作为 Sonar 的一部分)试图将字符串 13-ea
解析为 int
,同时试图找出 java 版本。根据 this 线程,2013 年 3 月不支持此功能。
根据 ,该问题已在 gson 版本 2.8.5 中修复。
This SonarLint pull request 通过更新 Gson 解决了 SonarLint 方面的问题。 2019年4月合并
如果你查看SonarLint Release page,你可以清楚地看到合并后的下一个版本是4.3.0.2475
,而你使用SonarScanner 4.3.0.2102
。
只要将 Sonar 扫描仪更新到最新版本就可以了。
您可以从 here
下载适用于 MacOS 的最新版本 sonar-scanner
另一种选择是使用另一个 non-early-access java 版本。
当我尝试使用 sonarqube 扫描我的代码时,出现以下错误:
myMac% sonar-scanner
INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/4.3.0.2102/libexec/conf/sonar-scanner.properties
INFO: Project root configuration file: /Users/jack/Desktop/XX/Projects/XXXX/Project/sonar-project.properties
INFO: SonarScanner 4.3.0.2102
INFO: Java 13-ea Oracle Corporation (64-bit)
INFO: Mac OS X 10.13.6 x86_64
INFO: User cache: /Users/jack/.sonar/cache
INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/4.3.0.2102/libexec/conf/sonar-scanner.properties
INFO: Project root configuration file: ...path/project/sonar-project.properties
INFO: Analyzing on SonarQube server 7.9.4
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=87ms
INFO: Server id: BF41A1F2-AXRr6UD6H1saInOfj60W
INFO: User cache: /Users/jzhu321/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load/download plugins (done) | time=70ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1.609s
INFO: Final Memory: 4M/27M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.ExceptionInInitializerError
at com.google.gson.internal.reflect.ReflectionAccessor.<clinit>(ReflectionAccessor.java:36)
at com.google.gson.internal.ConstructorConstructor.<init>(ConstructorConstructor.java:51)
at com.google.gson.Gson.<init>(Gson.java:205)
at com.google.gson.Gson.<init>(Gson.java:185)
at org.sonar.scanner.bootstrap.ScannerPluginInstaller.listInstalledPlugins(ScannerPluginInstaller.java:104)
at org.sonar.scanner.bootstrap.ScannerPluginInstaller.loadPlugins(ScannerPluginInstaller.java:76)
at org.sonar.scanner.bootstrap.ScannerPluginInstaller.installRemotes(ScannerPluginInstaller.java:60)
at org.sonar.scanner.bootstrap.ScannerPluginRepository.start(ScannerPluginRepository.java:59)
at org.sonar.core.platform.StartableCloseableSafeLifecyleStrategy.start(StartableCloseableSafeLifecyleStrategy.java:40)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.start(AbstractInjectionFactory.java:84)
at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:169)
at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:132)
at org.picocontainer.behaviors.Stored.start(Stored.java:110)
at org.picocontainer.DefaultPicoContainer.potentiallyStartAdapter(DefaultPicoContainer.java:1016)
at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1009)
at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:767)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:135)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:567)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.NumberFormatException: For input string: "13-ea"
at java.base/java.lang.NumberFormatException.forInputString(NumberFormatException.java:68)
at java.base/java.lang.Integer.parseInt(Integer.java:658)
at java.base/java.lang.Integer.parseInt(Integer.java:776)
at com.google.gson.util.VersionUtils.determineMajorJavaVersion(VersionUtils.java:28)
at com.google.gson.util.VersionUtils.<clinit>(VersionUtils.java:24)
... 32 more
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.
我想也许我的 JDK 版本错了?这些错误没有显示任何提示或告诉如何解决它,我不知道现在该怎么做。有人可以帮忙吗?
更新: 我将 SonarScanner 升级到最新版本,我在这里遇到了一些新错误:
INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/4.3.0.2102/libexec/conf/sonar-scanner.properties
INFO: Project root configuration file: /Users/jzhu321/Desktop/PwC/Projects/Risk_Command/RC_UI_NEW/Digital_RC/RC_UI/sonar-project.properties
INFO: SonarScanner 4.4.0.2170
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Mac OS X 10.13.6 x86_64
INFO: User cache: /Users/jzhu321/.sonar/cache
INFO: Scanner configuration file: /usr/local/Cellar/sonar-scanner/4.3.0.2102/libexec/conf/sonar-scanner.properties
INFO: Project root configuration file: /Users/jzhu321/Desktop/PwC/Projects/Risk_Command/RC_UI_NEW/Digital_RC/RC_UI/sonar-project.properties
INFO: Analyzing on SonarQube server 7.9.4
INFO: Default locale: "en_US", source code encoding: "en_US"
INFO: Load global settings
INFO: Load global settings (done) | time=109ms
INFO: Server id: BF41A1F2-AXRsELIlICCBnUbeLAM-
INFO: User cache: /Users/jzhu321/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=89ms
INFO: Load/download plugins (done) | time=251ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=3ms
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 2.829s
INFO: Final Memory: 5M/24M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: Unable to load component class org.sonar.scanner.scan.ProjectLock
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:678)
at org.sonar.core.platform.ComponentContainer.getComponentByType(ComponentContainer.java:281)
at org.sonar.scanner.scan.ProjectScanContainer.doBeforeStart(ProjectScanContainer.java:153)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:134)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.scanner.bootstrap.GlobalContainer.doAfterStart(GlobalContainer.java:141)
at org.sonar.core.platform.ComponentContainer.startComponents(ComponentContainer.java:136)
at org.sonar.core.platform.ComponentContainer.execute(ComponentContainer.java:122)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:73)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:67)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
Caused by: java.lang.IllegalStateException: Unable to load component class org.sonar.api.batch.fs.internal.DefaultInputProject
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:65)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:632)
at org.picocontainer.parameters.BasicComponentParameter.resolveInstance(BasicComponentParameter.java:118)
at org.picocontainer.parameters.ComponentParameter.resolveInstance(ComponentParameter.java:136)
at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
at org.picocontainer.injectors.ConstructorInjector.run(ConstructorInjector.java:335)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
... 22 more
Caused by: java.nio.charset.UnsupportedCharsetException: en_US
at java.base/java.nio.charset.Charset.forName(Unknown Source)
at org.sonar.api.batch.fs.internal.AbstractProjectOrModule.initEncoding(AbstractProjectOrModule.java:76)
at org.sonar.api.batch.fs.internal.AbstractProjectOrModule.<init>(AbstractProjectOrModule.java:69)
at org.sonar.api.batch.fs.internal.DefaultInputProject.<init>(DefaultInputProject.java:37)
at org.sonar.scanner.scan.InputProjectProvider.provide(InputProjectProvider.java:47)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.picocontainer.injectors.MethodInjector.invokeMethod(MethodInjector.java:129)
at org.picocontainer.injectors.MethodInjector.access[=12=]0(MethodInjector.java:39)
at org.picocontainer.injectors.MethodInjector.run(MethodInjector.java:113)
at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:699)
at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:647)
at org.sonar.core.platform.ComponentContainer$ExtendedDefaultPicoContainer.getComponent(ComponentContainer.java:63)
... 36 more
更新2:
以上错误是由于路径名的改变
sonar.sources=.
到
sonar.sources=./
将解决问题。
Gson(作为 Sonar 的一部分)试图将字符串 13-ea
解析为 int
,同时试图找出 java 版本。根据 this 线程,2013 年 3 月不支持此功能。
根据
This SonarLint pull request 通过更新 Gson 解决了 SonarLint 方面的问题。 2019年4月合并
如果你查看SonarLint Release page,你可以清楚地看到合并后的下一个版本是4.3.0.2475
,而你使用SonarScanner 4.3.0.2102
。
只要将 Sonar 扫描仪更新到最新版本就可以了。
您可以从 here
下载适用于 MacOS 的最新版本sonar-scanner
另一种选择是使用另一个 non-early-access java 版本。