I am trying to establish connection between 3 modules in my project. When I try to reach my object with @Autowired error shows up. I'll explain my scenario a little bit.
All of these modules have been connected inside of pom.xml. Lets talk about my problem.
.
.
.
@Autowired
public CommuniticationRepository;
@Autowired
public Core core;
.
.
.
public class Core {
private int id;
private String name;
private Date date;
public Core(int id, String name, Date date) {
this.id = id;
this.name = name;
this.date = date;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Date getDate() {
return date;
}
public void setDate(Date date) {
this.date = date;
}
}
Field communicationRepositoryin com.demo.xyz.A.RestControllers.Route required a bean of type 'com.demo.xyz.A.CommunicationRepository' that could not be found.
Action:
Consider defining a bean of type 'com.demo.xyz.A.CommunicationRepository' in your configuration.
@Component
@Repository
public interface CommunicationRepository extends CrudRepository<Communication, Date> {
List<Communication> findByDate(Date date);
void countByDate(Date date);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With