You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Zahra Ayed <za...@progineer.net> on 2022/10/06 12:52:27 UTC

Jackrabbit as a client for an Apache server

Hello

i want to ask if i can use Jackrabbit on client side using Java Maven to
communicate with an Apache server (Apache Module mod_dav)
[image: image.png]

If so, what are the components needed for this and if you can provide me
with a simple code that does the trick I would be very grateful.

I tried to establish a connection using this code :

1.  Repository repository = JcrUtils.getRepository("my url");

2.  Session session = repository.login(

3.  new SimpleCredentials("my username", "my Password".toCharArray()));



 but i get this Error :

Login failed: Unknown workspace 'null'.: javax.jcr.LoginException: Login
failed: Unknown workspace 'null'.

What should I do?
*Zahra Abu Zahra                *
*Software Developer        *
*CGC Building,7th Floor,Al Bireh,Ramallah*

Re: Jackrabbit as a client for an Apache server

Posted by Zahra Ayed <za...@progineer.net>.
Hi Konrad,
Thank you so much for the quick response. It's weird cuz while I was trying
to get help I found that you were one of the top contributors in the
Jackrabbit project on github(very impressive BTW) tried to contact you but
couldn't find any contact info on your Github account, what a great
coincidence!!!😊

Appreciated
*Zahra Abu Zahra                *
*Software Developer        *
*CGC Building,7th Floor,Al Bireh,Ramallah*



On Thu, Oct 6, 2022 at 4:15 PM Konrad Windszus <kw...@apache.org> wrote:

> Hi Zahra,
> You only need
> https://jackrabbit.apache.org/jcr/components/jackrabbit-webdav-library.html
> which is available from
> https://github.com/apache/jackrabbit/tree/trunk/jackrabbit-webdav.
> It is a small layer on top of Apache HttpComponents HttpClient 4.5 (
> https://hc.apache.org/httpcomponents-client-4.5.x/index.html) and
> provides WebDAV methods in
> https://github.com/apache/jackrabbit/tree/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods
> .
> To establish a connection just use the approach outlined at
> https://github.com/apache/httpcomponents-client/blob/4.5.x/httpclient/src/examples/org/apache/http/examples/client/ClientWithResponseHandler.java
> but instead of HttpGet use one of the method classes mentioned above.
> Hope this helps,
> Konrad
>
>
>
> > On 6. Oct 2022, at 14:52, Zahra Ayed <za...@progineer.net> wrote:
> >
> > Hello
> > i want to ask if i can use Jackrabbit on client side using Java Maven to
> communicate with an Apache server (Apache Module mod_dav)
> >
> > If so, what are the components needed for this and if you can provide me
> with a simple code that does the trick I would be very grateful.
> > I tried to establish a connection using this code :
> > 1.  Repository repository = JcrUtils.getRepository("my url");
> >
> > 2.  Session session = repository.login(
> >
> > 3.  new SimpleCredentials("my username", "my Password".toCharArray()));
> >
> >
> >  but i get this Error :
> > Login failed: Unknown workspace 'null'.: javax.jcr.LoginException: Login
> failed: Unknown workspace 'null'.
> > What should I do?
> > Zahra Abu Zahra
> > Software Developer
> >
> >
> > CGC Building,7th Floor,Al Bireh,Ramallah
> >
>
>

Re: Jackrabbit as a client for an Apache server

Posted by Konrad Windszus <kw...@apache.org>.
Hi Zahra,
You only need https://jackrabbit.apache.org/jcr/components/jackrabbit-webdav-library.html which is available from https://github.com/apache/jackrabbit/tree/trunk/jackrabbit-webdav.
It is a small layer on top of Apache HttpComponents HttpClient 4.5 (https://hc.apache.org/httpcomponents-client-4.5.x/index.html) and provides WebDAV methods in https://github.com/apache/jackrabbit/tree/trunk/jackrabbit-webdav/src/main/java/org/apache/jackrabbit/webdav/client/methods.
To establish a connection just use the approach outlined at https://github.com/apache/httpcomponents-client/blob/4.5.x/httpclient/src/examples/org/apache/http/examples/client/ClientWithResponseHandler.java but instead of HttpGet use one of the method classes mentioned above.
Hope this helps,
Konrad



> On 6. Oct 2022, at 14:52, Zahra Ayed <za...@progineer.net> wrote:
> 
> Hello 
> i want to ask if i can use Jackrabbit on client side using Java Maven to communicate with an Apache server (Apache Module mod_dav) 
> 
> If so, what are the components needed for this and if you can provide me with a simple code that does the trick I would be very grateful.
> I tried to establish a connection using this code :
> 1.  Repository repository = JcrUtils.getRepository("my url");
> 
> 2.  Session session = repository.login(
> 
> 3.  new SimpleCredentials("my username", "my Password".toCharArray()));
> 
>  
>  but i get this Error :
> Login failed: Unknown workspace 'null'.: javax.jcr.LoginException: Login failed: Unknown workspace 'null'.
> What should I do?
> Zahra Abu Zahra                
> Software Developer    
>    
>  
> CGC Building,7th Floor,Al Bireh,Ramallah
>