Exception in thread "main" java.lang.NoSuchMethodError:([Ljava/lang/String;)Lorg/springframework/context/ConfigurableApplicationContext

Viewed 745

My springboot application has been working and all of sudden getting following error while running application.

Exception in thread "main" java.lang.NoSuchMethodError: org.springframework.boot.SpringApplication.run(Ljava/lang/Class;[Ljava/lang/String;)Lorg/springframework/context/ConfigurableApplicationContext; at com.test.abc.MainApplication.main(MainApplication.java:30)

1 Answers

Tried multiple ways to resolve and finally got a solution. If we get this error, 200% sure that there are multiple versions of Spring-boot jars added to the project. But, you may not find it in pom.xml

One of the developers added spring-boot jar file via Buildpath to the project, which was causing the issue. Removed spring-boot jar file from the Build path then started working application.

Just thought to share it which can help someone.

Related