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 PeriS <pv...@indiana.edu> on 2013/06/10 20:00:54 UTC
Initialize Oak CR
I m trying the following;
Oak oak = new Oak();
ContentRepository repository = oak.createContentRepository();
I understand this should give me a default CR with the MKs initialized. I m encountering a null-pointer exception in the Oak.java class particluarly in the createContentRepositry() method;
// FIXME: OAK-810 move to proper workspace initialization
// initialize default workspace
Iterable<WorkspaceInitializer> workspaceInitializers =
Iterables.transform(securityProvider.getSecurityConfigurations(),
new Function<SecurityConfiguration, WorkspaceInitializer>() {
@Override
public WorkspaceInitializer apply(SecurityConfiguration sc) {
return sc.getWorkspaceInitializer();
}
});
The securityProvider is null and I was wondering if I missed anything during initialization. Also, it doesn't appear as if it needs a repository.xml (2.x where if one existed it got used and if it didn't, then a new default one got created).
Any ideas?
-Peri.S
Re: Initialize Oak CR
Posted by Alex Parvulescu <al...@gmail.com>.
Hi,
you can always take a look at the tests, see how we bootstrap a repository,
that should get you going in the right direction. [0], [1]
[0]
http://svn.apache.org/repos/asf/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/AbstractRepositoryTest.java
[1]
http://svn.apache.org/repos/asf/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/RepositoryTest.java
On Wed, Jun 12, 2013 at 4:50 PM, PeriS <pv...@indiana.edu> wrote:
> Any help please? Is it somewhere else I should be looking for replies?
>
> On Jun 10, 2013, at 2:00 PM, PeriS <pv...@indiana.edu> wrote:
>
> > I m trying the following;
> >
> > Oak oak = new Oak();
> > ContentRepository repository = oak.createContentRepository();
> >
> > I understand this should give me a default CR with the MKs initialized.
> I m encountering a null-pointer exception in the Oak.java class
> particluarly in the createContentRepositry() method;
> >
> >
> > // FIXME: OAK-810 move to proper workspace initialization
> > // initialize default workspace
> > Iterable<WorkspaceInitializer> workspaceInitializers =
> >
> Iterables.transform(securityProvider.getSecurityConfigurations(),
> > new Function<SecurityConfiguration,
> WorkspaceInitializer>() {
> > @Override
> > public WorkspaceInitializer
> apply(SecurityConfiguration sc) {
> > return sc.getWorkspaceInitializer();
> > }
> > });
> >
> > The securityProvider is null and I was wondering if I missed anything
> during initialization. Also, it doesn't appear as if it needs a
> repository.xml (2.x where if one existed it got used and if it didn't, then
> a new default one got created).
> >
> > Any ideas?
> >
> > -Peri.S
> >
> >
>
>
>
>
Re: Initialize Oak CR
Posted by PeriS <pv...@indiana.edu>.
Any help please? Is it somewhere else I should be looking for replies?
On Jun 10, 2013, at 2:00 PM, PeriS <pv...@indiana.edu> wrote:
> I m trying the following;
>
> Oak oak = new Oak();
> ContentRepository repository = oak.createContentRepository();
>
> I understand this should give me a default CR with the MKs initialized. I m encountering a null-pointer exception in the Oak.java class particluarly in the createContentRepositry() method;
>
>
> // FIXME: OAK-810 move to proper workspace initialization
> // initialize default workspace
> Iterable<WorkspaceInitializer> workspaceInitializers =
> Iterables.transform(securityProvider.getSecurityConfigurations(),
> new Function<SecurityConfiguration, WorkspaceInitializer>() {
> @Override
> public WorkspaceInitializer apply(SecurityConfiguration sc) {
> return sc.getWorkspaceInitializer();
> }
> });
>
> The securityProvider is null and I was wondering if I missed anything during initialization. Also, it doesn't appear as if it needs a repository.xml (2.x where if one existed it got used and if it didn't, then a new default one got created).
>
> Any ideas?
>
> -Peri.S
>
>
Re: Initialize Oak CR
Posted by Michael Dürig <md...@apache.org>.
Hi Peri,
You need to pass a security provider instance using one of the .with
methods before calling createContentRepository(). Security configuration
is still pretty much work in progress.
Also you don't need a repository.xml. This is a thing of JR2.
Michael
On 10.6.13 19:00, PeriS wrote:
> I m trying the following;
>
> Oak oak = new Oak();
> ContentRepository repository = oak.createContentRepository();
>
> I understand this should give me a default CR with the MKs initialized. I m encountering a null-pointer exception in the Oak.java class particluarly in the createContentRepositry() method;
>
>
> // FIXME: OAK-810 move to proper workspace initialization
> // initialize default workspace
> Iterable<WorkspaceInitializer> workspaceInitializers =
> Iterables.transform(securityProvider.getSecurityConfigurations(),
> new Function<SecurityConfiguration, WorkspaceInitializer>() {
> @Override
> public WorkspaceInitializer apply(SecurityConfiguration sc) {
> return sc.getWorkspaceInitializer();
> }
> });
>
> The securityProvider is null and I was wondering if I missed anything during initialization. Also, it doesn't appear as if it needs a repository.xml (2.x where if one existed it got used and if it didn't, then a new default one got created).
>
> Any ideas?
>
> -Peri.S
>
>
>
>