Thank yoy for the suggestion. I'm currently using programmatic
construction, like this.

SegmentStore segmentStore = new FileStore(new File(oakRepositoryPath), 256);
NodeStore nodeStore = new SegmentNodeStore(segmentStore);
setupIndexes(nodeStore);
Oak oak = new Oak(nodeStore);
oakRepository = new Jcr(oak)
  .with(new NameValidatorProvider())
  .with(new PropertyIndexProvider())
  .createRepository();

If I reload the webapp though, it seems the repository doesn't shut
down. I get an exception:

java.nio.channels.OverlappingFileLockException
at sun.nio.ch.SharedFileLockTable.checkList(FileLockTable.java:255)
at sun.nio.ch.SharedFileLockTable.add(FileLockTable.java:152)
at sun.nio.ch.FileChannelImpl.lock(FileChannelImpl.java:1030)
at java.nio.channels.FileChannel.lock(FileChannel.java:1053)
at 
org.apache.jackrabbit.oak.plugins.segment.file.FileStore.<init>(FileStore.java:180)

Another observation, i tried running my converted repository with
oak-run, and forgot it was running when I started my webapp. Instead
of either saying the repository was in use or providing an exception
similar to the one above, the constructor for the FileStore just hung.


On 14 July 2014 08:25, Chetan Mehrotra <[email protected]> wrote:
> Hi Torgeir,
>
> There are two approaches one can take
>
> 1. oak-pojorsr - Oak PojoSR [1] module provides a factory to use the
> built in OSGi support via PojoSR module without requiring the
> application to be deployed to OSGi container
>
> 2. Programatic Construction - Have a look at various
> testcases/fixtures [2] or docs [3] for programatically constructing
> Oak instance
>
> Chetan Mehrotra
> [1] https://github.com/apache/jackrabbit-oak/tree/trunk/oak-pojosr
> [2] 
> https://github.com/apache/jackrabbit-oak/blob/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/fixture/OakFixture.java#L378
> [3] http://jackrabbit.apache.org/oak/docs/construct.html
>
> On Sun, Jul 13, 2014 at 4:39 PM, Torgeir Veimo <[email protected]> 
> wrote:
>> I'm trying to instantiate an oak repository without any OSGi
>> environment. It looks like OakRepositoryFactory ignores any parameters
>> passed to it, just calling the empty Jcr() constructor, which results
>> in an in-memory repository.
>>
>> Are there any examples on how to configure eg a tarmk repository
>> outside of an OSGi environment?
>>
>> --
>> -Tor



-- 
-Tor

Reply via email to