Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
1.38.0
-
None
-
None
Description
When Session.getImportContentHandler tries to add a new child node which is not allowed due to the parent node's node type definition a SAXException is thrown wrapping a ConstraintViolationException. Still the new node has already been added to the transient space of that session as with Session.save() the exact same exception is thrown again.
javax.jcr.nodetype.ConstraintViolationException: No matching node definition found for new at org.apache.jackrabbit.oak.plugins.nodetype.EffectiveNodeTypeImpl.getNodeDefinition(EffectiveNodeTypeImpl.java:461) at org.apache.jackrabbit.oak.plugins.nodetype.ReadOnlyNodeTypeManager.getDefinition(ReadOnlyNodeTypeManager.java:396) at org.apache.jackrabbit.oak.jcr.xml.ImporterImpl.getDefinition(ImporterImpl.java:547) at org.apache.jackrabbit.oak.jcr.xml.ImporterImpl.endNode(ImporterImpl.java:482) at org.apache.jackrabbit.oak.jcr.xml.SysViewImportHandler.processNode(SysViewImportHandler.java:89)
Jackrabbit 2 throws the ConstrantViolationException as well but won't add the new (invalid) node to the transient space.
The same happens for properties which are not valid according to the node type definition.
Attachments
Issue Links
- relates to
-
OAK-8212 ImporterImpl.importProperties prone to NPE
-
- Closed
-
- links to