I have created an replication service to publish a page and its assets using replicator...but whenever I am trying to call this service to a util class,it is returning null.Can anyone help me with why I am getting null and how to get the instance of the service? the service is in .../core/services/ReplicationService the model is in ../core/utils/ModelUtils
this is how I am calling the service:
@OSGiService
static ReplicationService replicationService;
I tried annotating with @reference also...but of no use...
this is how I created the service:
@Component(service=ReplicationService.class,immediate=true)
public class ReplicationServiceImpl implements ReplicationService{
}
utils is a simple java class...services can be injected with annotations only into components..thats why it is getting null...I have changed my approach and called it from another class which is a workflow process..it is working fine...thanks every one..hope this helps any one..