My spring boot application has the main class present inside a common dependency jar. Say for example startup.jar. The rest controllers are also present inside the same jar in a different package.
Main class package - com.abc.core.startup
@SpringBootApplication
@ComponentScan(basePackages = {"com.abc"})
public class ServerStartup implements ApplicationListener<ContextRefreshedEvent> {
SpringApplication.run(ServerStartup.class);
}
Rest controller package - com.abc.core.controller
@RestController
@RequestMapping("/core/")
public class EmailListenerController {
@PostMapping("register")
public String register(){
////....
}
}
With this configuration application has started successfully but the rest controllers are not invoked. It returns a 404 error whereas the same configuration worked perfectly on spring boot 2.6.7. Facing the issue after upgrading the spring boot to version 3.1.5.
Please correct me if I have done any mistakes
Comment From: scottfrederick
Thanks for the report. Unfortunately it's hard to tell exactly what's going on from the limited information you've provided. If you would like us to spend some time investigating, please provide a complete minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it and attaching it to this issue.
Comment From: wilkinsona
In the interests of avoiding duplicated effort, I'm going to close this in favor of the same question that's been asked on Stack Overflow. We can re-open if a bug in Spring Boot is identified.