Hi,

I have an application with the following routing configuration:

    <route
        path="wishlist"
        name="wishlistjson"
        header="Content-Type:application/json;*"
        xhr="true"
        factory=".order.wishlistview.wishlist_factory"
        view=".order.wishlistview.WishlistJSONView"
        view_renderer="json" />

    <route
        path="wishlist"
        name="wishlist"
        xhr="true"
        factory=".order.wishlistview.wishlist_factory"
        view=".order.wishlistview.WishlistView"
        view_renderer="order/wishlist.pt" />

The same url path is used for both JSON request and normal ajax html load.
The configuration works fine when run with paster. However when run with
mod_wsgi + apache2, I got the follow exception in the Apache error log:

[Wed May 26 09:12:59 2010] [error] [client 127.0.1.1] mod_wsgi (pid=1818):
Exception occurred processing WSGI script
'/home/hong/hm.web/trunk/hm.web.wsgi'.
[Wed May 26 09:12:59 2010] [error] [client 127.0.1.1] Traceback (most recent
call last):
[Wed May 26 09:12:59 2010] [error] [client 127.0.1.1]   File
"/home/hong/hm.web/lib/python2.6/site-packages/Beaker-1.5.3-py2.6.egg/beaker/middleware.py",
lin
e 152, in __call__
[Wed May 26 09:12:59 2010] [error] [client 127.0.1.1]     return
self.wrap_app(environ, session_start_response)
[Wed May 26 09:12:59 2010] [error] [client 127.0.1.1]   File
"/home/hong/hm.web/lib/python2.6/site-packages/repoze.tm2-1.0a5-py2.6.egg/repoze/tm/__init__.py"
, line 23, in __call__
[Wed May 26 09:12:59 2010] [error] [client 127.0.1.1]     result =
self.application(environ, save_status_and_headers)
[Wed May 26 09:12:59 2010] [error] [client 127.0.1.1]   File
"/home/hong/hm.web/lib/python2.6/site-packages/repoze.bfg-1.3a3-py2.6.egg/repoze/bfg/router.py",
 line 76, in __call__
[Wed May 26 09:12:59 2010] [error] [client 127.0.1.1]     info =
self.routes_mapper(request)
[Wed May 26 09:12:59 2010] [error] [client 127.0.1.1]   File
"/home/hong/hm.web/lib/python2.6/site-packages/repoze.bfg-1.3a3-py2.6.egg/repoze/bfg/urldispatch
.py", line 54, in __call__
[Wed May 26 09:12:59 2010] [error] [client 127.0.1.1]     if preds and not
all((p(None, request) for p in preds)):
[Wed May 26 09:12:59 2010] [error] [client 127.0.1.1]   File
"/home/hong/hm.web/lib/python2.6/site-packages/repoze.bfg-1.3a3-py2.6.egg/repoze/bfg/urldispatch
.py", line 54, in <genexpr>
[Wed May 26 09:12:59 2010] [error] [client 127.0.1.1]     if preds and not
all((p(None, request) for p in preds)):
[Wed May 26 09:12:59 2010] [error] [client 127.0.1.1]   File
"/home/hong/hm.web/lib/python2.6/site-packages/repoze.bfg-1.3a3-py2.6.egg/repoze/bfg/configurati
on.py", line 1680, in header_predicate
[Wed May 26 09:12:59 2010] [error] [client 127.0.1.1]     return
header_val.match(val) is not None

Since it is not possible to use pdb with mod_wsgi, I don't know how to
further trace and fix the situation.

-- 
Hong Yuan

大管家网上建材超市
装修装潢建材一站式购物
http://www.homemaster.cn
_______________________________________________
Repoze-dev mailing list
Repoze-dev@lists.repoze.org
http://lists.repoze.org/listinfo/repoze-dev

Reply via email to