I had the same error. My fix was to add "@Component" to the top of my class declaration. In your case it would be:
@Componentpublic class Application { public static void main(String[] args) { SpringApplication springApplication=new SpringApplication(Application.class); System.out.println("Spring Core Version:- " + SpringVersion.getVersion()); springApplication.run(args); }}