Calling OSGI service from sightly in maven project
This is my sightly code :
<sly data-sly-use.search="amitsample.core.Services.Develope">
${search.details}
</p>
this is my bundle which I uploaded in felix console :

This is my path where i set my maven project:

Develope.java
================
And these are my code:
package amitsample.core.filters;
import com.adobe.cq.sightly.WCMUse;
import amitsample.core.filters.HelloService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Develope extends WCMUse {
Logger logger = LoggerFactory.getLogger(Develope.class);
protected String detail;
@Override
public void activate() throws Exception {
/*HelloService serv= getSlingScriptHelper().getService(HelloService.class);
detail=serv.getRepositoryName();
logger.info("this is the first log values");*/
logger.info("this is the first log values");
}
public String getDetails() {
return "Amitgggg";
}
}
HelloService.java
=============
package amitsample.core.filters;
/**
* A simple service interface
*/
public interface HelloService {
/**
* @return the name of the underlying JCR repository implementation
*/
public String getRepositoryName();
}
HelloServiceImpl.java
===================
package amitsample.core.filters;
import javax.jcr.Repository;
import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.apache.sling.jcr.api.SlingRepository;
@Service
@Component(metatype = false)
public class HelloServiceImpl implements HelloService {
@Reference
private SlingRepository repository;
public String getRepositoryName() {
return repository.getDescriptor(Repository.REP_NAME_DESC);
}
}
Now I am setting logs to see whether it is working or not but I am not getting anything in my logs and in which page I am dragging and dropping the component that uses develop.java (WCMuse class) file thru sightly, There also no value I am expecting return "Amitgggg"; this in my page but not getting any idea what is the problem .

