You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by mathiasconradt <ma...@gmail.com> on 2016/10/28 18:17:15 UTC

How to access a Jackrabbit Oak repository via WebDAV?

When I start a Jackrabbit 2 repository, I can just connect to it via WebDAV
easily via http://localhost:8080/repository/default

This does not work with Oak though.

Unfortunately it is not well documents and all I could find, which is Oak &
WebDAV-related, were these tickets in Jira 

-
https://issues.apache.org/jira/browse/OAK-4?focusedCommentId=13236811&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13236811

- https://issues.apache.org/jira/browse/OAK-104

and the mailing list post

-
http://jackrabbit.510166.n4.nabble.com/Exception-while-tryng-to-connect-to-Oak-via-WebDav-td4661166.html#a4661173, 

which did not give me any useful hint and which are also a bit older
already.


So my questions are actually two questions:

1) How to connect to an Oak repository via WebDAV which runs standalone?
(connecting to localhost:8080 or localhost:8080/repository/default does not
work)

2) How to connect to an Oak repository via WebDAV which is created/embedded
in an application? How to expose the port and how to enable WebDAV? Are
there any code samples somewhere maybe?



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/How-to-access-a-Jackrabbit-Oak-repository-via-WebDAV-tp4665278.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: How to access a Jackrabbit Oak repository via WebDAV?

Posted by mathiasconradt <ma...@gmail.com>.
Ticket created: 
https://issues.apache.org/jira/browse/OAK-5500
https://issues.apache.org/jira/browse/OAK-5501



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/How-to-access-a-Jackrabbit-Oak-repository-via-WebDAV-tp4665278p4666235.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: How to access a Jackrabbit Oak repository via WebDAV?

Posted by Julian Reschke <ju...@gmx.de>.
On 2017-01-23 14:18, mathiasconradt wrote:
> Hi Julian,
>
> thanks for the info. I will look further into it then to figure out where
> it's configured wrongly (sorry, new to Oak).
>
> FYI - regarding the Oak configuration: all I did was getting the latest
> sources from the git trunk (as of today) without doing any modifications,
> ran a 'mvn clean install' which completed without errors, then ran the jar
> file via 'java -jar oak-standalone-1.6-SNAPSHOT.jar'.
>
> I didn't do any kind of configuration at all (same as I didn't for the
> Jackrabbit2 standalone). So I guess the default Webdav configuration in Oak
> is set to remoting?!

That's what it sounds like...

> I do see an ERROR as below during the startup by the way (the complete
> startup log is at http://pastebin.com/hdtqr3AR), although the application
> continues to startup and is working fine from what I can see, except for
> that thrown error:
> ...

That indicates that this subproject isn't, let's say, well-tested :-)

Can you open JIRA issues for the individual problems?

Best regards, Julian

Re: How to access a Jackrabbit Oak repository via WebDAV?

Posted by mathiasconradt <ma...@gmail.com>.
Hi Julian,

thanks for the info. I will look further into it then to figure out where
it's configured wrongly (sorry, new to Oak).

FYI - regarding the Oak configuration: all I did was getting the latest
sources from the git trunk (as of today) without doing any modifications,
ran a 'mvn clean install' which completed without errors, then ran the jar
file via 'java -jar oak-standalone-1.6-SNAPSHOT.jar'.

I didn't do any kind of configuration at all (same as I didn't for the
Jackrabbit2 standalone). So I guess the default Webdav configuration in Oak
is set to remoting?!

