[
https://issues.apache.org/jira/browse/JCR-2267?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841240#action_12841240
]
angela commented on JCR-2267:
-----------------------------
> the proposed patch supresses the exception and just logs a warning
it might be that it works in you test. but as far as i know it violates the
specification: autocreated items must
be present in the transient layer but their value may change upon save... from
my point of view returning
a null value isn't a valid option.
for the AbstractQValueFactory i find the exception appropriate. subclasses and
custom qvalue factories
may provide a more sophisticated approach. e.g. by asking the backend for the
correct value.
> AbstractQValueFactory throws exception for unknown auto-create properties
> -------------------------------------------------------------------------
>
> Key: JCR-2267
> URL: https://issues.apache.org/jira/browse/JCR-2267
> Project: Jackrabbit Content Repository
> Issue Type: Bug
> Components: jackrabbit-spi-commons
> Reporter: Stefan Guggisberg
> Fix For: 2.1.0
>
> Attachments: r806112.patch
>
>
> the following properties were introduced in JCR 2.0:
> jcr:createdBy
> jcr:lastModifiedBy
> they're declared as autocreated and don't specify a default.
> the following code throws on save():
> parentFolderNode.addNode("foo", "nt:folder");
> session.save();
> ==>
> Caused by: javax.jcr.RepositoryException: createFromDefinition not
> implemented for: {http://www.jcp.org/jcr/1.0}createdBy
> at
> org.apache.jackrabbit.spi2davex.QValueFactoryImpl.computeAutoValues(QValueFactoryImpl.java:257)
> at
> org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.computeSystemGeneratedPropertyValues(SessionItemStateManager.java:687)
> at
> org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.addNodeState(SessionItemStateManager.java:601)
> at
> org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.visit(SessionItemStateManager.java:262)
> at
> org.apache.jackrabbit.jcr2spi.operation.AddNode.accept(AddNode.java:69)
> at
> org.apache.jackrabbit.jcr2spi.state.SessionItemStateManager.execute(SessionItemStateManager.java:228)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.createNode(NodeImpl.java:1294)
> at org.apache.jackrabbit.jcr2spi.NodeImpl.addNode(NodeImpl.java:183)
> ...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.