JetBrains / spotbugs-intellij-plugin

The SpotBugs Plugin for IntelliJ IDEA
GNU Lesser General Public License v2.1
72 stars 34 forks source link

Spotbugs 1.2.7 Unable to find slf4j logger #1594

Open slice-arjunh opened 11 months ago

slice-arjunh commented 11 months ago

Error: java.lang.LinkageError: loader constraint violation: when resolving method 'org.slf4j.ILoggerFactory org.slf4j.impl.StaticLoggerBinder.getLoggerFactory()' the class loader com.intellij.ide.plugins.cl.PluginClassLoader @55634173 of the current class, org/slf4j/LoggerFactory, and the class loader com.intellij.util.lang.PathClassLoader @5f150435 for the method's defining class, org/slf4j/impl/StaticLoggerBinder, have different Class objects for the type org/slf4j/ILoggerFactory used in the signature (org.slf4j.LoggerFactory is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader @55634173, parent loader 'bootstrap'; org.slf4j.impl.StaticLoggerBinder is in unnamed module of loader com.intellij.util.lang.PathClassLoader @5f150435) at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:418) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383) at edu.umd.cs.findbugs.Project.(Project.java:94) at org.jetbrains.plugins.spotbugs.core.FindBugsProjects.lambda$get$0(FindBugsProjects.java:129) at org.jetbrains.plugins.spotbugs.common.util.WithPluginClassloader.notNull(WithPluginClassloader.java:58) at org.jetbrains.plugins.spotbugs.core.FindBugsProjects.get(FindBugsProjects.java:129) at org.jetbrains.plugins.spotbugs.actions.AnalyzeProjectFiles$1.configure(AnalyzeProjectFiles.java:116) at org.jetbrains.plugins.spotbugs.core.FindBugsStarter.lambda$asyncStartImpl$3(FindBugsStarter.java:201) at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:909) at org.jetbrains.plugins.spotbugs.core.FindBugsStarter.asyncStartImpl(FindBugsStarter.java:200) at org.jetbrains.plugins.spotbugs.core.FindBugsStarter.asyncStart(FindBugsStarter.java:190) at org.jetbrains.plugins.spotbugs.core.FindBugsStarter$2.run(FindBugsStarter.java:174) at com.intellij.openapi.progress.impl.CoreProgressManager.startTask(CoreProgressManager.java:428) at com.intellij.openapi.progress.impl.ProgressManagerImpl.startTask(ProgressManagerImpl.java:115) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcessWithProgressAsynchronously$6(CoreProgressManager.java:478) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$4(ProgressRunner.java:251) at com.intellij.openapi.progress.ProgressManager.lambda$runProcess$0(ProgressManager.java:71) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173) at com.intellij.openapi.progress.ProgressManager.runProcess(ProgressManager.java:71) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$submit$5(ProgressRunner.java:251) at com.intellij.openapi.progress.impl.ProgressRunner.lambda$launchTask$18(ProgressRunner.java:465) 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.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699) at java.base/java.lang.Thread.run(Thread.java:840)

Spotbugs version: 1.2.7 IntelliJ version : IntelliJ IDEA 2023.2.5 (Ultimate Edition)

amaembo commented 10 months ago

Should be better with IntelliJ IDEA 2023.3

scottcc commented 9 months ago

Still occurs in 2023.3.2...

mwesnigk commented 8 months ago

Workaround: C:\Users\USERNAME\AppData\Roaming\JetBrains\IntelliJIdea2023.2\plugins\spotbugs-idea\lib delete: slf4j-api-1.7.25.jar

Sorry, I do not know the file paths for linux / mac. if anyone is developing under these systems -> please help us out here :)

pkxiuluo commented 8 months ago

Workaround: C:\Users\USERNAME\AppData\Roaming\JetBrains\IntelliJIdea2023.2\plugins\spotbugs-idea\lib delete: slf4j-api-1.7.25.jar

Sorry, I do not know the file paths for linux / mac. if anyone is developing under these systems -> please help us out here :)

thanks , @mwesnigk solution works for me . ^_^

mac plugins dir is '/Users/XXX/Library/Application Support/JetBrains/IdeaIC2023.1/plugins/spotbugs-idea/lib'

Solution for mac (replace XXX as you user name):

cd /Users/XXX/Library/Application Support/JetBrains/IdeaIC2023.1/plugins/spotbugs-idea/lib
mv slf4j-api-1.7.25.jar slf4j-api-1.7.25.jar.bat
sy173 commented 8 months ago

Workaround: C:\Users\USERNAME\AppData\Roaming\JetBrains\IntelliJIdea2023.2\plugins\spotbugs-idea\lib delete: slf4j-api-1.7.25.jar

Sorry, I do not know the file paths for linux / mac. if anyone is developing under these systems -> please help us out here :)

that's useful!

KinMan-ZHR commented 5 months ago

Workaround: C:\Users\USERNAME\AppData\Roaming\JetBrains\IntelliJIdea2023.2\plugins\spotbugs-idea\lib delete: slf4j-api-1.7.25.jar

Sorry, I do not know the file paths for linux / mac. if anyone is developing under these systems -> please help us out here :)

really good! it works a lot