I do see an ERROR as below during the startup by the way (the complete
startup log is at http://pastebin.com/hdtqr3AR), although the application
continues to startup and is working fine from what I can see, except for
that thrown error:

2017-01-23 14:08:46.909  INFO 13809 --- [           main]
o.a.j.w.server.AbstractWebdavServlet     : authenticate-header = Basic
realm="Jackrabbit Webdav Server"
2017-01-23 14:08:46.910  INFO 13809 --- [           main]
o.a.j.w.server.AbstractWebdavServlet     : csrf-protection = null
2017-01-23 14:08:46.910  INFO 13809 --- [           main]
o.a.j.w.server.AbstractWebdavServlet     : createAbsoluteURI = true
2017-01-23 14:08:46.910  INFO 13809 --- [           main]
o.a.j.webdav.simple.SimpleWebdavServlet  : resource-path-prefix =
'/repository'
2017-01-23 14:08:46.998  INFO 13809 --- [           main]
o.a.j.w.server.AbstractWebdavServlet     : authenticate-header = Basic
realm="Jackrabbit Webdav Server"
2017-01-23 14:08:46.999  INFO 13809 --- [           main]
o.a.j.w.server.AbstractWebdavServlet     : csrf-protection = null
2017-01-23 14:08:46.999  INFO 13809 --- [           main]
o.a.j.w.server.AbstractWebdavServlet     : createAbsoluteURI = true
2017-01-23 14:08:47.020 ERROR 13809 --- [           main]
o.a.j.s.r.davex.ProtectedRemoveManager   :
remoting/protectedHandlersConfig.xml

java.lang.ClassNotFoundException: remoting/protectedHandlersConfig.xml
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:260)
	at
org.apache.jackrabbit.server.remoting.davex.ProtectedRemoveManager.createHandler(ProtectedRemoveManager.java:92)
	at
org.apache.jackrabbit.server.remoting.davex.ProtectedRemoveManager.<init>(ProtectedRemoveManager.java:59)
	at
org.apache.jackrabbit.server.remoting.davex.JcrRemotingServlet.init(JcrRemotingServlet.java:283)
	at javax.servlet.GenericServlet.init(GenericServlet.java:244)
	at
org.eclipse.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:616)
	at
org.eclipse.jetty.servlet.ServletHolder.initialize(ServletHolder.java:396)
	at
org.eclipse.jetty.servlet.ServletHandler.initialize(ServletHandler.java:871)
	at
org.springframework.boot.context.embedded.jetty.JettyEmbeddedWebAppContext$JettyEmbeddedServletHandler.deferredInitialize(JettyEmbeddedWebAppContext.java:46)
	at
org.springframework.boot.context.embedded.jetty.JettyEmbeddedWebAppContext.deferredInitialize(JettyEmbeddedWebAppContext.java:36)
	at
org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainer.handleDeferredInitialize(JettyEmbeddedServletContainer.java:166)
	at
org.springframework.boot.context.embedded.jetty.JettyEmbeddedServletContainer.start(JettyEmbeddedServletContainer.java:113)
	at
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.startEmbeddedServletContainer(EmbeddedWebApplicationContext.java:290)
	at
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.finishRefresh(EmbeddedWebApplicationContext.java:141)
	at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:540)
	at
org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
	at
org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752)
	at
org.springframework.boot.SpringApplication.doRun(SpringApplication.java:347)
	at
org.springframework.boot.SpringApplication.run(SpringApplication.java:295)
	at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1112)
	at
org.springframework.boot.SpringApplication.run(SpringApplication.java:1101)
	at org.apache.jackrabbit.oak.standalone.OakServer.main(OakServer.java:29)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at
org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:53)
	at java.lang.Thread.run(Thread.java:745)

2017-01-23 14:08:47.053  INFO 13809 --- [           main] application                             
: Initializing Spring FrameworkServlet 'dispatcherServlet'
2017-01-23 14:08:47.053  INFO 13809 --- [           main]
o.s.web.servlet.DispatcherServlet        : FrameworkServlet
'dispatcherServlet': initialization started
2017-01-23 14:08:47.083  INFO 13809 --- [           main]
o.s.web.servlet.DispatcherServlet        : FrameworkServlet
'dispatcherServlet': initialization completed in 30 ms
2017-01-23 14:08:47.122  INFO 13809 --- [           main]
o.eclipse.jetty.server.ServerConnector   : Started
ServerConnector@660d34d4{HTTP/1.1}{0.0.0.0:8080}
2017-01-23 14:08:47.126  INFO 13809 --- [           main]
.s.b.c.e.j.JettyEmbeddedServletContainer : Jetty started on port(s) 8080
(http/1.1)
2017-01-23 14:08:47.131  INFO 13809 --- [           main]
o.a.jackrabbit.oak.standalone.OakServer  : Started OakServer in 9.942
seconds (JVM running for 10.449)
2017-01-23 14:08:48.414  INFO 13809 --- [uled-executor-3]
o.a.j.o.plugins.index.AsyncIndexUpdate   : [async] Initial index update

