[Zope] z3c.zalchemy : ComponentLookupError: (<InterfaceClass
z3c.zalchemy.interfaces.IAlchemyEngineUtility>, 'DemoEngine-1')
KLEIN Stephane
stephane at harobed.org
Sat Feb 16 13:33:52 EST 2008
Hi,
I've tested z3c.zalchemy package and I've this error :
"""
ComponentLookupError: (<InterfaceClass
z3c.zalchemy.interfaces.IAlchemyEngineUtility>, 'DemoEngine-1')
"""
This is the different step I've did :
1. I've installed a fresh python environment with virtuelenv
2. I've installed zopeproject package (in this new python environment)
3. I've created new zope project with bin/zopeprojet zalchemytest
4. zope3 had installed with success
5. I've added z3c.zalchemy in install_requires in setup.py
6. I've restarted buildout
7. z3c.zalchemy version 0.2.1 had downloaded and installed
8. In src/zalchemytest/configure.zcml I've added this lines :
<include package="z3c.zalchemy" />
<include package="z3c.zalchemy" file="meta.zcml" />
<include package="z3c.zalchemy.demo.demo_1" />
9. When I've started bin/zalchemytest-debug I've this error :
"""
[snip]
File "/home/harobed/Experimentations/zalchemy/buildout-eggs/
zope.component-3.4.0-py2.4.egg/zope/component/_api.py", line 207, in
getUtility
raise ComponentLookupError(interface, name)
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/home/
harobed/Experimentations/zalchemy/zalchemytest/site.zcml", line 4.2-4.36
ZopeXMLConfigurationError: File "/home/harobed/Experimentations/
zalchemy/zalchemytest/src/zalchemytest/configure.zcml", line 30.0-30.46
ZopeXMLConfigurationError: File "/home/harobed/Experimentations/
zalchemy/buildout-eggs/z3c.zalchemy-0.2.1-py2.4.egg/z3c/zalchemy/demo/
demo_1/configure.zcml", line 16.2-19.8
ComponentLookupError: (<InterfaceClass
z3c.zalchemy.interfaces.IAlchemyEngineUtility>, 'DemoEngine-1') """
My investigation :
* DemoEngine-1 AlchemyEngineUtility is well declared in demo/demo_1/
configure.zcml
* If I comment this lines :
"""
<!--
<alchemy:connectClass
class=".message.HelloWorldMessage"
engine="DemoEngine-1"
/>
-->
"""
bin/zalchemytest-debug start with success. And I can get DemoEngine-1
AlchemyEngineUtility with success in debug console.
* If I uncomment previous lines, I understand it's line below which throw
exception :
In demo/demo_1/message.py:
z3c.zalchemy.createTable('message', 'DemoEngine-1')
I've added debugger set_trace before this line and I've tryed to fetch
DemoEngine-1 AlchemyEngineUtility with no success. I don't understand why
it !
Thanks for your help,
Regards,
Stephane
More information about the Zope
mailing list