spotbugs / spotbugs-gradle-plugin

https://plugins.gradle.org/plugin/com.github.spotbugs
Apache License 2.0
178 stars 68 forks source link

A failure occurred while executing com.github.spotbugs.snom.internal.SpotBugsRunnerForWorker$SpotBugsExecutor #1061

Open pankajrc11 opened 9 months ago

pankajrc11 commented 9 months ago

I am getting the below error while integrating spotbug to my gradle script.

I am using java 8 , gradle 8.2.1 , and tried several version of spotbug currently using id "com.github.spotbugs" version "4.1.0"

below are the full stacktrace..

==============================================================================

hazendaz commented 9 months ago

Please you a recent version. Latest is best.

Sent from my Verizon, Samsung Galaxy smartphone Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: pankajrc11 @.> Sent: Tuesday, December 5, 2023 1:16:06 AM To: spotbugs/spotbugs-gradle-plugin @.> Cc: Subscribed @.***> Subject: [spotbugs/spotbugs-gradle-plugin] A failure occurred while executing com.github.spotbugs.snom.internal.SpotBugsRunnerForWorker$SpotBugsExecutor (Issue #1061)

I am getting the below error while integrating spotbug to my gradle script.

I am using java 8 , gradle 8.2.1 , and tried several version of spotbug currently using id "com.github.spotbugs" version "4.1.0"

below are the full stacktrace..

A failure occurred while executing com.github.spotbugs.snom.internal.SpotBugsRunnerForWorker$SpotBugsExecutor org/dom4j/DocumentException

Run with --info or --debug option to get more log output. Run with --scan to get full insights. Get more help at https://help.gradle.orghttps://help.gradle.org/.

==============================================================================

— Reply to this email directly, view it on GitHubhttps://github.com/spotbugs/spotbugs-gradle-plugin/issues/1061, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAHODI7XDZSFN6GBY4G4GB3YH232NAVCNFSM6AAAAABAHEG2GSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGAZDKMZWGM3DAMI. You are receiving this because you are subscribed to this thread.Message ID: @.***>

pankajrc11 commented 9 months ago

I am using latest version 6.0.0-beta.2 with java 8 still getting now getting below error

Task :spotbugsMain FAILED java.lang.NoClassDefFoundError: org/dom4j/DocumentException at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) at java.lang.Class.privateGetMethodRecursive(Class.java:3048) at java.lang.Class.getMethod0(Class.java:3018) at java.lang.Class.getMethod(Class.java:1784) at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526) Caused by: java.lang.ClassNotFoundException: org.dom4j.DocumentException at java.net.URLClassLoader.findClass(URLClassLoader.java:382)

hazendaz commented 9 months ago

@pankajrc11 6.0.2 is the latest, can you try that one?

KengoTODA commented 9 months ago
  1. To support Android developers, v6 now requires Java 11 or later. It is OK to run SpotBugs itself on Java8 (by jvmtoolchain), but make sure the Gradle itself is running on Java 11 or later.
  2. Make sure your project has dom4j.jar in its classpath. Generally it should be introduced by SpotBugs, but your build script may exclude them explicitly.
HoffmannTom commented 3 months ago

I have the same error, tested with spotbugs 6.0.17 The stacktrace is:

Caused by: org.gradle.api.GradleException: Verification failed: SpotBugs ended with exit code 1.
        at com.github.spotbugs.snom.internal.SpotBugsRunnerForHybrid$SpotBugsExecutor.execute(SpotBugsRunnerForHybrid.kt:125)
        at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)

I am using Java 21. Unfortunately, I can't find any further error information.