jackrabbit-oak-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Parvulescu <alex.parvule...@gmail.com>
Subject Re: javax.jcr.nodetype.ConstraintViolationException oak:QueryIndexDefinition in oak-run
Date Fri, 07 Feb 2014 08:58:14 GMT
Hi Davide,

Have you tried using the existing utils class OakIndexUtils? [0]
See an example here [1].


best,
alex

[0]
https://github.com/apache/jackrabbit-oak/blob/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/util/OakIndexUtils.java

[1]
https://github.com/apache/jackrabbit-oak/blob/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/benchmark/SimpleSearchTest.java#L100




On Fri, Feb 7, 2014 at 9:51 AM, Davide Giannella <giannella.davide@gmail.com
> wrote:

> Good morning,
>
> trying to create some benchmarks in oak-run. I'm defining an index
> definition with the following snippet in the beforeTest()
>
> index = indexRoot.addNode("testStandardProperty");
> index.setProperty("unique", false);
> index.setProperty("reindex", false);
> index.setProperty("type","property");
> index.setProperty("propertyNames", new String[]{INDEXED_PROPERTY});
> index.setProperty("jcr:primaryType",
> IndexConstants.INDEX_DEFINITIONS_NODE_TYPE);
> session.save();
>
> but when executed getting the exception
>
> javax.jcr.nodetype.ConstraintViolationException: No matching property
> definition: jcr:primaryType = oak:QueryIndexDefinition
>     at
> org.apache.jackrabbit.oak.jcr.delegate.NodeDelegate.setProperty(NodeDelegate.java:515)
>     at
> org.apache.jackrabbit.oak.jcr.session.NodeImpl$38.perform(NodeImpl.java:1345)
>     at
> org.apache.jackrabbit.oak.jcr.session.NodeImpl$38.perform(NodeImpl.java:1334)
>     at
> org.apache.jackrabbit.oak.jcr.delegate.SessionDelegate.perform(SessionDelegate.java:154)
>     at
> org.apache.jackrabbit.oak.jcr.session.ItemImpl.perform(ItemImpl.java:111)
>     at
> org.apache.jackrabbit.oak.jcr.session.NodeImpl.internalSetProperty(NodeImpl.java:1334)
>     at
> org.apache.jackrabbit.oak.jcr.session.NodeImpl.setProperty(NodeImpl.java:428)
>     at
> org.apache.jackrabbit.oak.benchmark.StardardPropertyIndexOrderByInsertTest.beforeTest(StardardPropertyIndexOrderByInsertTest.java:42)
>     at
> org.apache.jackrabbit.oak.benchmark.AbstractTest.execute(AbstractTest.java:271)
>     at
> org.apache.jackrabbit.oak.benchmark.BaseOrderByInsertTest.execute(BaseOrderByInsertTest.java:29)
>     at
> org.apache.jackrabbit.oak.benchmark.AbstractTest.runTest(AbstractTest.java:157)
>     at
> org.apache.jackrabbit.oak.benchmark.AbstractTest.run(AbstractTest.java:138)
>     at
> org.apache.jackrabbit.oak.benchmark.BaseOrderByInsertTest.run(BaseOrderByInsertTest.java:29)
>     at
> org.apache.jackrabbit.oak.benchmark.BenchmarkRunner.main(BenchmarkRunner.java:198)
>     at org.apache.jackrabbit.oak.run.Main.main(Main.java:81)
>
> Any hints?
>
> Regards
> Davide
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message