You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Mario Cartia <ma...@gmail.com> on 2015/11/06 09:35:32 UTC

How to connect to OAK standalone server

Hi,
I'm trying to migrate a repository from Jackrabbit 2 to OAK. I used to
connect to my Jackrabbit 2 remote repository using
JcrUtils.getRepository(url). Now I'm able to run standalone OAK server
using:
$ java -jar oak-run-1.2.7.jar server http://localhost:3333 Oak-Mongo --db
oak
Apache Jackrabbit Oak 1.2.7
Starting Oak-Mongo repository -> http://localhost:3333
...

but isn't clear for me how to connect from my application.

Can you help me?

Regards,
MC

Re: How to connect to OAK standalone server

Posted by Clay Ferguson <wc...@gmail.com>.
If you're wanting your java code to connect to remove JCR servers, and use
the JCR API (not the Java API, but a very similar API) then Sling is almost
certainly what you want:

http://sling.apache.org/

In my meta64.com I wanted to talk directly to repositories via the Java
API, but some day I may add an abstraction layer to my JCR interfacing and
does the remoting via Sling REST, so that I can make JAVA calls that end up
getting automatically marshalled to/from the JSON of Sling.


Best regards,
Clay Ferguson
wclayf@gmail.com


On Sat, Oct 22, 2016 at 7:54 AM, mathiasconradt <ma...@gmail.com>
wrote:

> Mario, did you get it to work the way you wanted? I actually have the same
> question and posted it to
> http://stackoverflow.com/questions/40191705/jackrabbit-
> oak-getting-started-and-connect-to-a-standalone-repository-via-java.
>
> Craig, I took a look at your meta64 project, but from what I see there, the
> repository is created within your same application, so it's not connecting
> to a standalone (remote) server, right?
>
> OakRepository.java, line 234:
> repository = jcr.createRepository();
>
> Still wondering how to connect to a standalone Oak server that is not in
> the
> same servlet container and/or app.
>
>
>
> --
> View this message in context: http://jackrabbit.510166.n4.
> nabble.com/How-to-connect-to-OAK-standalone-server-tp4663274p4665169.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>

Re: How to connect to OAK standalone server

