Page 1 of 1

Problem accessing OpenKM WebDAV via Jackrabbit Application

PostPosted:Fri Mar 04, 2011 9:27 am
by Zerga
Hey guys!

I have set up the OpenKM-5.0.2_JBoss-4.2.3.GA standalone server and now i started my own application (in this case in the same jboss) which uses Jackrabbit. What i want to do is have the jackrabbit in my application use the repository of OpenKM - and my idea was to do that via WebDAV.

I can access the OpenKM WebDAV via Firefox and WebDAV clients on windows, but i have problems to access it with JcrUtils.getRepository(uri), where uri is either http://localhost:8080/OpenKM/repository/default or http://localhost:8080/OpenKM/repository ... t/okm:root - since it seems the getRepository method is not providing any way to include credentials... (correct me if i am wrong):
Code: Select all
The following RepositoryFactory classes were consulted:
    org.apache.jackrabbit.core.RepositoryFactoryImpl: declined
    org.apache.jackrabbit.commons.JndiRepositoryFactory: declined
    org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory: failed
        because of RepositoryException: Failed to read the resource at URL http://localhost:8080/OpenKM/repository/default/okm:root
        because of IOException: Server returned HTTP response code: 401 for URL: http://localhost:8080/OpenKM/repository/defeault/okm:root
    org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory: declined
    org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory: declined
Now my questions:
Can you tell me how to switch off Authentication on the OpenKM WebDAV and let anyone in (at least as a first step in my search for a solution)?

Or maybe someone already tried what i am doing and can give me a hint on how else i should do it... maybe JNDI or RMI? Is there a way to expose the OpenKM repository via JNDI or RMI without recompiling the source, i mean: in the config? Example code is always welcome :)

Sorry, i am a total noob on that whole jackrabbit/jcr thing...

Thanks for your help!!

Re: Problem accessing OpenKM WebDAV via Jackrabbit Applicati

PostPosted:Mon Mar 07, 2011 9:48 am
by pavila
If you want to use Jackrabbit repository from other application, you should take a look at http://jackrabbit.apache.org/deployment-models.html. Actually we use Model 1, son is not visible for other applications.

Re: Problem accessing OpenKM WebDAV via Jackrabbit Applicati

PostPosted:Mon Mar 07, 2011 10:33 am
by Zerga
Thank you pavila for the answer... could you tell me if its possible though to expose your jackrabbit to other applications via small code changes (for example registering the repository on creation in JNDI). Could you tell me where (in which class) the OpenKM Repository is initialized so i can register it to JNDI? Or better yet: Please tell me the JNDI Name under which it registers - in case it does already...

As a side-note, i found out that changing the web.xml at the Webdav Servlet settings from
Code: Select all
<param-name>x-missing-auth-mapping</param-name>
to
Code: Select all
<param-name>missing-auth-mapping</param-name>
disables the http basic authentication.

It did not help accessing the webdav though as i now get the following error message (from my jackrabbit):
Code: Select all
The following RepositoryFactory classes were consulted:
    org.apache.jackrabbit.core.RepositoryFactoryImpl: declined
    org.apache.jackrabbit.client.RepositoryFactoryImpl: declined
    org.apache.jackrabbit.commons.JndiRepositoryFactory: declined
    org.apache.jackrabbit.rmi.repository.RmiRepositoryFactory: failed
        because of RepositoryException: Failed to read the resource at URL http://***:8080/OpenKM/repository/default/okm:root
        because of StreamCorruptedException: invalid stream header: 3C21444F
    org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory: declined
    org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory: declined
Perhaps the repository you are trying to access is not available at the moment.

Re: Problem accessing OpenKM WebDAV via Jackrabbit Applicati

PostPosted:Tue Mar 08, 2011 7:36 pm
by pavila
In model 1 there is no JNDI repository registration. OpenKM jackrabbit repository only can be accessed from OpenKM. If you want to access the repository you can use OpenKM API exposed via WebServices or modify OpenKM to use a model 2 architecture.

Re: Problem accessing OpenKM WebDAV via Jackrabbit Applicati

PostPosted:Wed Mar 09, 2011 3:57 pm
by Zerga
Thanks... I will go for the second option and modify the source accordingly.

Re: Problem accessing OpenKM WebDAV via Jackrabbit Applicati

PostPosted:Mon Mar 14, 2011 9:21 pm
by pavila
Please, let me know your modifications once are funtionals.