You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by David Marginian <da...@davidmarginian.com> on 2015/11/17 01:46:56 UTC

New to Oak, help with webdav

I am new to both JackRabbit and Oak and trying to upgrade an existing 
system to use Oak.  I want to access the repo via webdav and currently I 
obtain the repo by passing the URL into JcrUtils.getRepository.  I am 
struggling to figure out how to do the same thing in Oak.  I am running 
the Oak server via the jar:

java -jar oak-run-1.2.7.jar server http://localhost:8452 Oak-Mongo --db 
myOak --host localhost --port 8524

this creates the myOak DB in Mongo and I can hit 
http://localhost:8452/webdav/default via the browser.  But when I try to 
use JcrUtils.getRepository from my code I get:

Caused by: javax.jcr.RepositoryException: Unable to access a repository 
with the following settings:
     org.apache.jackrabbit.repository.uri: 
http://localhost:8452/webdav/default
The following RepositoryFactory classes were consulted:
     org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory: declined
     org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory: declined
     org.apache.jackrabbit.oak.jcr.OakRepositoryFactory: declined
     org.apache.jackrabbit.commons.JndiRepositoryFactory: declined

I realize I am using the old JackRabbit API but I am not sure how to do 
this via Oak.  I am sure I am missing something basic, can someone help 
me out, point me in the right direction?

Thanks for your time

Re: New to Oak, help with webdav

