we have a servlet which calls our service, which calls another service, which calls the original service. This compiles, but when we deploy locally, we get 404 for the servlet page. If we comment out the service, the servlet gets called. Does this mean we cannot have services calling each other? Not sure how to structure the code without this.
GetSomething.java
@Slf4j
@Component(service = { Servlet.class })
@SlingServletPaths(value="/bin/myservlet")
public class GetSomething {
@Reference
private AService aService;
AService.java
@component(service = AService.class)
public class AServiceImpl implements AService {
@Reference
private BService bService;
BService.java
@component(service = BService.class)
public class BServiceImpl implements BService {
@Reference
private AService aService;
The above code wont work, even if no methods are called in any of the services - the servlet doesnt exist after deployment. If we comment out the reference to AService in BService, then the servlet exists on the server.
Any suggestions?