'Null Pointer when trying to access an interface from an external jar

I have included an external jar in my springboot project running on gradle and I'm trying to call a method from an interface from that jar. I tried to autowire it and it just throws BeanInstantiationException and I just can't create an object because it is an interface and won't let me. I tried to create a bean with the below code and still throws a Bean instantiation exception. I tried to use the class that is implementing this interface inside the jar and it still throws a bean instantiation exception. I tried to the component scan in my main class to scan this package of the jar but that will not let me run the service in postman, it throws a 404. Not sure what else I could try.

 @Bean   public HandlerImplementation  HandlerImplementationService(){      
          return new HandlerImplementation();
 }


Solution 1:[1]

Please make sure you added the external jar as a dependency in your Gradle.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Revanth Kovuri