I am trying to delete existing nodes and then add new nodes under etc/tags/plant. The code is below. I see error when deleting a node. What ACL's needs to be there for service account to delete a node. String mainPath = "/etc/tags/plant"; Tag mainTag = tagManager.resolve(mainPath); if (mainTag != null) { logger.debug("Main Tag already exists "); Resource res = resourceResolver.getResource(mainPath); Node plantNode =res.adaptTo(Node.class); Iterator i = plantNode.getNodes(); while(i.hasNext()){ ((Node)i.next()).remove(); // This is generating error } javax.jcr.nodetype.ConstraintViolationException: Item is protected. at org.apache.jackrabbit.oak.jcr.session.ItemImpl$ItemWriteOperation.checkPreconditions(ItemImpl.java:98) at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.prePerform(SessionDelegate.java:615) at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.performVoid(SessionDelegate.java:271) at org.apache.jackrabbit.oak.jcr.session.NodeImpl.remove(NodeImpl.java:218) at com.gm.gpsc.sdlaem.core.schedulers.CountryTagUpdateScheduledTask.run(CountryTagUpdateScheduledTask.java:94) at org.apache.sling.commons.scheduler.impl.QuartzJobExecutor.execute(QuartzJobExecutor.java:118) at org.quartz.core.JobRunShell.run(JobRunShell.java:202) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)
Views
Replies
Total Likes
Hi,
Complete details of service user is in here http://adobeaemclub.com/access-to-resourceresolver-in-osgi-services-aem-6-1/
Views
Replies
Total Likes
I have created systemuser as per that documentation and given service user admin privileges, still the bundle is not able to delete a node in /etc/tags/plant folder. Keep getting
javax.jcr.nodetype.ConstraintViolationException: Item is protected.
Views
Replies
Total Likes
Hi,
Looking at the stack trace, I see
at com.gm.gpsc.sdlaem.core.schedulers.CountryTagUpdateScheduledTask.run(CountryTagUpdateScheduledTask.java:94)
Is it something like this code is part of a scheduler running in the system.
Views
Replies
Total Likes
Hi,
Also, are there too many tags present under the path you mentioned?
Would it be possible to delete them manually from backend and see how it goes.
Views
Replies
Total Likes
Yes, scheduler is deleting and creating tags to refresh the list. This code is the back end code running as osgi bundle
Views
Replies
Total Likes