0

I have a package built on AEM 5.6.1 and I've tested that it works as expected. However, when I try to deploy it in AEM 6, I get the following error:

Caused by: javax.jcr.nodetype.ConstraintViolationException: Item is protected.
    at org.apache.jackrabbit.oak.jcr.session.ItemImpl$ItemWriteOperation.checkPreconditions(ItemImpl.java:99)
    at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.perform(SessionDelegate.java:304)
    at org.apache.jackrabbit.oak.jcr.session.ItemImpl.perform(ItemImpl.java:113)
    at org.apache.jackrabbit.oak.jcr.session.NodeImpl.remove(NodeImpl.java:207)
    at org.apache.jackrabbit.vault.fs.impl.io.FolderArtifactHandler.accept(FolderArtifactHandler.java:112)
    at org.apache.jackrabbit.vault.fs.io.Importer.commit(Importer.java:880)
    at org.apache.jackrabbit.vault.fs.io.Importer.commit(Importer.java:758)
    at org.apache.jackrabbit.vault.fs.io.Importer.commit(Importer.java:795)
    at org.apache.jackrabbit.vault.fs.io.Importer.commit(Importer.java:795)
    at org.apache.jackrabbit.vault.fs.io.Importer.commit(Importer.java:795)
    at org.apache.jackrabbit.vault.fs.io.Importer.commit(Importer.java:795)
    at org.apache.jackrabbit.vault.fs.io.Importer.commit(Importer.java:795)

How can I resolve this error? What files should I start looking at in order to get my package working in AEM 6?

birdy
  • 9,286
  • 24
  • 107
  • 171

1 Answers1

0

Make sure that every folder has a .content.xml with at least the following content:

<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0" xmlns:rep="internal"
    jcr:mixinTypes="[rep:AccessControllable]"
    jcr:primaryType="nt:folder"/>
d33t
  • 1,143
  • 6
  • 15
  • The same code works perfectly fine on AEM 5.6.1. Is this somehing required for 6.0? – Omnipresent Apr 22 '15 at 12:06
  • I know, we had the same problem as we migrated our packages from CQ 5.6.1 to AEM 6.0. AEM 6.0 is based on OAK, so you should expect that things behave diffently (and this is absolutely the case unfortunately) – d33t Apr 22 '15 at 12:20
  • Note I've also seen mixins like rep:RepoAccessControllable generated by aem. – Federico May 10 '16 at 04:52