ConstraintViolationException {internal}policy is protected. | Eclipse AEM Dev Tools
I've got a problem when attempting to publish/export from Eclipse to my local 6.2 AEM author instance.
I'm attempting to migrate some old JSP page templates to a new Arch10 project, we've got a custom page property dialog tab, that is specifically for admins only, so we have some rep:policy information in the dialog.xml file. Here's a snippet of that dialog:
<?xml version="1.0" encoding="UTF-8"?> <jcr:root xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:rep="internal" jcr:primaryType="cq:Dialog" height="400" stateful="false" xtype="dialog"> <items jcr:primaryType="cq:WidgetCollection"> <tabs jcr:primaryType="cq:TabPanel"> <items jcr:primaryType="cq:WidgetCollection"> <basic jcr:primaryType="cq:Widget" path="/libs/foundation/components/page/tab_basic.infinity.json" xtype="cqinclude"/> <adminonly jcr:primaryType="cq:Widget" jcr:mixinTypes="[rep:AccessControllable]" path="/apps/my-project/components/layouts/basePage/tab_adminonly.infinity.json" xtype="cqinclude"> <rep:policy jcr:primaryType="rep:ACL"> <deny jcr:primaryType="rep:DenyACE" rep:principalName="everyone" rep:privileges="{Name}[jcr:read]"/> <allow jcr:primaryType="rep:GrantACE" rep:principalName="administrators" rep:privileges="{Name}[jcr:read]"/> </rep:policy> </adminonly> ...Here's the AEM console log from Eclipse:
[September 28, 2016 10:13:07 AM CDT] AddOrUpdateNodeCommand (CREATE_ONLY_WHEN_MISSING) -> /apps : JcrResult[ success:true] (141 ms) [September 28, 2016 10:13:07 AM CDT] AddOrUpdateNodeCommand -> /apps/my-project : JcrResult[ success:true] (78 ms) [September 28, 2016 10:13:07 AM CDT] AddOrUpdateNodeCommand -> /apps/my-project/components : JcrResult[ success:true] (62 ms) [September 28, 2016 10:13:07 AM CDT] AddOrUpdateNodeCommand -> /apps/my-project/components/layouts : JcrResult[ success:true] (94 ms) [September 28, 2016 10:13:07 AM CDT] AddOrUpdateNodeCommand -> /apps/my-project/components/layouts/basePage : JcrResult[ success:true] (140 ms) [September 28, 2016 10:13:07 AM CDT] AddOrUpdateNodeCommand -> /apps/my-project/components/layouts/basePage/dialog : JcrResult[ success:false, exception: org.apache.sling.ide.transport.RepositoryException - javax.jcr.nodetype.ConstraintViolationException: {internal}policy is protected.] (47 ms) org.apache.sling.ide.transport.RepositoryException: javax.jcr.nodetype.ConstraintViolationException: {internal}policy is protected. at org.apache.sling.ide.impl.vlt.JcrResult.failure(JcrResult.java:33) at org.apache.sling.ide.impl.vlt.JcrCommand.execute(JcrCommand.java:76) at org.apache.sling.ide.transport.TracingCommand.execute(TracingCommand.java:45) at org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.execute(SlingLaunchpadBehaviour.java:477) at org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.publishContentModule(SlingLaunchpadBehaviour.java:467) at org.apache.sling.ide.eclipse.core.internal.SlingLaunchpadBehaviour.publishModule(SlingLaunchpadBehaviour.java:238) at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:1091) at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:1183) at org.apache.sling.ide.eclipse.core.internal.ServerBehaviourDelegateWithModulePublishSupport.publish(ServerBehaviourDelegateWithModulePublishSupport.java:137) at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:774) at org.apache.sling.ide.eclipse.core.internal.ServerBehaviourDelegateWithModulePublishSupport.publish(ServerBehaviourDelegateWithModulePublishSupport.java:54) at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:3157) at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:345) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) Caused by: javax.jcr.nodetype.ConstraintViolationException: {internal}policy is protected. at org.apache.jackrabbit.jcr2spi.nodetype.EffectiveNodeTypeImpl.checkAddNodeConstraints(EffectiveNodeTypeImpl.java:375) at org.apache.jackrabbit.jcr2spi.state.ItemStateValidator.checkAddNode(ItemStateValidator.java:388) at org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.addNodeState(SessionItemStateManager.java:435) at org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.visit(SessionItemStateManager.java:245) at org.apache.jackrabbit.jcr2spi.operation.AddNode.accept(AddNode.java:79) at org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.execute(SessionItemStateManager.java:215) at org.apache.jackrabbit.jcr2spi.NodeImpl.createNode(NodeImpl.java:1454) at org.apache.jackrabbit.jcr2spi.NodeImpl.addNode(NodeImpl.java:186) at org.apache.sling.ide.impl.vlt.AddOrUpdateNodeCommand.createNode(AddOrUpdateNodeCommand.java:176) at org.apache.sling.ide.impl.vlt.AddOrUpdateNodeCommand.update(AddOrUpdateNodeCommand.java:100) at org.apache.sling.ide.impl.vlt.AddOrUpdateNodeCommand.update(AddOrUpdateNodeCommand.java:112) at org.apache.sling.ide.impl.vlt.AddOrUpdateNodeCommand.update(AddOrUpdateNodeCommand.java:112) at org.apache.sling.ide.impl.vlt.AddOrUpdateNodeCommand.update(AddOrUpdateNodeCommand.java:112) at org.apache.sling.ide.impl.vlt.AddOrUpdateNodeCommand.update(AddOrUpdateNodeCommand.java:112) at org.apache.sling.ide.impl.vlt.AddOrUpdateNodeCommand.update(AddOrUpdateNodeCommand.java:112) at org.apache.sling.ide.impl.vlt.AddOrUpdateNodeCommand.execute0(AddOrUpdateNodeCommand.java:85) at org.apache.sling.ide.impl.vlt.AddOrUpdateNodeCommand.execute0(AddOrUpdateNodeCommand.java:1) at org.apache.sling.ide.impl.vlt.JcrCommand.execute(JcrCommand.java:68) ... 12 moreIt seems to be a problem with the xmlns:rep="internal", if I remove that and the policy definitions, then this all works just fine... :(
Anyone have any ideas on this? I've exhausted my Google-fu with no luck. Plenty of ConstraintViolationExceptions, but not for this specific scenario: "{internal}policy is protected."