You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Jeorjos Valotasios <va...@gloman.gr> on 2008/01/21 11:39:52 UTC

Help with javax.jcr.AccessDeniedException

Hi all,
I'm new to jackrabbit and tried to make a simple repository witch would use
an MSSQL db for its Perisistence Manager. I've edited the
repository.xmlfile to my needs and tried to run a modified secondHop
from the examples.

The code looks like this:

Session session = repository.login();
Node root = session.getRootNode();
Node n = root.addNode("myNewTestNode", "nt:unstructured");
n.setProperty("message", "hello there -- " + System.currentTimeMillis());
session.save();

Now when I run the code above I get a  javax.jcr.AccessDeniedException: with
message: /: not allowed to modify item

What am I doing wrong here?

Thanks in advance!

-- 
Valotassios Jeoryos

GLOMAN S.A.
2 Papada str,
Athens, GR 115 25

T: +30 210 6985700
E: valotas@gloman.gr

Re: Help with javax.jcr.AccessDeniedException

Posted by Stefan Guggisberg <st...@gmail.com>.
hi,

On Jan 21, 2008 11:39 AM, Jeorjos Valotasios <va...@gloman.gr> wrote:
> Hi all,
> I'm new to jackrabbit and tried to make a simple repository witch would use
> an MSSQL db for its Perisistence Manager. I've edited the
> repository.xmlfile to my needs and tried to run a modified secondHop
> from the examples.
>
> The code looks like this:
>
> Session session = repository.login();

login() performs an anonymous login. the anonymous 'user' has read-only
permissions.

try e.g.

Session session = repository.login(new SimpleCredentials("johndoe",
"password".toCharArray());

in fact, any username/password combination will do.

jackrabbit's default JAAS LoginModule (SimpleLoginModule) is just a dummy
implementation which only distinguishes between anonymous/non-anonymous
login's. any non-anonymous login has full read/write permissions.

cheers
stefan

> Node root = session.getRootNode();
> Node n = root.addNode("myNewTestNode", "nt:unstructured");
> n.setProperty("message", "hello there -- " + System.currentTimeMillis());
> session.save();
>
> Now when I run the code above I get a  javax.jcr.AccessDeniedException: with
> message: /: not allowed to modify item
>
> What am I doing wrong here?
>
> Thanks in advance!
>
> --
> Valotassios Jeoryos
>
> GLOMAN S.A.
> 2 Papada str,
> Athens, GR 115 25
>
> T: +30 210 6985700
> E: valotas@gloman.gr
>