Elasticsearch-java issue with sling model initiation AEM 6.5.16
I am trying to use elasticsearch-java rest api client within AEM servlet. As recommended on Elasticsearch site, I added maven dependencies. I can invoke sevlet properly. Adding elasticsearch-java dependency causes issue with my Sling model. We have sling models but it does not Inject resouce when elasticsearch-java is included in my pom.xml. Here is sample code for model
@Model( adaptables = Resource.class)
public class MyModelClass{
@586265
private Resource componentResource;
private String facetList;
@PostConstruct
protected void init() {
if(componentResource != null) {
// business logic
} else {
LOGGER.error("Component node not found.");
}
}
I am not sure if issue is due to some maven dependency configuration or is incompatibility issue.
AEM Version - 6.5.16
Elasticsearch-java - 8.11.3