6.4 tagmanagerobject.resolve(tagid) returning null




tagmanagerobject.resolve(tagid) return ing null everytime.... I m using 6.4.1


Code is written inside active method and in class we are using wcmusepojo by extending it..... 


We got tag manager as getresourceresolver. Adapto(TagMAnager) 

Other points which I strict verified 


I m running my code in local...as admin...admin has all the access.......Where all tags are present.... 


Tagamanger obejvt is not null.... 


Tag I'd format is proper... Namesapce:fruits/apple kind...... 

Accepted Solutions (1)

Accepted Solutions (1)




As you know, tags are stored in the /etc paths in your JCR. When you logged out of  publisher as an admin, the resolver would NOT be able to access the tags object in /etc. Hence, it is returning nulls.


To solve this, you can create a new OSGI service like below:

public Class TagServiceImpl implements TagService {
  ResourceResolverFactory resolverFactory;
  public void init() {
    Map<String, Object> params = new HashMap<>();
    params.put(ResourceResolverFactory.SUBSERVICE, "companyServiceThread");
    ResourceResolver resourceResolver = resourceResolverFactory.getServiceResourceResolver(params);
  public void kill() {
    resolver = null;
  public Tag getTag(String tagID) {
    Tag myTag = resourceResolver.adaptTo(TagManager.class).resolve(tagID); //Now  works!!
    return myTag;
This service-user has been given the appropriate read/write privileges to required paths. Hence, the tag (myTag) can be successfully resolved. 

Answers (0)