You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-dev@lucene.apache.org by Chris Guin <cg...@bbn.com> on 2012/04/26 20:30:33 UTC

JCC initVM crash

Hi -

I'm trying to use JCC to wrap a simple test jar file on my Windows 7 
machine, but running "python -m jcc" crashes immediately when initVM is 
called (print statements I added after the initVM call are never reached 
- those right before are).  The crash, unfortunately, gives me no 
printouts or useful information at all - I just get the Windows 7 box 
saying "python.exe has stopped working."  I've read through the docs 
trying to figure out if I missed something obvious while installing or 
running it, but I haven't found anything yet.

Any ideas?  Anyone run into anything similar?

Thanks,
Chris

AW: JCC initVM crash

Posted by Thomas Koch <ko...@orbiteam.de>.
Hi Chris,
I think you've got a build problem. Make sure to build JCC properly first
before trying further - a very basic test is:

>>> import jcc
>>> jcc.initVM()
<jcc.JCCEnv object at 0x01D730E0>
>>> dir(jcc)
['CLASSPATH', 'SHARED', '__builtins__', '__doc__', '__file__', '__name__',
'__package__', '__path__', '_jcc', 'config', 'eggpath', 'initVM', 'os',
'path', 'sys']
>>> jcc.CLASSPATH
'C:\\Devel\\Python27\\lib\\site-packages\\jcc-2.12-py2.7-win32.egg\\jcc\\cla
sses'
>>> jcc.SHARED
True

If initVM() crashes your build is certainly broken!

Regarding Python25 binaries: there are no binaries in the "Pylucene extras"
project yet - I guess (besides that Python 2.5 is rather old now) the
problem is that Python 2.5 (pre-built windows binary dist) was built with a
different C compiler than Python 2.6/2.7. I tried to build PyLucene for
Python25 on Windows once (with the setup as described in previous mail), but
had no luck and gave up then...

