Gradle - java.lang.IllegalStateException: Failed to introspect Class

Viewed 10

So I have tried to add a local .jar file dependency to my build.gradle file:

dependencies {
implementation fileTree(dir: '/Users/sdhare/workingDir/microservice_api_lib/target/', includes: ['*.jar'])
}

Then I reload the Gradle and Build the project. The build goes through successfully. In my controller, I am importing couple of classes of this library, and they are getting detected properly. Had I used any other syntax, it would show error at the build itself.

Now when I do run (which does 'bootrun'), I get the following error -

Caused by: java.lang.IllegalStateException: Failed to introspect Class [classname] from ClassLoader

Not only this one, there are more errors following it -

Caused by: java.lang.NoClassDefFoundError: io/airbrake/javabrake/Notifier
Caused by: java.lang.ClassNotFoundException: io.airbrake.javabrake.Notifier
Execution failed for task ':bootRun'.Process 'command '/Users/sdhare/Library/Java/JavaVirtualMachines/azul-17.0.4/Contents/Home/bin/java'' finished with non-zero exit value 1

An other solution I found did address this issue for a Maven Project using POM.xml. But here I am using Gradle. I think I need to add something else also either in build.gradle or project settings, but what is it?

0 Answers
Related