Null Pointer when trying to access TagManager
I am writing a standalone script in java which is trying to modify some tags on my AEM instance. I am running into a problem when trying to get an instance of TagManager (com.day.cq.tagging.TagManager).
Here is what I have tried:
Repository repository = JcrUtils.getRepository("http://localhost:4502/crx/server"); Session session = repository.login(new SimpleCredentials("admin", "admin".toCharArray())); JcrTagManagerFactoryImpl tagManagerFactory = new JcrTagManagerFactoryImpl(); TagManager tagManager = tagManagerFactory.getTagManager(session);There is a NullPointerException being thrown on my last line of code there and I am not sure why. I would like to be clear that since this script is not being installed onto my AEM server (it is not a servlet), I cannot obtain the TagManager from a ResourceResolver. Also my session object is working correctly (I testing adding nodes through it and it was fine).
Thankyou for any help.