Jpype on RHEL v3

B

benchline

I have been trying out jpype for python to java work and love it. It
works great on my gentoo box with the java 1.4.2 blackdown sdk.

I am now trying it on Red Hat Enterprise Linux 3 for access to business
intelligence tools (JasperReports, Mondrian, Pentaho, etc) for which we
don't have analogous tools in cpython yet. My idea it to use jpype in
a cherrypy application server to tie these java BI tools into a website
interface without having to delve into the more complex java J2EE
application servers and lose all the python libraries that I know and
love.

Here is my problem.

When trying to start the jvm with the sun jre I get this error.

[root@servername root]# python2.4
Python 2.4.2 (#1, Dec 1 2005, 05:44:04)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-53)] on linux2
Type "help", "copyright", "credits" or "license" for more information.Error occurred during initialization of VM
Unable to load native library: libjvm.so: cannot open shared object
file: No such file or directory

and then python dies.

When I try to start the jvm with the ibm jre I get this error.

[root@servername root]# python2.4
Python 2.4.2 (#1, Dec 1 2005, 05:44:04)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-53)] on linux2
Type "help", "copyright", "credits" or "license" for more information.Unable to find UTE, path used libjava.so/libute.so
JVMCI170: Please check the path to shared libraries
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/lib/python2.4/site-packages/jpype/_core.py", line 25, in
startJVM
_jpype.startup(jvm, tuple(args), True)
RuntimeError: Unable to start JVM at src/native/common/jp_env.cpp:54

but the python interpreter is still running.

Can anyone point me in the right direction so I can fix this?

Thanks
 
B

benchline

I found the problem. So if anyone else has it here is the fix.

In the documentation distributed with JPype 0.5.1 in the examples/linux
directory, there is a file that describes a problem with loading the
jvm on linux. So one needs to modify the LD_LIBRARY_PATH environment
variable to fix it.

I did that after changing one line in
/usr/lib/python2.4/site-packages/jpype/_linux.py line 37 to

return "/etc/alternatives/java_sdk/jre/lib/i386/client/libjvm.so"

so that jpype.getDefaultJVMPath() would return the correct libjvm.so
path for my install.

Then I did

export
LD_LIBRARY_PATH=/etc/alternatives/java_sdk/jre/lib/i386:/etc/alternatives/java_sdk/jre/lib/i386/client

after doing that the sun 1.4.2 jre loaded just fine with:
[root@servername root]# python2.4
Python 2.4.2 (#1, Dec 1 2005, 05:44:04)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-53)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

python 6 compilation failure on RHEL 0
Question on re.IGNORECASE 3
"sem_post: Invalid argument" 4
import subprocess in python 3
Locale bug? 3
Ubuntu Python -dbg packages 0
SSL on 3.2.2 0
Comparing types 4

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top