[daisy] Get RepositoryManager from ServiceManager fails

Kevin hellosticky at gmail.com
Wed Aug 1 10:09:41 CDT 2007


Hi,

I am implementing a custom AuthenticationScheme, and I'm trying to get
access to the UserManager in the check() method. To get this, I'm
trying to get the Repository class, from which I can get the
UserManager.

There is plenty of code in daisy which does:

RepositoryManager repositoryManager =
(RepositoryManager)serviceManager.lookup("daisy-repository-manager");

I have the ServiceManager from when my AuthenticationScheme gets
registered, so I call the following code:

RepositoryManager repositoryManager = null;
Repository result = null;
try {
	repositoryManager = (RepositoryManager)
serviceManager.lookup("daisy-repository-manager");
	result = repositoryManager.getRepository(new Credentials("registrar",
"defaultpwd"));


However, this gives the following exception:

org.apache.avalon.framework.service.ServiceException: Unknown key:
daisy-repository-manager (Key='daisy-repository-manager')
org.apache.avalon.activation.impl.DefaultServiceManager.lookup(DefaultServiceManager.java:150)
org.apache.avalon.activation.impl.DefaultServiceManager.lookup(DefaultServiceManager.java:129)

At first, this getting called at startup, since I was trying to get
the repository earlier, but now I moved it to the check method which
only finally gets called when a user tries to log in, and it still
doesn't work.

Does it have something to do with the fact that this is the
"DefaultServiceManager?"

All I need is the UserManager (I know I have it in the createUser
method, but I don't need it then), so if there is another way, please
let me know.

Thanks!
Kevin


More information about the daisy mailing list