[Grok-dev] multiple grok wsgi applications possible?

Michael Haubenwallner michael at d2m.at
Wed Dec 17 06:57:18 EST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Uli Fouquet wrote:
> Michael Haubenwallner wrote:
>> Lim Luong came up with this problem recently.
>>
>> The setup is like: create several grok applications, each with its own
>> storage, configure them with pastescript to run as distinct wsgi apps
>> from a paste http server (using paste urlmap to dispatch the requests).
>> The admin screens work, access and writing to the different storages
>> works too.
>>
>> The only problem is, that none but the last registered grok.Application
>> is available from the 'applications' view (same for each of the wsgi
>> apps). Trying to add one of the missing grok.Applications through the
>> URL results in a ComponentLookupError.
>>
>> I am not sure if this is a problem of grok.adminui or something else.
> 
> The admin UI looks up available apps like this::
> 
>   zope.component.getAllUtilitiesRegisteredFor(
>             grok.interfaces.IApplication)
> 
> Therefore only application types are found, that are registered in the
> 'local' registry, which in fact is silently assumed to be the global one
> (and it should be in the regular 'zopectl' case).
> 

You name it: with each new wsgi application created appsetup.config()
registers and executes the zcml and overwrites any existing global
registry. That is, only the registry created last exists for all grok
wsgi instances. This is not a problem of Grok anymore, it should be
solved at zope.app.wsgi or zope.app.appsetup.

For now, we can only advice people to not use more than one grok wsgi
instance and dispatch to different grok.Applications within it.

Regards
Michael

- --
http://blog.d2m.at
http://planetzope.org

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJSOkel0uAvQJUKVYRAopzAKCW0563o9/N2LhmyCXkEcHHWMp/AACfd4fz
T4AFmvpjAoInYVSngPEEQ7E=
=bN2t
-----END PGP SIGNATURE-----



More information about the Grok-dev mailing list