java.lang.IllegalArgumentException: Sources must not be empty

11.68K viewsJava
1 Comment

java.lang.IllegalArgumentException: Sources must not be empty
at org.springframework.util.Assert.notEmpty( ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.boot.SpringApplication.prepareContext( [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.main( [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_181] at sun.reflect.NativeMethodAccessorImpl.invoke( ~[na:1.8.0_181] at sun.reflect.DelegatingMethodAccessorImpl.invoke( ~[na:1.8.0_181] at java.lang.reflect.Method.invoke( ~[na:1.8.0_181] at [spring-boot-devtools-2.0.3.RELEASE.jar:2.0.3.RELEASE]

Mounika Changed status to publish October 27, 2020

Good working fine

Add a Comment
Rajesh (anonymous) 0 Comments
  • Please set the org.springframework.boot.SpringApplication as the main class.
  • At least one main config class as a source must be added,like as below.
  • Add scanBasePackages=”com.spring” at the main class.


@ComponentScan(basePackages = "com.spring.util")
@EntityScan(basePackages = "com.spring.bean")
public class SpringBootWebApplication {

public static void main(String[] args) {, args);



Try this,your application will work.

Manohar Changed status to publish July 30, 2019
Add a Comment
You are viewing 1 out of 1 answers, click here to view all answers.
Write your answer.