Regarding 32/64bit - I'd expect no problems with Java 32-bit when you're
running Python 32-bit as well. I haven't used PyLucene with 64bit yet (and
no pre-built binaries for Windows exist AFAIK), but I'd use a 64-bit
toolchain then - including Python 64-bit and Java 64-bit (it's one of the
things I'm still planning to do ,-)

Hope that helps!


kind regards

Thomas 
--
OrbiTeam Software GmbH & Co. KG, Germany
http://www.orbiteam.de

> -----Ursprüngliche Nachricht-----
> Von: Chris Guin [mailto:cguin@bbn.com]
> Gesendet: Freitag, 27. April 2012 16:34
> An: pylucene-dev@lucene.apache.org
> Betreff: Re: JCC initVM crash
> 
> Thomas -
> Thanks for your reply.  The jvm.dll seems to be in the right place - when
I
> remove it from the SysWOW64 folder, I get a very specific complaint about
> the dll not being there.
> 
> As for your other question, I built JCC myself.  As I'm dealing with some
> legacy systems I need Python 2.5 and it didn't look like there was a
pre-built
> version available.  I built with a 32-bit version of Java (1.6.0_25), so
I'm
> wondering if the issue is that something is expecting a 64-bit version.
> However, I'm having trouble rebuilding JCC with the 64-bit version of Java
> (1.6.0_29).  I'm getting the following errors from g++:
> 
> C:\MinGW32\bin\g++.exe -shared
> -Wl,--out-implib,build\lib.win32-2.5\jcc\jcc.lib -s build\temp.win32-
> 2.5\Release\jcc\sources\jcc.o
> build\temp.win32-2.5\Release\jcc\sources\jccenv.o
> build\temp.win32-2.5\Release\jcc\sources\jcc.def -LC:\Python25\libs -
> LC:\Python25\PCBuild -lpython25 -lmsvcr71 -o build\lib.win32-2.5\jcc.dll
"-
> LC:\Program Files\Java\jdk1.6.0_29/lib"
> -ljvm -Wl,-S -Wl,--outimplib,jcc\jcc.lib Creating library file:
jcc\jcc.lib
> build\temp.win32-2.5\Release\jcc\sources\jcc.o:jcc.cpp:(.text+0xedc):
> undefined reference to `_imp__JNI_GetDefaultJavaVMInitArgs@4'
> build\temp.win32-2.5\Release\jcc\sources\jcc.o:jcc.cpp:(.text+0x1162):
> undefined reference to `_imp__JNI_CreateJavaVM@12'
> 
> I'm using mingw on a 64-bit Win7 machine.  Would jdk1.6.0_25 have worked
> where 1.6.0_29 would not have for some reason?  Maybe I'm going about
> this the entirely wrong way...
> 
> Thanks,
> Chris
> 
> (Here's my config.py file from the 32-bit Java JCC site-package I built:
> 
> INCLUDES=[u'C:\\Program Files (x86)\\Java\\jdk1.6.0_25/include',
> u'C:\\Program Files (x86)\\Java\\jdk1.6.0_25/include/win32']
> CFLAGS=['-fno-strict-aliasing', '-Wno-write-strings'] DEBUG_CFLAGS=['-O0',
'-
> g', '-DDEBUG'] LFLAGS=[u'-LC:\\Program Files
(x86)\\Java\\jdk1.6.0_25/lib', '-
> ljvm'] IMPLIB_LFLAGS=['-Wl,--out-implib,%s']
> SHARED=False
> VERSION="2.12")
> 
> On 4/26/2012 4:46 PM, Thomas Koch wrote:
> > Chris,
> >
> > Did you Build JCC yourself or did you download pre-built Version?
> >
> > A typical problem is that Java cannot be found at runtime - make sure
that
> your Java Client dll is available in path.
> >
> > Regards
> > Thomas
> > --
> > Am 26.04.2012 um 20:30 schrieb Chris Guin<cg...@bbn.com>:
> >
> >> Hi -
> >>
> >> I'm trying to use JCC to wrap a simple test jar file on my Windows 7
> machine, but running "python -m jcc" crashes immediately when initVM is
> called (print statements I added after the initVM call are never reached -
> those right before are).  The crash, unfortunately, gives me no printouts
or
> useful information at all - I just get the Windows 7 box saying
"python.exe
> has stopped working."  I've read through the docs trying to figure out if
I
> missed something obvious while installing or running it, but I haven't
found
> anything yet.
> >>
> >> Any ideas?  Anyone run into anything similar?
> >>
> >> Thanks,
> >> Chris




Re: JCC initVM crash

Posted by Chris Guin <cg...@bbn.com>.
Thomas -
Thanks for your reply.  The jvm.dll seems to be in the right place - 
when I remove it from the SysWOW64 folder, I get a very specific 
complaint about the dll not being there.

As for your other question, I built JCC myself.  As I'm dealing with 
some legacy systems I need Python 2.5 and it didn't look like there was 
a pre-built version available.  I built with a 32-bit version of Java 
(1.6.0_25), so I'm wondering if the issue is that something is expecting 
a 64-bit version.  However, I'm having trouble rebuilding JCC with the 
64-bit version of Java (1.6.0_29).  I'm getting the following errors 
from g++:

C:\MinGW32\bin\g++.exe -shared 
-Wl,--out-implib,build\lib.win32-2.5\jcc\jcc.lib -s 
build\temp.win32-2.5\Release\jcc\sources\jcc.o 
build\temp.win32-2.5\Release\jcc\sources\jccenv.o 
build\temp.win32-2.5\Release\jcc\sources\jcc.def -LC:\Python25\libs 
-LC:\Python25\PCBuild -lpython25 -lmsvcr71 -o 
build\lib.win32-2.5\jcc.dll "-LC:\Program Files\Java\jdk1.6.0_29/lib" 
-ljvm -Wl,-S -Wl,--outimplib,jcc\jcc.lib
Creating library file: jcc\jcc.lib
build\temp.win32-2.5\Release\jcc\sources\jcc.o:jcc.cpp:(.text+0xedc): 
undefined reference to `_imp__JNI_GetDefaultJavaVMInitArgs@4'
build\temp.win32-2.5\Release\jcc\sources\jcc.o:jcc.cpp:(.text+0x1162): 
undefined reference to `_imp__JNI_CreateJavaVM@12'

I'm using mingw on a 64-bit Win7 machine.  Would jdk1.6.0_25 have worked 
where 1.6.0_29 would not have for some reason?  Maybe I'm going about 
this the entirely wrong way...

Thanks,
Chris

(Here's my config.py file from the 32-bit Java JCC site-package I built:

INCLUDES=[u'C:\\Program Files (x86)\\Java\\jdk1.6.0_25/include', 
u'C:\\Program Files (x86)\\Java\\jdk1.6.0_25/include/win32']
CFLAGS=['-fno-strict-aliasing', '-Wno-write-strings']
DEBUG_CFLAGS=['-O0', '-g', '-DDEBUG']
LFLAGS=[u'-LC:\\Program Files (x86)\\Java\\jdk1.6.0_25/lib', '-ljvm']
IMPLIB_LFLAGS=['-Wl,--out-implib,%s']
SHARED=False
VERSION="2.12")

On 4/26/2012 4:46 PM, Thomas Koch wrote:
> Chris,
>
> Did you Build JCC yourself or did you download pre-built Version?
>
> A typical problem is that Java cannot be found at runtime - make sure that your Java Client dll is available in path.
>
> Regards
> Thomas
> --
> Am 26.04.2012 um 20:30 schrieb Chris Guin<cg...@bbn.com>:
>
>> Hi -
>>
>> I'm trying to use JCC to wrap a simple test jar file on my Windows 7 machine, but running "python -m jcc" crashes immediately when initVM is called (print statements I added after the initVM call are never reached - those right before are).  The crash, unfortunately, gives me no printouts or useful information at all - I just get the Windows 7 box saying "python.exe has stopped working."  I've read through the docs trying to figure out if I missed something obvious while installing or running it, but I haven't found anything yet.
>>
>> Any ideas?  Anyone run into anything similar?
>>
>> Thanks,
>> Chris


Re: JCC initVM crash

Posted by Thomas Koch <ko...@orbiteam.de>.
Chris,

Did you Build JCC yourself or did you download pre-built Version?

A typical problem is that Java cannot be found at runtime - make sure that your Java Client dll is available in path. 

Regards
Thomas
--
Am 26.04.2012 um 20:30 schrieb Chris Guin <cg...@bbn.com>:

> Hi -
> 
> I'm trying to use JCC to wrap a simple test jar file on my Windows 7 machine, but running "python -m jcc" crashes immediately when initVM is called (print statements I added after the initVM call are never reached - those right before are).  The crash, unfortunately, gives me no printouts or useful information at all - I just get the Windows 7 box saying "python.exe has stopped working."  I've read through the docs trying to figure out if I missed something obvious while installing or running it, but I haven't found anything yet.
> 
> Any ideas?  Anyone run into anything similar?
> 
> Thanks,
> Chris