Regards,
Mathias




--
View this message in context: http://jackrabbit.510166.n4.nabble.com/How-to-access-a-Jackrabbit-Oak-repository-via-WebDAV-tp4665278p4666232.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: How to access a Jackrabbit Oak repository via WebDAV?

Posted by Julian Reschke <ju...@gmx.de>.
On 2017-01-23 13:07, mathiasconradt wrote:
> Why does the WebDAV implementation/behaviour of Jackrabbit2 and Oak differ so
> much? When I connect to a Jackrabbit2 repo via WebDAV, I see the files as
> binary content and can access the binary content, i.e. open a pdf directly
> from there.
>
> When connecting to an Oak repo via WebDAV though, the content nodes (i.e.
> when I post/upload a pdf or jpg via WebDAV) are represented as folders, the
> binary content is not directly accessible via WebDAV client. What's the
> reason for this different implementation?
>
> I would expect that most WebDAV users would like to access the binary
> content (jcr:content/jcr:data) of a repo rather than seeing the node
> hierarchy.
>
> Screenshots taken from the standalone-jars of each:
> https://snag.gy/NQEqaP.jpg
>
> Regards,
> Mathias

They are not supposed to differ like that.

Jackrabbit has two WebDAV modes, one used for standard WebDAV clients, 
one for remoting. For some reason you see the former on Jackrabbit and 
the latter on Oak.

This sounds as if the Oak standalone has a config/setup problem...

Best regards, Julian


Re: How to access a Jackrabbit Oak repository via WebDAV?

Posted by mathiasconradt <ma...@gmail.com>.
Why does the WebDAV implementation/behaviour of Jackrabbit2 and Oak differ so
much? When I connect to a Jackrabbit2 repo via WebDAV, I see the files as
binary content and can access the binary content, i.e. open a pdf directly
from there.

When connecting to an Oak repo via WebDAV though, the content nodes (i.e.
when I post/upload a pdf or jpg via WebDAV) are represented as folders, the
binary content is not directly accessible via WebDAV client. What's the
reason for this different implementation?

I would expect that most WebDAV users would like to access the binary
content (jcr:content/jcr:data) of a repo rather than seeing the node
hierarchy.

Screenshots taken from the standalone-jars of each:
https://snag.gy/NQEqaP.jpg

Regards,
Mathias



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/How-to-access-a-Jackrabbit-Oak-repository-via-WebDAV-tp4665278p4666229.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: How to access a Jackrabbit Oak repository via WebDAV?

Posted by Chetan Mehrotra <ch...@gmail.com>.
On Sat, Dec 17, 2016 at 5:32 PM, mathiasconradt
<ma...@gmail.com> wrote:
> I was missing the workspace name (default) in the URL.

Updated the readme (1774792) to include workspace name in webdav url.

Chetan Mehrotra

Re: How to access a Jackrabbit Oak repository via WebDAV?

Posted by mathiasconradt <ma...@gmail.com>.
An update from myself on this one: 

I was missing the workspace name (default) in the URL.

Following the instructions on 
https://svn.apache.org/repos/asf/jackrabbit/oak/trunk/oak-examples/standalone/README.md
<https://svn.apache.org/repos/asf/jackrabbit/oak/trunk/oak-examples/standalone/README.md>  
and then starting the repository via

java -jar target/oak-standalone-*.jar

I can access it via WebDav at http://localhost:8080/repository/default/. I
missed to put the /default in the URL.




--
View this message in context: http://jackrabbit.510166.n4.nabble.com/How-to-access-a-Jackrabbit-Oak-repository-via-WebDAV-tp4665278p4665854.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.