Please provide
- Operating system: Mac OS 14.6.1
- SonarLint plugin version: 4.9.1
- Programming language you’re coding in: typescript
- Is connected mode used: not connected
- Connected to SonarCloud or SonarQube (and which version):
And a thorough description of the problem / question:
I was consistently getting this error with this version of the Sonarlint plugin
Error - 07:27:19.845] Unable to update configuration.
java.util.concurrent.ExecutionException: java.lang.ClassCastException: class com.google.gson.internal.LinkedTreeMap cannot be cast to class java.lang.Boolean (com.google.gson.internal.LinkedTreeMap is in unnamed module of loader ‘app’; java.lang.Boolean is in module java.base of loader ‘bootstrap’)
I dropped back to version 4.8.0 and no longer see the issue
1 Like
Hey @susanmonnelly, welcome to Sonar Community and thanks for the post! 
The behavior sounds very strange and I am not able to reproduce
. Would you be able to share SonarLint logs with us when you experience the issue? You can find the instructions on how to get them here.
Thanks in advance,
Sophio 
Executing /Library/Java/JavaVirtualMachines/corretto-17.jdk/Contents/Home/bin/java -jar /Users/smonnelly/.vscode/extensions/sonarsource.sonarlint-vscode-4.9.1-darwin-x64/server/sonarlint-ls.jar -stdio -analyzers /Users/smonnelly/.vscode/extensions/sonarsource.sonarlint-vscode-4.9.1-darwin-x64/analyzers/sonargo.jar /Users/smonnelly/.vscode/extensions/sonarsource.sonarlint-vscode-4.9.1-darwin-x64/analyzers/sonarjava.jar /Users/smonnelly/.vscode/extensions/sonarsource.sonarlint-vscode-4.9.1-darwin-x64/analyzers/sonarjs.jar /Users/smonnelly/.vscode/extensions/sonarsource.sonarlint-vscode-4.9.1-darwin-x64/analyzers/sonarphp.jar /Users/smonnelly/.vscode/extensions/sonarsource.sonarlint-vscode-4.9.1-darwin-x64/analyzers/sonarpython.jar /Users/smonnelly/.vscode/extensions/sonarsource.sonarlint-vscode-4.9.1-darwin-x64/analyzers/sonarhtml.jar /Users/smonnelly/.vscode/extensions/sonarsource.sonarlint-vscode-4.9.1-darwin-x64/analyzers/sonarxml.jar /Users/smonnelly/.vscode/extensions/sonarsource.sonarlint-vscode-4.9.1-darwin-x64/analyzers/sonarcfamily.jar /Users/smonnelly/.vscode/extensions/sonarsource.sonarlint-vscode-4.9.1-darwin-x64/analyzers/sonartext.jar /Users/smonnelly/.vscode/extensions/sonarsource.sonarlint-vscode-4.9.1-darwin-x64/analyzers/sonariac.jar /Users/smonnelly/.vscode/extensions/sonarsource.sonarlint-vscode-4.9.1-darwin-x64/analyzers/sonarlintomnisharp.jar
[Info - 12:47:07.013] SonarLint backend started, instance=org.sonarsource.sonarlint.core.rpc.impl.SonarLintRpcServerImpl@54e1c68b
[Debug - 12:47:07.121] Folder WorkspaceFolder[name=wildcat-mono-repo,uri=file:///Users/smonnelly/Sites/wildcat-mono-repo] added
[Debug - 12:47:07.562] Fetching global configuration
[Error - 12:47:07.731] Unable to update configuration.
java.util.concurrent.ExecutionException: java.lang.ClassCastException: class com.google.gson.internal.LinkedTreeMap cannot be cast to class java.lang.Boolean (com.google.gson.internal.LinkedTreeMap is in unnamed module of loader 'app'; java.lang.Boolean is in module java.base of loader 'bootstrap')
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096)
at org.sonarsource.sonarlint.ls.settings.SettingsManager.lambda$didChangeConfiguration$3(SettingsManager.java:179)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.ClassCastException: class com.google.gson.internal.LinkedTreeMap cannot be cast to class java.lang.Boolean (com.google.gson.internal.LinkedTreeMap is in unnamed module of loader 'app'; java.lang.Boolean is in module java.base of loader 'bootstrap')
at org.sonarsource.sonarlint.ls.settings.SettingsManager.addVscodeExcludesToSonarLintExcludes(SettingsManager.java:298)
at org.sonarsource.sonarlint.ls.settings.SettingsManager.updateProperties(SettingsManager.java:289)
at org.sonarsource.sonarlint.ls.settings.SettingsManager.lambda$requestSonarLintAndOmnisharpConfigurationAsync$7(SettingsManager.java:267)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture.complete(CompletableFuture.java:2147)
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleResponse(RemoteEndpoint.java:212)
at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:193)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:194)
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:113)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
Interesting … Unfortunately, these logs don’t help much
Would it be possible to share even more verbose output? To get those, you will need to drop this line in your VSCode user settings (settings.json
)
"sonarlint.trace.server": "verbose",
Thanks in advance and apologies for the inconvenience,
Sophio
OK, in fact I think I see where the problem is coming from now. We are trying to get the VSCode files.excludes
setting, which is normally an object which has glob pattern as keys and boolean as values, like the following
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true
},
Most probably, this is not the case in your settings and the parsing fails
I have reported this bug to fix the behaviour in the upcoming release.
It would still be helpful to see what does your files.exclude
setting look like 
All the best,
Sophio
1 Like
Thank you Sophia ! This was a new repo and we had not added a files.exclude section in our vscode workspace settings file. I added that section and now it works.
I did have the verbose setting checked but I assume since I had no excludes, it was not appearing?
Anyway, thanks for your help and reporting the bug
1 Like