Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

ConstraintViolationException {internal}policy is protected. | Eclipse AEM Dev Tools

Avatar

Avatar
Validate 10
Level 4
Gdubz-57m2mu
Level 4

Likes

41 likes

Total Posts

123 posts

Correct Reply

9 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 10
Level 4
Gdubz-57m2mu
Level 4

Likes

41 likes

Total Posts

123 posts

Correct Reply

9 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
Gdubz-57m2mu
Level 4

28-09-2016

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 more

It 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."

Replies

Avatar

Avatar
Validate 10
Level 4
Gdubz-57m2mu
Level 4

Likes

41 likes

Total Posts

123 posts

Correct Reply

9 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 10
Level 4
Gdubz-57m2mu
Level 4

Likes

41 likes

Total Posts

123 posts

Correct Reply

9 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
Gdubz-57m2mu
Level 4

28-09-2016

Also probably worth mentioning. If I create this dialog in CRX DE Lite and then "Import from server..." into Eclipse, it works just fine. The next time I make a change in Eclipse and it tries to then export the apps module back to the server, that's when there's a problem.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,406 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

28-09-2016

I am checking with internal Adobe people. I have not seen this issue before.

Avatar

Avatar
Validate 10
Level 4
Gdubz-57m2mu
Level 4

Likes

41 likes

Total Posts

123 posts

Correct Reply

9 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile

Avatar
Validate 10
Level 4
Gdubz-57m2mu
Level 4

Likes

41 likes

Total Posts

123 posts

Correct Reply

9 solutions
Top badges earned
Validate 10
Validate 1
Boost 5
Boost 3
Boost 25
View profile
Gdubz-57m2mu
Level 4

28-09-2016

smacdonald2008 wrote...

I am checking with internal Adobe people. I have not seen this issue before.

 

Thanks Scott! Our plan is to eventually refactor these to HTL and move structure/layout/policies to a project-specific /conf folder, but for now we need to move these as-is to continue supporting old content, until it can be updated.

Avatar

Avatar
Boost 5
Employee
vmehrotr
Employee

Likes

19 likes

Total Posts

43 posts

Correct Reply

5 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile

Avatar
Boost 5
Employee
vmehrotr
Employee

Likes

19 likes

Total Posts

43 posts

Correct Reply

5 solutions
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Applaud 5
View profile
vmehrotr
Employee

28-09-2016

You should migrate the content without the rep:policy as the permissions should be instance specific. rep:acl nodes are protected nodes and cannot be directly migrated. If you want to migrate acls, you should be doing that separately

using this utility - http://www.wemblog.com/2011/11/how-to-create-package-based-on-xpath-in.html

Avatar

Avatar
Validate 1
Level 2
rajnishkaushik
Level 2

Likes

7 likes

Total Posts

14 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
rajnishkaushik
Level 2

Likes

7 likes

Total Posts

14 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
rajnishkaushik
Level 2

05-05-2017

I was facing this error sometimes back when doing "Export to server" from content jcr_root. I am using Eclipse AEM Developer Tools 1.1.0.

The way the issue was resolved was to do the vault import once:

Go to your content jcr_root folder, and use the vlt command

>vlt import -v http://localhost:4502/crx . /

This seems to have synchronized the crx with the content. Thereafter, changing the content in Eclipse did not have any issue in publishing to the crx. Hope that information helps.