Superclass has no null constructors but no arguments were given Superclass has no null constructors but no arguments were given spring spring

Superclass has no null constructors but no arguments were given


CGlib has one important restriction: the target class must provide a default constructor.

If you use property-based injection instead of constructor-based injection, the problem will go away.


I just created an empty default constructor to deal with this.


If you are using Lombok in your code, then you can just add the following annotation to get rid of this error:

@NoArgsConstructorpublic class SearchController {