Hi, Andi, Everything worked when i manually run "python -m jcc --jar" command. Thanks Andi,
On Mon, Sep 14, 2009 at 11:22 PM, Andi Vajda <va...@apache.org> wrote: > > On Mon, 14 Sep 2009, Sujan Shakya wrote: > > Installation of jcc would succeed successfully, but while importing jcc I >> got the following error: >> >> File >> "/usr/local/lib/python2.5/site-packages/JCC-2.3-py2.5-freebsd-LogEx-i386.egg/jcc/__init__.py", >> line 29, in <module> >> from _jcc import initVM >> > > What's the error ? > Ah... The error was "ImportError: No module named _jcc" > > And once i make pylucene, the following error would occur: >> >> Traceback (most recent call last): >> File "/usr/local/lib/python2.5/runpy.py", line 95, in run_module >> filename, loader, alter_sys) >> File "/usr/local/lib/python2.5/runpy.py", line 52, in _run_module_code >> mod_name, mod_fname, mod_loader) >> File "/usr/local/lib/python2.5/runpy.py", line 32, in _run_code >> exec code in run_globals >> File >> >> "/usr/local/lib/python2.5/site-packages/JCC-2.3-py2.5-freebsd-LogEx-i386.egg/jcc/__init__.py", >> line 27, in <module> >> import jcc.__main__ >> File >> >> "/usr/local/lib/python2.5/site-packages/JCC-2.3-py2.5-freebsd-LogEx-i386.egg/jcc/__init__.py", >> line 29, in <module> >> from _jcc import initVM >> ImportError: Shared object "libverify.so" not found, required by >> "libjava.so" >> *** Error code 255 >> >> Stop in /storage/misc/pylucene/pylucene-2.4.1-1. >> >> So I searched for libverify.so on the local machine and it was found on >> /usr/local/lib/. So I copied /usr/local/lib/libverify.so to >> /lib/libverify.so. >> > > I don't have access to freebsd7 so I don't know if that libverify.so in > /usr/local/lib is the one needed by your Java installation. > Assuming it is correct... > > After this I run make inside pylucene. And after this "import -m jcc" did >> not displayed any error. >> > > Ok, after you've run 'make', run 'make test' to validate your build. > 'make test' would failed. And it showed some error like: ImportError: cannnot import name Document > Then the 'make install' inside pylucene also ends successfully and 'import >> lucene' did not emit any error either. >> >> But when i run dir(lucene), there's too little modules than when i run >> dir(lucene) on mac. >> >> When looking over the >> site-packages/lucene-2.4.1-py2.5-freebsd-LogEx-i386.egg/lucene/, there >> were >> no any .jar files, where there should be 8 jar files, I guess. >> So am i missing any classpaths for any jar files during make of pylucene ? >> > > Did the jar files get built at least ? > What does "find . -name '*.jar'" run in your pylucene directory produce ? > > Yeah, jar files got built inside build/contrib. And actually when I collected those jar files and manually compiled, all jar files were compiled inside site-packages, and everything worked. The command I run is: python -m jcc --jar lucene-core-2.4.1.jar --jar lucene-analyzers-2.4.1.jar --jar lucene-snowball-2.4.1.jar --jar lucene-highlighter-2.4.1.jar --jar lucene-regex-2.4.1.jar --jar lucene-queries-2.4.1.jar --jar lucene-instantiated-2.4.1.jar --jar extensions.jar --package java.lang --package java.util --package java.io java.lang.System java.lang.Runtime java.lang.Boolean java.lang.Byte java.lang.Character java.lang.Integer java.lang.Short java.lang.Long java.lang.Double java.lang.Float java.text.SimpleDateFormat java.io.StringReader java.io.InputStreamReader java.io.FileInputStream java.util.Arrays --exclude org.apache.lucene.queryParser --exclude org.apache.lucene.queryParser.TokenMgrError --exclude org.apache.lucene.queryParser.ParseException --python lucene --version 2.4.1 --mapping org.apache.lucene.document.Document 'get:(Ljava/lang/String;)Ljava/lang/String;' --mapping java.util.Properties 'getProperty:(Ljava/lang/String;)Ljava/lang/String;' --sequence org.apache.lucene.search.Hits 'length:()I' 'doc:(I)Lorg/apache/lucene/document/Document;' --files 2 --build --module collections.py --install > Andi.. > > Thanks Andi for your help. > > >> My jcc/setup.py for freebsd looks like: >> >> JDK = { >> 'freebsd7': '/usr/local/diablo-jdk1.6.0', >> } >> INCLUDES = { >> 'freebsd7': ['%(freebsd7)s/include' %(JDK), >> '%(freebsd7)s/include/freebsd' %(JDK)], >> } >> CFLAGS = { >> 'freebsd7': ['-fno-strict-aliasing', '-Wno-write-strings'], >> } >> DEBUG_CFLAGS = { >> 'freebsd7': ['-O0', '-g', '-DDEBUG'], >> } >> LFLAGS = { >> 'freebsd7': ['-L%(freebsd7)s/jre/lib/i386' %(JDK), '-ljava', >> '-L%(freebsd7)s/jre/lib/i386/client' %(JDK), '-ljvm', >> >> '-Wl,-rpath=%(freebsd7)s/jre/lib/i386:%(freebsd7)s/jre/lib/i386/client' >> %(JDK)], >> } >> JAVAC = { >> 'freebsd7': ['javac'], >> } >> >> And pylucene/Makefile looks like: >> >> # FreeBSD >> PREFIX_PYTHON=/usr/local >> ANT=ant >> PYTHON=$(PREFIX_PYTHON)/bin/python >> JCC=$(PYTHON) -m jcc >> NUM_FILES=2 >> >> >> Any help will be greatly appreciated. >> >> Thanks. >> >> /suzan >> >>