mod_python, COM, on win2k3 server

Discussion in 'Python' started by Guest, May 20, 2006.

  1. Guest

    Guest Guest

    I have an application that runs on mod_python/apache using the publisher
    handler. It uses an access db as the backend and connects via ADO. In a
    test environment on XP it runs fine, but when on a win2k3 server it will
    load one page, but all subsequent page loads throw a
    pythoncom.CoInitializeEX error until I restart the apache.

    Presumably, this is a threading issue, but I am not sure what the best
    approach to fixing it is. Should I simply wrap all COM calls with
    pythoncom.CoInitialize/pythoncom.CoUninitialize calls, or is this somethig
    that needs to be done at a lower level.

    This is mod_python 3.2, Python 2.3.5, apache2.0.*, win2k3, ado 2.8, and the
    server has 2 processors in case that matters.

    Thanks,

    -d
     
    Guest, May 20, 2006
    #1
    1. Advertising

  2. Guest

    Guest Guest

    Some details, and this is weirder than I thought.

    It is working fine with internet explorer or mozilla as the client, but only
    crashes with Firefox. Moreover, even while firefox is getting errors, IE
    stilll works fine.

    The error I get is:

    Mod_python error: "PythonHandler mod_python.publisher"

    Traceback (most recent call last):

    File "C:\Python23\Lib\site-packages\mod_python\apache.py", line 299, in
    HandlerDispatch
    result = object(req)

    File "C:\Python23\Lib\site-packages\mod_python\publisher.py", line 213, in
    handler
    published = publish_object(req, object)

    File "C:\Python23\Lib\site-packages\mod_python\publisher.py", line 410, in
    publish_object
    return publish_object(req,util.apply_fs_data(object, req.form, req=req))

    File "C:\Python23\Lib\site-packages\mod_python\util.py", line 439, in
    apply_fs_data
    return object(**args)

    File "E:\http_server\timeslips\index.py", line 84, in index
    rtn.append(ts_widget.make_employee_picker())

    File "C:\Python23\lib\site-packages\ecptimeslips\ts_widget.py", line 128,
    in make_employee_picker
    rs = win32com.client.Dispatch("ADODB.Recordset")

    File "C:\Python23\Lib\site-packages\win32com\client\__init__.py", line 95,
    in Dispatch
    dispatch, userName =
    dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)

    File "C:\Python23\Lib\site-packages\win32com\client\dynamic.py", line 91,
    in _GetGoodDispatchAndUserName
    return (_GetGoodDispatch(IDispatch, clsctx), userName)

    File "C:\Python23\Lib\site-packages\win32com\client\dynamic.py", line 79,
    in _GetGoodDispatch
    IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx,
    pythoncom.IID_IDispatch)

    com_error: (-2147221008, 'CoInitialize has not been called.', None, None)

    ?
     
    Guest, May 20, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eidolon
    Replies:
    4
    Views:
    571
    Ken Cox [Microsoft MVP]
    May 12, 2004
  2. =?Utf-8?B?TmlyYmhv?=

    Win2k3, IIS6, ASP.Net - Server Application Unavailable

    =?Utf-8?B?TmlyYmhv?=, May 10, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    2,863
    Juan T. Llibre
    May 10, 2005
  3. =?Utf-8?B?UHJhZGVlcA==?=

    Querying AD on a Win2K3 server

    =?Utf-8?B?UHJhZGVlcA==?=, May 6, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    356
    youyang
    May 6, 2006
  4. Bert Nieves
    Replies:
    1
    Views:
    167
    Ram Sunkara [msft]
    Nov 10, 2003
  5. Yehuda Vernik
    Replies:
    1
    Views:
    823
    Paul Clement
    Oct 19, 2004
Loading...

Share This Page