jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Mitterdorfer <daniel.mitterdor...@salzburgresearch.at>
Subject XPath query returns no results
Date Mon, 19 Nov 2007 11:36:17 GMT

XPath does not seem to work as expected for me. This is a dump of my 
repository contents (node name, followed by the primary node type in 

Prop: jcr:primaryType = rep:root
  jcr:system (rep:system)
  Prop: jcr:primaryType = rep:system
  <<large subtree here - irrelevant to the problem>>
  interedu (nt:unstructured)
  Prop: jcr:primaryType = nt:unstructured
    someTitle (nt:file)
    Prop: jcr:uuid = 2e311056-b5a6-4279-9c04-430db01ad56b
    Prop: jcr:mixinTypes = mix:referenceable
    Prop: jcr:created = 2007-11-19T12:32:58.290+01:00
    Prop: jcr:primaryType = nt:file
      jcr:content (nt:resource)
      Prop: jcr:predecessors =
      Prop: jcr:uuid = b6b9f064-cb12-49e6-9c32-ae28657825b6
      Prop: jcr:mixinTypes = mix:versionable
      Prop: jcr:data = Test
      Prop: jcr:versionHistory = 8eb37332-2550-4486-9f49-6406f2b5ede2
      Prop: jcr:mimeType = text/plain
      Prop: jcr:lastModified = 2007-11-19T12:32:58.290+01:00
      Prop: jcr:baseVersion = 941d13f5-deb3-40e5-9cab-4d2609f1bf0a
      Prop: jcr:primaryType = nt:resource
      Prop: jcr:isCheckedOut = false
where "interedu" is the root node of my application. If I query for all 
nodes using the XPath query '//*', I get all nodes in the repository. So 
far, so good. However, if i want to query only for the 'interedu' 
subtree using the XPath query '//interedu/*' i get no results although 
'interedu' has child nodes. I have already tried quite a few things but 
got no sufficient results (including a research on the Jackrabbit 
mailing lists). Can anybody see my error(s) or give me some pointers? 

Additional information:

* I have deleted all repository files before running my sample application.
* I use Jackrabbit version 1.3.3 which I integrat into my application 
using Spring Modules 0.8.
* My query code:

final QueryManager queryManager = session.getWorkspace().getQueryManager();
final Query query = queryManager.createQuery(queryString, Query.XPATH); 
//here I insert my query string (see above)
final QueryResult result = query.execute();
final NodeIterator it = result.getNodes();

System.err.println("================= Results =============");
while (it.hasNext()) {
  Node n = it.nextNode();
  System.err.println(n.getPath() + " (" + 
n.getPrimaryNodeType().getName() + ")");

* My Jackrabbit config file is defined as follows:

<?xml version="1.0" encoding="ISO-8859-1"?>
        <param name="path" value="${rep.home}"/>
    <Security appName="Jackrabbit">
class="org.apache.jackrabbit.core.security.SimpleAccessManager" />
    <Workspaces rootPath="${rep.home}/workspaces"
        defaultWorkspace="default" />
    <Workspace name="${wsp.name}">
            <param name="path" value="${wsp.home}"/>
            <param name="path" value="${wsp.home}/index" />
            <param name="useCompoundFile" value="true" />
            <param name="minMergeDocs" value="100" />
            <param name="volatileIdleTime" value="3" />
            <param name="maxMergeDocs" value="100000" />
            <param name="mergeFactor" value="10" />
            <param name="maxFieldLength" value="10000" />
            <param name="bufferSize" value="10" />
            <param name="cacheSize" value="1000" />
            <param name="forceConsistencyCheck" value="false" />
            <param name="autoRepair" value="true" />
            <param name="analyzer"
value="org.apache.lucene.analysis.standard.StandardAnalyzer" />
            <param name="queryClass"
                value="org.apache.jackrabbit.core.query.QueryImpl" />
            <param name="respectDocumentOrder" value="true" />
            <param name="resultFetchSize" value="2147483647" />
            <param name="extractorPoolSize" value="0" />
            <param name="extractorTimeout" value="100" />
            <param name="extractorBackLogSize" value="100" />
            <param name="textFilterClasses"


        <param name="path" value="${rep.home}/repository/index" />

    <Versioning rootPath="${rep.home}/versions">
            <param name="path" value="${rep.home}"/>



View raw message