jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Malzer Ferdinand OSP sIT <Ferdinand.Mal...@s-itsolutions.at>
Subject AW: AW: How to create users using jackrabbit?
Date Thu, 06 Mar 2014 08:09:47 GMT
We us a non-transient repository and use the following code to get create/access the repository:

            RepositoryConfig config = RepositoryConfig.install(new File(path));
            Repository repository = RepositoryImpl.create(config);

The path variable points to the directory where the repository.xml is stored.


-----Ursprüngliche Nachricht-----
Von: AshokBS [mailto:asiddaiah@altimetrik.com] 
Gesendet: Mittwoch, 05. März 2014 07:08
An: users@jackrabbit.apache.org
Betreff: Re: AW: How to create users using jackrabbit? [phishing][bayes][heur]
Wichtigkeit: Niedrig

Hi Malzer,

Thanks for your response. I have seen some differences while doing this
activity of creating users.

Scenario1: I try to use TransientRepository and then login with admin
credentials and go ahead to create users, it is working fine. But the fact
is i am unable to login to the repository URL say something like:

The code was something like this to create testuser:
Repository repository = new TransientRepository();
Session session = repository.login(new SimpleCredentials("admin",

final UserManager userManager = ((JackrabbitSession)
final User user2 = userManager.createUser("testuser", "testuser");

Why iam unable to login with testuser to the above URL? I mean where have we
mapping testuser to the above URL in this code.

Scenario2: I try to use JCRUtils API to get repository which is running and
try to login say something like this:
Repository repository =
Session session = repository.login(new SimpleCredentials("admin",
 UserManager um = ((JackrabbitSession) session).getUserManager();
User user = um.createUser("testuser", "testuser"); 

The above one will not allow me to create users as said earlier and give the
exception as: java.lang.ClassCastException:
org.apache.jackrabbit.jcr2spi.SessionImpl cannot be cast to

Why is this happening? My queston is from scenario 1: where does the users
data reside and how to login to web browser to URL? Is it not possible to
use those created users for login?

View this message in context: http://jackrabbit.510166.n4.nabble.com/How-to-create-users-using-jackrabbit-tp4660409p4660417.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

View raw message