I get error when I run the main class.
Error:
Action:
Consider defining a bean of type \'seconds47.service.TopicService\' in your c
I fixed the problem adding this line @ComponentScan(basePackages = {"com.example.DemoApplication"})
to main class file, just up from the class name
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@ComponentScan(basePackages = {"com.example.DemoApplication"})
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
}