Hello,
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.
regard
-----Ursprüngliche Nachricht-----
Von: AshokBS [mailto:[email protected]]
Gesendet: Mittwoch, 05. März 2014 07:08
An: [email protected]
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:
http://localhost:9090/repository/default/
The code was something like this to create testuser:
Repository repository = new TransientRepository();
Session session = repository.login(new SimpleCredentials("admin",
"admin".toCharArray()));
final UserManager userManager = ((JackrabbitSession)
session).getUserManager();
final User user2 = userManager.createUser("testuser", "testuser");
session.save();
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 =
JcrUtils.getRepository("http://localhost:9090/server");
Session session = repository.login(new SimpleCredentials("admin",
"admin".toCharArray()));
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
org.apache.jackrabbit.api.JackrabbitSession
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.