On 2013-07-17 13:47, Sebastian Lindstaedt wrote:
Hi,
I'm migrating an Jackrabbit Application from JBoss EAP 5 to JBoss EAP 6 (aka.
JBoss 7.1.3.Final-redheat-4).
The Migration of Jackrabbit (from 1.5-jca to 2.5.3-jca) causes a bit of trouble
with XPath Queries.
To get jackrabbit-jca-2.5.3.rar running in the JBoss I modified it, as shown
here (https://community.jboss.org/wiki/JackrabbitDeploymentInAS6AndAS7) and
here (http://www.javaworld.com/community/node/8185)
After Deployment JBoss starts and the repository gets created.
In my EJB Application I inject the repository as a Resource
<code>
Class MySessionBean ...{
...
@Resource(mappedName = "java:jboss/jca/DocumentStore", type =
javax.jcr.Repository.class, authenticationType =
javax.annotation.Resource.AuthenticationType.CONTAINER)
Repository repo;
...
}
</code>
With this injected Repository I can:
- create nodes:
<code>
Node node = rootNode.addNode("test", "nt:unstructured");
</code>
- list existing nodes:
<code>
session.getRootNode().getNodes();
</code>
- run JCR-SQL2 Queries, showing plenty of nodes
<code>
"SELECT * FROM [nt:unstructured]"
</code>
But unfortunately any XPath Query returns without any result
Query: "//*" Result: queryresult.size = -1
Query: "//*[jcr:contains(., '*')]" Result: queryresult.size = -1
Result size -1 means "unknown", not empty. You'll need to iterate
through the result set...
Best regards, Julian