Don't try to set type on root node by mkdir
[lgpl/argeo-commons.git] / server / runtime / org.argeo.server.jcr / src / main / java / org / argeo / jcr / JcrUtils.java
index fdc69214942fde0a57b9ffd679b789097fc78ca9..39bdf34ba3ad61e87978ab4f183e2d9a95c5d849 100644 (file)
@@ -354,7 +354,8 @@ public class JcrUtils implements ArgeoJcrConstants {
                        if (session.itemExists(path)) {
                                Node node = session.getNode(path);
                                // check type
-                               if (type != null && !node.isNodeType(type))
+                               if (type != null && !node.isNodeType(type)
+                                               && !node.getPath().equals("/"))
                                        throw new ArgeoException("Node " + node
                                                        + " exists but is of type "
                                                        + node.getPrimaryNodeType().getName()