PHP-JAVA-SAP problem

S

sonykalkan

I have a problem on my php code, can you help me to solve this issue ?
The php code uses java module to call a java method which connects to
SAP and returns result.
Whenever I call my php script, I receive the following error:

Warning: java.lang.ExceptionInInitializerError: JCO.classInitialize():
Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc
[/usr/java/j2sdk1.4.2_03/jre/lib/ext/libsapjcorfc.so: librfccm.so:
cannot open shared object file: No such file or directory].
java.library.path [/usr/lib/php4] in
/usr/local/apache/htdocs/eticaret/grosstest/sapphpjavadeneme.php on
line 3

sapphpjavadeneme.php is as follows:

<?php
$obj = new Java("classmusteri");
$vret=$obj->musteriguncelle("");
echo($vret);
?>

Java class classmusteri runs great from the command prompt. Required
library files of SAP are located in
/usr/java/j2sdk1.4.2_03/jre/lib/ext/
The files are: sapjco.jar, librfccm.so, libsapjcorfc.so


[Java]
java.class.path=/usr/lib/php4/php_java.jar:/usr/local/javaclasses
java.home=/usr/java/j2sdk1.4.2_03
java.library=/usr/java/j2sdk1.4.2_03/jre/lib/i386/server/libjvm.so
java.library.path=/usr/lib/php4
extension_dir = /usr/lib/php4
extension=java.so
 
Z

zero

(e-mail address removed) wrote in @z14g2000cwz.googlegroups.com:
I have a problem on my php code, can you help me to solve this issue ?
The php code uses java module to call a java method which connects to
SAP and returns result.
Whenever I call my php script, I receive the following error:

Warning: java.lang.ExceptionInInitializerError: JCO.classInitialize():
Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc
[/usr/java/j2sdk1.4.2_03/jre/lib/ext/libsapjcorfc.so: librfccm.so:
cannot open shared object file: No such file or directory].
java.library.path [/usr/lib/php4] in
/usr/local/apache/htdocs/eticaret/grosstest/sapphpjavadeneme.php on
line 3

just a guess: does the PHP user have enough rights to access the file
/usr/java/j2sdk1.4.2_03/jre/lib/ext/libsapjcorfc.so? If the class runs
fine from the command line maybe you're running it with a different
account, one that does have the required rights. Since it says it can't
find the file rather than a SecurityException, the access violation is
probably on one of the directories and not the file itself (if I'm right
that is), so check the whole path.

Zero
 

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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top