Thanks.
IMHO, guest and anonymous user are the same (in terms of privileges).
My solution is to use admin id,
SimpleCredentials adminCred = new
SimpleCredentials("admin", new char[0]);
repoSession = repository.login(adminCred);
Access control is done in higher level.
Gerald
On Tue, Dec 15, 2009 at 3:44 AM, Sébastien Launay
<[email protected]> wrote:
> Hi Guo,
>
> 2009/12/15 Guo Zhenhua <[email protected]>:
>> I want to register new node types and add new nodes into jackrabbit
>> repository. I use the default credential.
>>
>> I got following exception:
>> javax.jcr.AccessDeniedException: Access denied
>> at
>> org.apache.jackrabbit.core.security.simple.SimpleAccessManager.checkPermission(SimpleAccessManager.java:138)
>> ...
>
> You must use different credentials in order to not be logged as anonymous
> or you can change the repository.xml configuration to change the anonymous
> id to another login like 'guest' for example:
> <LoginModule class="org.apache.jackrabbit.core.security.SimpleLoginModule">
> <!-- anonymous user name ('anonymous' is the default value) -->
> <param name="anonymousId" value="guest"/>
> </LoginModule>
>
> Only the user name is used by default (i.e. the password is not checked, you
> can use an empty string).
>
> --
> Sébastien Launay
>