<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="sans-serif">Hi,<br>
<br>
I'm getting a ComponentLookupError when getUtility() is called in
the following function:<br>
<br>
@grok.subscribe(Helpdesk, grok.IApplicationInitializedEvent)<br>
def setUpTestUsers(obj, event):<br>
authPlugin = getUtility(IAuthenticatorPlugin, "users")<br>
<br>
According to Grok documentation [1]:<br>
<br>
"</font>This event can be used to trigger the creation of contents
or other tasks
that require the application to be fully operational : utilities
installed
and indexes created in the catalog."<br>
<br>
<font face="sans-serif"> I understand utilities should be ready. </font>In
fact, I have a print statement in the utility's __init__() which is
executed before getUtility() fails. I've also checked the
getUtility() call in the function is the same that is used in other
places and working just fine.<br>
<br>
Any idea why this fails?<br>
<br>
[1]
<a class="moz-txt-link-freetext" href="http://grok.zope.org/doc/current/reference/events.html#iapplicationinitializedevent">http://grok.zope.org/doc/current/reference/events.html#iapplicationinitializedevent</a><br>
<br>
Thanks,<br>
Àlex<br>
</body>
</html>