Unable to access repository using WebDAV from java.


I've deployed jackrabbit-webapp-2.6.5.war in tomcat and I'm able to access
http://localhost:8082/jackrabbit-webapp-2.6.5/server from browser.

But when I try to access repository from java test code
public class Test {

        <at> SuppressWarnings("nls")
       public static void main(String[] args) {

             Repository repository;
             Session session = null;
             try {
                    repository = JcrUtils

                    session = repository.login(new SimpleCredentials("admin", "admin"

                    Node node = session.getRootNode();

                    System.out.println("name" + node.getName() + " path "
                                 + node.getPath());

             } catch (Exception e) {
                    // TODO Auto-generated catch block
             } finally {
                    if (session != null) {
(Continue reading)

Torgeir Veimo | 14 Apr 12:34 2014

remote user management over webdav

Are there any best practices regarding creating users on a remote
jackrabbit repository?



isidoro | 11 Apr 18:03 2014

Indexing a property in a sub node

I'm trying to index a property in a subnode:
How can I index the property myjrc:size of the node jcr:content in a node of
type myjcr:myType? 
I've tried doing this in my indexing_configuration.xml:

 <aggregate primaryType="myjcr:myType">

And then I've created a xpath to search files by size:

jcr:content/ <at> myjrc:size > xs:long('0')

but it does not work. 

What's wrong? Can anyone help me?

Thanks in advance.


View this message in context: http://jackrabbit.510166.n4.nabble.com/Indexing-a-property-in-a-sub-node-tp4660697.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Dube, Shreyas | 10 Apr 16:02 2014

Persisting SearchIndex to database


Background: I’m evaluating JCR/Jackrabbit as a layer of abstraction for persistence over Oracle. We
are using Tomcat6 as the application server. We usually have 4 – 8 Tomcat’s clustered up in the
production environment. I have configured all <FileSystem> and <PersistenceManager> stanzas to point
to Oracle (well, I’m using MySQL now, but that’ll change). I have NOT set up clustering in Jackrabbit
yet and that is something I want to look at once I figure <SearchIndex> out. This is my <SearchIndex>
configuration for a <Workspace>

        <SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">
            <param name="path" value="${wsp.home}/index"/>
            <param name="extractorPoolSize" value="2"/>
            <param name="supportHighlighting" value="true"/>

This <SearchIndex> configuration ends up creating a bunch of files under ${wsp.home}/index under the
repository home and the workspace home directory.

 1.  What are these files storing? I’m assuming it is the search index.
 2.  Given that we have a clustered Tomcat setup, would it be possible to persist the search index to the database?
 3.  If 2 is not possible, are there other search providers that would work in a clustered environment?
 4.  Would turning on Jackrabbit clustering sync search indexes across all nodes? When are search indexes
updated in a clustered environment?

Jakob Reichl | 9 Apr 13:36 2014

Assign a name to a branch of the version tree

What is the best way to assign names to branches of the version tree of a node ?
A node may have a main branch, one or several development branches and
 an integration branch.
One solution is to use labels, another one is to use a property. Are
there better alternatives ?

An application may be e.g. "give me the latest version on a certain branch".

Lukas Kahwe Smith | 8 Apr 09:25 2014

json API exception


While using the json API we are seeing frequently such errors. These are read requests, which is why I am a bit
confused about the “WRITER” in the stack trace but I guess the issue is that
"/server/joiz_ch/jcr:root/.0.json” is an invalid URL?

2014-04-03 12:28:06.964 ERROR [2115513477 <at> qtp-221739023-131] Slf4jLog.java:87 /server/joiz_ch/jcr:root/.0.json
java.lang.IllegalStateException: WRITER
	at org.mortbay.jetty.Response.getOutputStream(Response.java:594) ~[jackrabbit.jar:na]
org.apache.jackrabbit.webdav.WebdavResponseImpl.sendXmlResponse(WebdavResponseImpl.java:151) ~[jackrabbit.jar:na]
	at org.apache.jackrabbit.webdav.WebdavResponseImpl.sendError(WebdavResponseImpl.java:95) ~[jackrabbit.jar:na]
org.apache.jackrabbit.webdav.server.AbstractWebdavServlet.service(AbstractWebdavServlet.java:299) ~[jackrabbit.jar:na]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) ~[jackrabbit.jar:na]
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) ~[jackrabbit.jar:na]
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390) ~[jackrabbit.jar:na]
	at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) [jackrabbit.jar:na]
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) [jackrabbit.jar:na]
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) [jackrabbit.jar:na]
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) [jackrabbit.jar:na]
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) [jackrabbit.jar:na]
	at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49) [jackrabbit.jar:na]
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) [jackrabbit.jar:na]
	at org.mortbay.jetty.Server.handle(Server.java:326) [jackrabbit.jar:na]
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) [jackrabbit.jar:na]
	at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938) [jackrabbit.jar:na]
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755) [jackrabbit.jar:na]
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218) [jackrabbit.jar:na]
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) [jackrabbit.jar:na]
(Continue reading)

crm6360 | 27 Mar 21:00 2014

ImportXML fatal bug with jackrabbit webapp 2.6+

Has anyone else been able to confirm this because I'm seeing other developers
reporting similar issues and don't know if the apache team is in fact aware.  
To reproduce simply deploy a jackrabbit-webapp-2.6.2 or greater (haven't
tested on earlier versions).

Attempt to import previously serialized XML using the sesson.importXML or
workspace.importXML( ... ).

When your session or workspace points to the jackrabbit-standalone
configuration the import is successful and the node is generated on the
server.   When your session points to the webapp config, the process fails

DavLocatorFactoryImpl.getRepositoryPath() is returning the incorrect
workspace path.  In this example, the workspace is "default".   The trace:

SEVERE: Servlet.service() for servlet [JCRWebdavServer] in context with path
[/jackrabbit-webapp-2.7.5] threw exception
java.lang.IllegalArgumentException: Unexpected format of resource path:
(workspace: /jackrabbit-webapp-2.7.5)
(Continue reading)

SCHEDENIG Marian | 27 Mar 12:17 2014

Workspace.copy() not updating existing target node?



I’m struggling with Workspace’s copy method.




The way I understand the specification, it should copy the entire sub tree of the source node, even if the target node already exists (in this case updating any already existing nodes). Or, failing that, it should throw an exception.


But the behaviour I get differs: If the target node does not exist, the source sub tree is copied correctly. If the target node exists, it seems to be not changed at all. In particular, if the source node has child nodes and the target node exists and is empty before the copy call, it is still empty after the call finishes (without exceptions).


Is this a bug? It doesn’t seem to be, because I’ve been getting this behaviour with Jackrabbit 2.4.2, 2.6.5 and 2.7.5. But if it isn’t, what about the specification am I not interpreting correctly?


Here’s the relevant code from my test method. I’m not providing the full file, as it references a couple of project internal convenience classes for setting up stuff, but the issue should be clear from this snippet. If required, I can create a standalone test class.


<at> Test

public void testCopy() throws LoginException, RepositoryException, IOException


                Node root = session.getRootNode();


                Node dir1 = createFolder(root, "dir1");

                Node file1 = createFile(dir1, "file.txt");

                storeContent(file1, "test1".getBytes());


                Node dir2 = createFolder(root, "dir2");

                Node file2 = createFile(dir2, "file.txt");

                storeContent(file2, "test2".getBytes());


                Node dir3 = createFolder(root, "dir3");


                Assert.assertEquals("test1", new String(readContent(file1)));

                Assert.assertEquals("test2", new String(readContent(file2)));



                session.getWorkspace().copy(dir1.getPath(), dir3.getPath());

//            session.getWorkspace().copy(dir1.getPath(), root.getPath() + "dir3/");



//            Node dir3 = root.getNode("dir3");

                Assert.assertEquals(1, getChildren(dir3).size());

                Node file3 = dir3.getNode("file.txt");

                Assert.assertEquals("test1", new String(readContent(file3)));


                session.getWorkspace().copy(dir1.getPath(), dir2.getPath());



                Assert.assertEquals("test1", new String(readContent(file1)));

                Assert.assertEquals("test1", new String(readContent(file2)));



This code fails at Assert.assertEquals(1, getChildren(dir3).size());, because the existing dir3 node is still empty after the copy().


If I remove the current dir3 assignment and the matching copy() call and instead activate the currently commented out lines, the dir3 segment runs through and the final assert fails, because file2 was not changed by the second copy() call.






DI Marian Schedenig

Senior Developer



INFINICA - Member of Qualysoft Group

Leonard-Bernstein-Straße 10

A-1220 Wien



Tel +43 1 263 12 96

Fax +43 1 4095987-11




marian.schedenig <at> infinica.at


P Please consider the environment before printing this email


crm6360 | 17 Mar 16:33 2014

Is there a way to set a version history limit?

To prevent jackrabbit server disk space from filling up too quickly, is there
a configuration or setting we can apply to cap the number of versions that a
node can retain in its version history?   Or is this something that will
require programmatic/manual scrubbing?


View this message in context: http://jackrabbit.510166.n4.nabble.com/Is-there-a-way-to-set-a-version-history-limit-tp4660558.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

crm6360 | 14 Mar 18:03 2014

jackrabbit-webapp-server is logging every POLL event by event listener

We have an application that acts as an event listener by subscribing for
events from the jackrabbit-webapp server (2.6.2).   When the listener is
registered, it apparently starts polling the server every 3 seconds.   The
problem, unfortunately, is the server is recording every "POLL" event to the
tomcat localhost log:


Every 3 seconds this event gets logged: - - [14/Mar/2014:11:13:15 -0400] "POLL
/jackrabbit-webapp-2.6.2/server/default/jcr%3aroot HTTP/1.1" 200 121

This will fill up my disk space pretty quickly.  Is there a way to disable
this event from being logged?


View this message in context: http://jackrabbit.510166.n4.nabble.com/jackrabbit-webapp-server-is-logging-every-POLL-event-by-event-listener-tp4660544.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

AshokBS | 14 Mar 10:21 2014

Why do i get this OverlappingFileLockException exception?

Why am i getting this exception even though i am still trying to register the

*catch (OverlappingFileLockException e) {
            // JCR-912: OverlappingFileLockException with JRE 1.6
            throw new RepositoryException(
                    "The repository home " + directory + " appears to be in
                    + " since the file named " + file.getName()
                    + " is already locked by the current process.");

I have used the below setup as described below:

1) In bootstrap.properties , I have the following settings:

# RMI Settings

2) In my java code, i am trying this:

private static Repository getRepository() throws NamingException,
RepositoryException {
  String configFile = "/jackrabbit/repository/repository.xml";
  String repHomeDir = "/jackrabbit/repository";

  Hashtable<String,String> env = new Hashtable<String,String>();

  env.put(Context.PROVIDER_URL, "localhost");
  InitialContext ctx = new InitialContext(env);

true); //line 9
  Repository r = (Repository)ctx.lookup("jackrabbit.repository"); //line10
  return r;

By the time it reaches line9, a .lock file is already found in the location
D:/jackrabbit/repository and hence the above exception? Please can anyone
explaing, why this exception is happening even though the repository is not
yet registered ? why the lock file is created and hence not allowing to
succeed to line10 above. Any thoughts??

View this message in context: http://jackrabbit.510166.n4.nabble.com/Why-do-i-get-this-OverlappingFileLockException-exception-tp4660526.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.