I am facing an issue with dependency injection in my Spring Boot Application. While testing Project C, I am encountering a bean not found error for com.project.ProjectA.repository
. I have included the necessary packages in @SpringBootApplication(scanBacsePackages), but the bean is still not found. Any insight on resolving this issue?
Parameter 0 of constructor in com.project.ProjectC.AILogController required a bean of type ‘com.project.ProjectA.service.TestingLogService’ that could not be found.
@SpringBootApplication(scanBasePackages = {"com.project.projectA”,
"com.project.ProjectB”,
"com.project.ProjectC”
})
public class ProjectCApplication {
public static void main(String[] args) {
SpringApplication.run(ProjectCApplication, args);
}
}
I’m expecting to merge three spring boot projects together.
I’ve created jar files for com.project.ProjectA
and com.project.ProjectB
and added it to com.project.ProjectC
.
I am able to build the project with out any errors by running the command mvn clean install
. However, I’m facing errors when I attempt to run the command mvn spring-boot:run
.
user24845522 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.