java.lang.IllegalArgumentException: Sources must not be empty

11.64K viewsJava
0
1 Comment

java.lang.IllegalArgumentException: Sources must not be empty
at org.springframework.util.Assert.notEmpty(Assert.java:450) ~[spring-core-5.0.7.RELEASE.jar:5.0.7.RELEASE] at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:389) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:325) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1255) [spring-boot-2.0.3.RELEASE.jar:2.0.3.RELEASE] at org.springframework.boot.SpringApplication.main(SpringApplication.java:1271) [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(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_181] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_181] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_181] at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) [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
2
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.

 

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

public static void main(String[] args) {
SpringApplication.run(SpringBootWebApplication.class, 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.