[mod_python] Problem in executing java program using mod_python.

David Fraser davidf at sjsoft.com
Wed Aug 17 11:51:17 EDT 2005

Jon-Pierre Gentil wrote:

>On Wednesday 17 August 2005 06:09 am, Manjeet Chaudhary wrote:
>>I want to pull Java Lucene into Python: PyLucene.I have an
>>"ArabicAnalyzer.jar" file in Java and i want to use in Python.I have
>>gone through a documentation of how to convert Java into Python using
>>"gcj" and "swig" , but i am confused about how to go about.
>This would be the perfect reason to have mod_jython.   :-)
>But otherwise, the only way I can think of to integrate it without 
>seriously hacking something up is to create a XMLRPC wrapper service in 
>Java and have it running on the machine with the web server, and do 
>XMLRPC calls to it.
Have a look at how PyLucene works: it's Java code compiled with gcj and 
wrapped with Swig, so there's no jython or Java interpreter.
Andi Vadja's answer on pylucene-dev (see below) is basically that the 
same could be done to other Java code...
Andi Vajda wrote:

> It shouldn't be too hard to create a custom build with the arabic 
> analyzer.
> Take a look at PyLucene's Makefile around line 426. If this analyzer 
> is similar in structure to the other ones, you can add its files to 
> the $(ANALYZERS_JAR) file and follow the same pattern in PyLucene.i as 
> for the other analyzer APIs declared in there.
> If this is too complicated and the LICENSE for your analyzer allows 
> it, ie, it is compatible with PyLucene's LICENSE (see LICENSE file) I 
> can include it in the next release of PyLucene which should happen 
> shortly after Java Lucene 1.9 is released.
> Concerning mod_python use, see the pylucene-dev list archives 
> regarding threading issues.
> Andi.. 

More information about the Mod_python mailing list