Jcc.initVM () does not return when mod_wsgi is configured as daemon mode

I use mod-wsgi with django, and in django I use pylucene for full-text search.

While mod-wsgi is configured for embedded mode, there are no problems. But when mod-wsgi is set to daemon mode, apache just gets stuck and the browser just keeps loading, but nothing appears.

Then I set the task as jcc.initVM (). Here is my wsgi script:

import os, sys, jcc
sys.stderr.write('jcc.initVM\n')
jcc.initVM()
sys.stderr.write('finished jcc.initVM\n')
....

After I restart my apache and make a request from my browser, I found that / var / log / apache 2 / error.log only has:

jcc.initVM

This means that it gets stuck in jcc.initVM () line. (If mod_wsgi is configured as inline mode, no problem.)

And here is my / etc / apache 2 / sites-available / default:

WSGIDaemonProcess site user=ross group=ross threads=1
WSGIProcessGroup site
WSGIScriptAlias / /home/ross/apache/django.wsgi

<Directory /home/ross/apache/>
  Order deny,allow
  Allow from all
</Directory>

And finally, I found out that in the jcc source code (jcc.cpp) it hangs in a function:

JNI_CreateJavaVM(&vm, (void **) &vm_env, &vm_args)

How to solve a problem?

:

libapache2-mod-wsgi 2.3-1
jcc 2.1
python 2.5
Apache 2.2.9-8ubuntu3
Ubuntu 8.10
+3
2

mod_wsgi 2.4.

+1

. http://code.google.com/p/modwsgi/issues/detail?id=131.

, mod_wsgi daemon, initVM . , Andi jcc, initVM , .

initVM() .

+1

Source: https://habr.com/ru/post/1703213/


All Articles