Posted by Clay Ferguson <wc...@gmail.com>.
Ok Mathias,
There's also one other thing I didn't think of (and haven't tried myself)
which is that the MongoDB that is actually backing the DB could itself be
remote, and then JCR instance can still talk to it (i think), so that would
be interesting to see if that performs well at all or where the bottlenecks
are if it doesn't. Also worth mentioning is that in meta64's approach the
Spring REST controller (which is actually more of an RMI over JSON approach
than a 'true REST') is a very easy service to be called either by Browsers
--OR-- by other servers doing use plain JSON POSTS. I have that one class
called

Best regards,
Clay Ferguson
wclayf@gmail.com


On Sun, Oct 23, 2016 at 9:48 AM, mathiasconradt <ma...@gmail.com>
wrote:

> Hi Clay,
>
> thanks for the link on StackOverflow. I came across this already, but the
> JcrUtils.getRepository(url) method only seems to work for JackRabbit2, not
> for Oak. At least in my tests. Thanks for pointing me to Sling.
>
> For the moment, I think I will also use the same approach as you with
> meta64
> and embed Oak directly into the app and use the Java API. It thought about
> it today and it actually makes more sense for what I want to do as well.
>
> - Mathias
>
>
>
> --
> View this message in context: http://jackrabbit.510166.n4.
> nabble.com/How-to-connect-to-OAK-standalone-server-tp4663274p4665175.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>

Re: How to connect to OAK standalone server

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

thanks for the link on StackOverflow. I came across this already, but the
JcrUtils.getRepository(url) method only seems to work for JackRabbit2, not
for Oak. At least in my tests. Thanks for pointing me to Sling.

For the moment, I think I will also use the same approach as you with meta64
and embed Oak directly into the app and use the Java API. It thought about
it today and it actually makes more sense for what I want to do as well.

- Mathias



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/How-to-connect-to-OAK-standalone-server-tp4663274p4665175.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: How to connect to OAK standalone server

Posted by Clay Ferguson <wc...@gmail.com>.
Well in my last email i hadn't researched it. I'd never tried to connect to
remote servers before, but google this "JCR connect to remote server". Your
keyword is "remote" not "standalone" to find the info. Turns out there's
some kind of RMI support I wasn't aware of. Here's one link....

http://stackoverflow.com/questions/5857212/how-to-access-remote-jackrabbit-repository

So maybe someone can provide the pros/cons to comparing RMI with Java to
REST/JSON.


Best regards,
Clay Ferguson
wclayf@gmail.com


On Sat, Oct 22, 2016 at 7:54 AM, mathiasconradt <ma...@gmail.com>
wrote:

> Mario, did you get it to work the way you wanted? I actually have the same
> question and posted it to
> http://stackoverflow.com/questions/40191705/jackrabbit-
> oak-getting-started-and-connect-to-a-standalone-repository-via-java.
>
> Craig, I took a look at your meta64 project, but from what I see there, the
> repository is created within your same application, so it's not connecting
> to a standalone (remote) server, right?
>
> OakRepository.java, line 234:
> repository = jcr.createRepository();
>
> Still wondering how to connect to a standalone Oak server that is not in
> the
> same servlet container and/or app.
>
>
>
> --
> View this message in context: http://jackrabbit.510166.n4.
> nabble.com/How-to-connect-to-OAK-standalone-server-tp4663274p4665169.html
> Sent from the Jackrabbit - Users mailing list archive at Nabble.com.
>

Re: How to connect to OAK standalone server

Posted by mathiasconradt <ma...@gmail.com>.
Mario, did you get it to work the way you wanted? I actually have the same
question and posted it to
http://stackoverflow.com/questions/40191705/jackrabbit-oak-getting-started-and-connect-to-a-standalone-repository-via-java.

Craig, I took a look at your meta64 project, but from what I see there, the
repository is created within your same application, so it's not connecting
to a standalone (remote) server, right?

OakRepository.java, line 234:
repository = jcr.createRepository();

Still wondering how to connect to a standalone Oak server that is not in the
same servlet container and/or app.



--
View this message in context: http://jackrabbit.510166.n4.nabble.com/How-to-connect-to-OAK-standalone-server-tp4663274p4665169.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Re: How to connect to OAK standalone server

Posted by Mario Cartia <ma...@gmail.com>.
thank you a lot!

Mario Cartia

2015-11-06 17:11 GMT+01:00 Clay Ferguson <wc...@gmail.com>:

> I have a server that uses Oak you can look at for ideas, or see an example.
> I may not be doing things the way you want, but it's the best I've been
> able to put together, and it does work ok. search for "meta64" on github.
>
> Best regards,
> Clay Ferguson
> wclayf@gmail.com
>
>
> On Fri, Nov 6, 2015 at 2:35 AM, Mario Cartia <ma...@gmail.com>
> wrote:
>
> > Hi,
> > I'm trying to migrate a repository from Jackrabbit 2 to OAK. I used to
> > connect to my Jackrabbit 2 remote repository using
> > JcrUtils.getRepository(url). Now I'm able to run standalone OAK server
> > using:
> > $ java -jar oak-run-1.2.7.jar server http://localhost:3333 Oak-Mongo
> --db
> > oak
> > Apache Jackrabbit Oak 1.2.7
> > Starting Oak-Mongo repository -> http://localhost:3333
> > ...
> >
> > but isn't clear for me how to connect from my application.
> >
> > Can you help me?
> >
> > Regards,
> > MC
> >
>

Re: How to connect to OAK standalone server

Posted by Clay Ferguson <wc...@gmail.com>.
I have a server that uses Oak you can look at for ideas, or see an example.
I may not be doing things the way you want, but it's the best I've been
able to put together, and it does work ok. search for "meta64" on github.

Best regards,
Clay Ferguson
wclayf@gmail.com


On Fri, Nov 6, 2015 at 2:35 AM, Mario Cartia <ma...@gmail.com> wrote:

> Hi,
> I'm trying to migrate a repository from Jackrabbit 2 to OAK. I used to
> connect to my Jackrabbit 2 remote repository using
> JcrUtils.getRepository(url). Now I'm able to run standalone OAK server
> using:
> $ java -jar oak-run-1.2.7.jar server http://localhost:3333 Oak-Mongo --db
> oak
> Apache Jackrabbit Oak 1.2.7
> Starting Oak-Mongo repository -> http://localhost:3333
> ...
>
> but isn't clear for me how to connect from my application.
>
> Can you help me?
>
> Regards,
> MC
>