javax.jcr.nodetype.ConstraintViolationException:没有匹配的属性定义:PROPERTY [英] javax.jcr.nodetype.ConstraintViolationException: No matching property definition: PROPERTY

查看:184
本文介绍了javax.jcr.nodetype.ConstraintViolationException:没有匹配的属性定义:PROPERTY的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试为JCR节点设置属性时,出现错误

When I am trying to set a property to my JCR node I am getting error


javax.jcr.nodetype.ConstraintViolationException:否匹配的属性定义:PROPERTY。

javax.jcr.nodetype.ConstraintViolationException: No matching property definition: PROPERTY.

我是cq5的新手。请有人帮我解决此错误吗?

I am a newbie to cq5. Please can someone help me to resolve this error?

推荐答案

在jcr中,每个节点都有一个节点类型( jcr:primaryType的值)。

In jcr every node has a node-type (value of "jcr:primaryType").

大多数节点类型定义了该节点允许的属性架构。您不能只添加您喜欢的任何属性。它必须在模式中定义。如果尝试添加并持久化(提交)未定义 的属性,则会得到此 ConstraintViolationException

Most node-types define a schema of properties that are allowed on that node. You cannot just add whatever property you like. It has to be defined in the schema. If you try to add and persist (commit) a property that is not defined, you get exactly this ConstraintViolationException.

因此,这是可能发生的情况:您试图在具有严格模式的节点上创建并存储一个名为 PROPERTY的属性,不允许在其中进行这种操作。

So here's what likely happend: You've tried to create and store a property named "PROPERTY" on a node that has a strict schema, where that is not allowed.

如果您提供更多详细信息,您尝试确切地对哪种类型的节点进行操作,我也许可以查明问题所在。

If you provide more details what you tried to do exactly on what type of node, I may be able to pinpoint the problem.

这篇关于javax.jcr.nodetype.ConstraintViolationException:没有匹配的属性定义:PROPERTY的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