mod_python, COM, on win2k3 server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Guest's Avatar

    #1

    mod_python, COM, on win2k3 server

    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.CoIni tializeEX 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.CoIni tialize/pythoncom.CoUni nitialize 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's Avatar

    #2
    Re: mod_python, COM, on win2k3 server

    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: "PythonHand ler mod_python.publ isher"

    Traceback (most recent call last):

    File "C:\Python23\Li b\site-packages\mod_py thon\apache.py" , line 299, in
    HandlerDispatch
    result = object(req)

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

    File "C:\Python23\Li b\site-packages\mod_py thon\publisher. py", line 410, in
    publish_object
    return publish_object( req,util.apply_ fs_data(object, req.form, req=req))

    File "C:\Python23\Li b\site-packages\mod_py thon\util.py", line 439, in
    apply_fs_data
    return object(**args)

    File "E:\http_server \timeslips\inde x.py", line 84, in index
    rtn.append(ts_w idget.make_empl oyee_picker())

    File "C:\Python23\li b\site-packages\ecptim eslips\ts_widge t.py", line 128,
    in make_employee_p icker
    rs = win32com.client .Dispatch("ADOD B.Recordset")

    File "C:\Python23\Li b\site-packages\win32c om\client\__ini t__.py", line 95,
    in Dispatch
    dispatch, userName =
    dynamic._GetGoo dDispatchAndUse rName(dispatch, userName,clsctx )

    File "C:\Python23\Li b\site-packages\win32c om\client\dynam ic.py", line 91,
    in _GetGoodDispatc hAndUserName
    return (_GetGoodDispat ch(IDispatch, clsctx), userName)

    File "C:\Python23\Li b\site-packages\win32c om\client\dynam ic.py", line 79,
    in _GetGoodDispatc h
    IDispatch = pythoncom.CoCre ateInstance(IDi spatch, None, clsctx,
    pythoncom.IID_I Dispatch)

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

    ?


    Comment

    Working...