In my case, the error occurred because the dependent services (Config Server, Eureka Server, and Gateway Server) were not running before the Cards Service. The Cards Service relies on the Config Server for fetching configurations and on the Eureka Server for service discovery. Starting these services sequentially resolved the issue, and no changes were needed in the pom.xml or application.yml.