NOTE: This article is 3 years or older so its information may no longer be relevant. Read on at your own discretion! Comments for this article have automatically been locked, refer to the FAQ
for more details.
implementation is great to use if you don't want to run a Jackrabbit
server, however one of the difficulties for a first-time user is having to go through the bootstrapping
process and initialising the repository. After a bit of poking around the command line utility
code that comes with Jackalope
I put together this class that detects if the repository hasn't been initialised and does the initialisation automatically for you. It also wraps the session so you're guaranteed a valid repository with an open session when you use this.
You still need to create the database yourself before using this class.
This is the SessionWrapper
...to use it do something like this...
The code for the SessionWrapper
class is quite boiler plate Jackalope
code. The repository initialisation happens on lines 33-39
. There is some error handling thrown in and that's about it. No need to mess around with manual repository initialisation!
A quick disclaimer...
Although I put in a great effort into researching all the topics I cover, mistakes can happen.
If you spot something out of place, please do let me know.
All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle).
Use of any information contained in this blog post/article is subject to this disclaimer
Other posts you may like...