Problem creating users with profile picture in CQ5 / AEM

I am using API AccountManager

to create users. It works great when I do not use the profile picture in the registration form and the user signs up, but as soon as I use the profile picture I get the following error:

Caused by: javax.jcr.nodetype.ConstraintViolationException: No matching property definition: jcr:primaryType = sling:Folder
    at org.apache.jackrabbit.oak.jcr.delegate.NodeDelegate.setProperty(NodeDelegate.java:522)
    at org.apache.jackrabbit.oak.jcr.session.NodeImpl$35.perform(NodeImpl.java:1308)
    at org.apache.jackrabbit.oak.jcr.session.NodeImpl$35.perform(NodeImpl.java:1297)
    at org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.perform(SessionDelegate.java:293)
    at org.apache.jackrabbit.oak.jcr.session.ItemImpl.perform(ItemImpl.java:113)
    at org.apache.jackrabbit.oak.jcr.session.NodeImpl.internalSetProperty(NodeImpl.java:1297)
    at org.apache.jackrabbit.oak.jcr.session.NodeImpl.setProperty(NodeImpl.java:340)
    at org.apache.sling.jcr.resource.JcrModifiablePropertyMap.save(JcrModifiablePropertyMap.java:180)
    ... 145 more

      

There is a hidden field to create this folder

<hidden
     jcr:primaryType="nt:unstructured"
     sling:resourceSuperType="foundation/components/form/defaults/field"
     sling:resourceType="foundation/components/form/hidden"
     defaultValue="sling:Folder"
     name="photos/jcr:primaryType"/>

      

Any inputs?

+3


source to share


1 answer


" sling: Folder " cannot be used for jcr node type when using Node.class.

Use " nt: unstructured "



I had a similar problem and this resolved it.

0


source







All Articles