Posted by David Marginian <da...@davidmarginian.com>.
Thanks Angela.   I actually pulled the code and saw most of this but I 
still couldn't get it to work (this stuff is all on the server, couldn't 
figure out how to obtain the repo on the client).  Thinking about it 
more though, I really don't need this.  I can just hit the Mongo repo 
directly (https://jackrabbit.apache.org/oak/docs/construct.html).

On 11/17/2015 02:42 AM, Angela Schreiber wrote:
> hi david
>
> hm.... but the link below (http://localhost:8452/webdav/default)
> rather looks like default webdav.
>
> as a general note i don't see any compelling reason why both
> webdav and jcr-remoting should not work when replacing jackrabbit-core
> repository by oak. the only thing that you probably have to do
> is running the migration first.
>
> looking at the code in oak-run that setups up the server it find
> the following:
>
> final Repository jcrRepository = jcr.createRepository();
> @SuppressWarnings("serial")
> ServletHolder webdav = new ServletHolder(new SimpleWebdavServlet() {
>      @Override
>      public Repository getRepository() {
>          return jcrRepository;
>      }
> });
> webdav.setInitParameter(SimpleWebdavServlet.INIT_PARAM_RESOURCE_PATH_PREFIX
> , path + "/webdav");
> webdav.setInitParameter(AbstractWebdavServlet.INIT_PARAM_AUTHENTICATE_HEADE
> R, "Basic realm=\"Oak\"");
> context.addServlet(webdav, path + "/webdav/*");
>
>
> // 3 - JCR Remoting Server
> @SuppressWarnings("serial")
> ServletHolder jcrremote = new ServletHolder(new JcrRemotingServlet() {
>      @Override
>      protected Repository getRepository() {
>          return jcrRepository;
>      }
> });
> jcrremote.setInitParameter(JCRWebdavServerServlet.INIT_PARAM_RESOURCE_PATH_
> PREFIX, path + "/jcrremote");
> jcrremote.setInitParameter(AbstractWebdavServlet.INIT_PARAM_AUTHENTICATE_HE
> ADER, "Basic realm=\"Oak\"");
> context.addServlet(jcrremote, path + "/jcrremote/*");
>
>
>
> i am not the author of this code and never tried it out.
> it might well be, that something is missing.... could you
> try to set it up manually?
>
> alternatively you can report a jira issue with reproducible
> steps on what you do, what the expected outcome is and
> what doesn't work.
>
> kind regards
> angela
>
>
>
> On 17/11/15 09:40, "David Marginian" <da...@davidmarginian.com> wrote:
>
>> Hi Angela,
>> Jcr remoting should be fine as I believe that is what I am using now
>> with the older version of JackRabbit.
>>
>> On 11/17/2015 12:45 AM, Angela Schreiber wrote:
>>> hi david
>>>
>>> are you looking for real webdav support or for the jcr
>>> remoting which is partially done with webdav request methods?
>>>
>>> kind regards
>>> angela
>>>
>>> On 17/11/15 01:46, "David Marginian" <da...@davidmarginian.com> wrote:
>>>
>>>> I am new to both JackRabbit and Oak and trying to upgrade an existing
>>>> system to use Oak.  I want to access the repo via webdav and currently
>>>> I
>>>> obtain the repo by passing the URL into JcrUtils.getRepository.  I am
>>>> struggling to figure out how to do the same thing in Oak.  I am running
>>>> the Oak server via the jar:
>>>>
>>>> java -jar oak-run-1.2.7.jar server http://localhost:8452 Oak-Mongo --db
>>>> myOak --host localhost --port 8524
>>>>
>>>> this creates the myOak DB in Mongo and I can hit
>>>> http://localhost:8452/webdav/default via the browser.  But when I try
>>>> to
>>>> use JcrUtils.getRepository from my code I get:
>>>>
>>>> Caused by: javax.jcr.RepositoryException: Unable to access a repository
>>>> with the following settings:
>>>>       org.apache.jackrabbit.repository.uri:
>>>> http://localhost:8452/webdav/default
>>>> The following RepositoryFactory classes were consulted:
>>>>       org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory: declined
>>>>       org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory: declined
>>>>       org.apache.jackrabbit.oak.jcr.OakRepositoryFactory: declined
>>>>       org.apache.jackrabbit.commons.JndiRepositoryFactory: declined
>>>>
>>>> I realize I am using the old JackRabbit API but I am not sure how to do
>>>> this via Oak.  I am sure I am missing something basic, can someone help
>>>> me out, point me in the right direction?
>>>>
>>>> Thanks for your time
>


Re: New to Oak, help with webdav

Posted by Angela Schreiber <an...@adobe.com>.
hi david

hm.... but the link below (http://localhost:8452/webdav/default)
rather looks like default webdav.

as a general note i don't see any compelling reason why both
webdav and jcr-remoting should not work when replacing jackrabbit-core
repository by oak. the only thing that you probably have to do
is running the migration first.

looking at the code in oak-run that setups up the server it find
the following:

final Repository jcrRepository = jcr.createRepository();
@SuppressWarnings("serial")
ServletHolder webdav = new ServletHolder(new SimpleWebdavServlet() {
    @Override
    public Repository getRepository() {
        return jcrRepository;
    }
});
webdav.setInitParameter(SimpleWebdavServlet.INIT_PARAM_RESOURCE_PATH_PREFIX
, path + "/webdav");
webdav.setInitParameter(AbstractWebdavServlet.INIT_PARAM_AUTHENTICATE_HEADE
R, "Basic realm=\"Oak\"");
context.addServlet(webdav, path + "/webdav/*");


// 3 - JCR Remoting Server
@SuppressWarnings("serial")
ServletHolder jcrremote = new ServletHolder(new JcrRemotingServlet() {
    @Override
    protected Repository getRepository() {
        return jcrRepository;
    }
});
jcrremote.setInitParameter(JCRWebdavServerServlet.INIT_PARAM_RESOURCE_PATH_
PREFIX, path + "/jcrremote");
jcrremote.setInitParameter(AbstractWebdavServlet.INIT_PARAM_AUTHENTICATE_HE
ADER, "Basic realm=\"Oak\"");
context.addServlet(jcrremote, path + "/jcrremote/*");



i am not the author of this code and never tried it out.
it might well be, that something is missing.... could you
try to set it up manually?

alternatively you can report a jira issue with reproducible
steps on what you do, what the expected outcome is and
what doesn't work.

kind regards
angela



On 17/11/15 09:40, "David Marginian" <da...@davidmarginian.com> wrote:

>Hi Angela,
>Jcr remoting should be fine as I believe that is what I am using now
>with the older version of JackRabbit.
>
>On 11/17/2015 12:45 AM, Angela Schreiber wrote:
>> hi david
>>
>> are you looking for real webdav support or for the jcr
>> remoting which is partially done with webdav request methods?
>>
>> kind regards
>> angela
>>
>> On 17/11/15 01:46, "David Marginian" <da...@davidmarginian.com> wrote:
>>
>>> I am new to both JackRabbit and Oak and trying to upgrade an existing
>>> system to use Oak.  I want to access the repo via webdav and currently
>>>I
>>> obtain the repo by passing the URL into JcrUtils.getRepository.  I am
>>> struggling to figure out how to do the same thing in Oak.  I am running
>>> the Oak server via the jar:
>>>
>>> java -jar oak-run-1.2.7.jar server http://localhost:8452 Oak-Mongo --db
>>> myOak --host localhost --port 8524
>>>
>>> this creates the myOak DB in Mongo and I can hit
>>> http://localhost:8452/webdav/default via the browser.  But when I try
>>>to
>>> use JcrUtils.getRepository from my code I get:
>>>
>>> Caused by: javax.jcr.RepositoryException: Unable to access a repository
>>> with the following settings:
>>>      org.apache.jackrabbit.repository.uri:
>>> http://localhost:8452/webdav/default
>>> The following RepositoryFactory classes were consulted:
>>>      org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory: declined
>>>      org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory: declined
>>>      org.apache.jackrabbit.oak.jcr.OakRepositoryFactory: declined
>>>      org.apache.jackrabbit.commons.JndiRepositoryFactory: declined
>>>
>>> I realize I am using the old JackRabbit API but I am not sure how to do
>>> this via Oak.  I am sure I am missing something basic, can someone help
>>> me out, point me in the right direction?
>>>
>>> Thanks for your time
>>
>


Re: New to Oak, help with webdav

Posted by David Marginian <da...@davidmarginian.com>.
Hi Angela,
Jcr remoting should be fine as I believe that is what I am using now 
with the older version of JackRabbit.

On 11/17/2015 12:45 AM, Angela Schreiber wrote:
> hi david
>
> are you looking for real webdav support or for the jcr
> remoting which is partially done with webdav request methods?
>
> kind regards
> angela
>
> On 17/11/15 01:46, "David Marginian" <da...@davidmarginian.com> wrote:
>
>> I am new to both JackRabbit and Oak and trying to upgrade an existing
>> system to use Oak.  I want to access the repo via webdav and currently I
>> obtain the repo by passing the URL into JcrUtils.getRepository.  I am
>> struggling to figure out how to do the same thing in Oak.  I am running
>> the Oak server via the jar:
>>
>> java -jar oak-run-1.2.7.jar server http://localhost:8452 Oak-Mongo --db
>> myOak --host localhost --port 8524
>>
>> this creates the myOak DB in Mongo and I can hit
>> http://localhost:8452/webdav/default via the browser.  But when I try to
>> use JcrUtils.getRepository from my code I get:
>>
>> Caused by: javax.jcr.RepositoryException: Unable to access a repository
>> with the following settings:
>>      org.apache.jackrabbit.repository.uri:
>> http://localhost:8452/webdav/default
>> The following RepositoryFactory classes were consulted:
>>      org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory: declined
>>      org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory: declined
>>      org.apache.jackrabbit.oak.jcr.OakRepositoryFactory: declined
>>      org.apache.jackrabbit.commons.JndiRepositoryFactory: declined
>>
>> I realize I am using the old JackRabbit API but I am not sure how to do
>> this via Oak.  I am sure I am missing something basic, can someone help
>> me out, point me in the right direction?
>>
>> Thanks for your time
>


Re: New to Oak, help with webdav

Posted by Angela Schreiber <an...@adobe.com>.
hi david

are you looking for real webdav support or for the jcr
remoting which is partially done with webdav request methods?

kind regards
angela

On 17/11/15 01:46, "David Marginian" <da...@davidmarginian.com> wrote:

>I am new to both JackRabbit and Oak and trying to upgrade an existing
>system to use Oak.  I want to access the repo via webdav and currently I
>obtain the repo by passing the URL into JcrUtils.getRepository.  I am
>struggling to figure out how to do the same thing in Oak.  I am running
>the Oak server via the jar:
>
>java -jar oak-run-1.2.7.jar server http://localhost:8452 Oak-Mongo --db
>myOak --host localhost --port 8524
>
>this creates the myOak DB in Mongo and I can hit
>http://localhost:8452/webdav/default via the browser.  But when I try to
>use JcrUtils.getRepository from my code I get:
>
>Caused by: javax.jcr.RepositoryException: Unable to access a repository
>with the following settings:
>     org.apache.jackrabbit.repository.uri:
>http://localhost:8452/webdav/default
>The following RepositoryFactory classes were consulted:
>     org.apache.jackrabbit.jcr2dav.Jcr2davRepositoryFactory: declined
>     org.apache.jackrabbit.jcr2spi.Jcr2spiRepositoryFactory: declined
>     org.apache.jackrabbit.oak.jcr.OakRepositoryFactory: declined
>     org.apache.jackrabbit.commons.JndiRepositoryFactory: declined
>
>I realize I am using the old JackRabbit API but I am not sure how to do
>this via Oak.  I am sure I am missing something basic, can someone help
>me out, point me in the right direction?
>
>Thanks for your time