jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexandru Popescu ☀" <the.mindstorm.mailingl...@gmail.com>
Subject Re: Setting JCR:CREATED Fails
Date Fri, 06 Apr 2007 14:00:04 GMT
On 4/6/07, Julian <cerebro70@yahoo.com> wrote:
> bump, please help me get off Slide.
>
> ----- Original Message ----
> From: Julian <cerebro70@yahoo.com>
> To: users@jackrabbit.apache.org
> Sent: Wednesday, April 4, 2007 1:09:22 PM
> Subject: Setting JCR:CREATED Fails
>
> Hi,
>
> I am porting my content repository from one system to jackrabbit.  While doing this I
want to keep the created dates intact, but I get an
> error when importing files (nt:file) into the repository.  The error indicates the property
jcr:created doesn't exist (see stack below, also I have tried setting jcr:autoCreated), but
when I omit the code to set the property on the node before saving it, I have no problems.
 Is there a way around to set this value or do I need to make a custom node type to set the
value?
>
>
> Thanks,
> Julian
>
>
> no matching property definition found for {http://www.jcp.org/jcr/1.0}created
> Caused by:
> javax.jcr.nodetype.ConstraintViolationException: no matching property definition found
for {http://www.jcp.org/jcr/1.0}created
>     at org.apache.jackrabbit.core.nodetype.EffectiveNodeType.getApplicablePropertyDef(EffectiveNodeType.java:771)
>     at org.apache.jackrabbit.core.NodeImpl.getApplicablePropertyDefinition(NodeImpl.java:926)
>     at org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java:457)
>     at org.apache.jackrabbit.core.NodeImpl.getOrCreateProperty(NodeImpl.java:407)
>     at org.apache.jackrabbit.core.NodeImpl.setProperty(NodeImpl.java:2362)
> ....
>
>
>
>
>

According to the spec: 6.7.22.5 nt:hierarchyNode:

PropertyDefinition
  Name jcr:created
  RequiredType DATE
  ValueConstraints []
  DefaultValue null s
  AutoCreated true
  Mandatory false
  OnParentVersion INITIALIZE
  Protected true
  Multiple false

As you see the property is protected so you cannot set it yourself.

bests,

./alex
--
.w( the_mindstorm )p.
_____________________________________
  Alexandru Popescu, OSS Evangelist
TestNG/Groovy/AspectJ/WebWork/more...
  Information Queue ~ www.InfoQ.com

Mime
View raw message