I created a spring boot application(3.0.1). Then I connected the Postgres database and executed it. The application is up on server 8080 smoothly. then I added below-mentioned annotations.
@EnableAutoConfiguration @ComponentScan whole file,
package com.example.SpringRecap; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController @SpringBootApplication @EnableAutoConfiguration @ComponentScan public class SpringRecapApplication { public static void main(String[] args) { SpringApplication.run(SpringRecapApplication.class, args); } @GetMapping("/") public void Employee() { } } Now, below mentioned error are appeared,
Redundant declaration: @SpringBootApplication already applies @EnableAutoConfiguration Redundant declaration: @SpringBootApplication already applies given @ComponentScan Image of InteliJ:
If anyone knows the reason, please help me. If further information is needed to solve the problem please put a comment here. Thank You.
