Click to See Complete Forum and Search --> : undefined symbol: jdk_pthread_sigmask


Anon
12-29-2000, 11:58 AM
Here's the full error:
Fatal error: Unable to load Java Library /usr/local/j2sdk1.3.0/jre/lib/i386/libjava.so, error: undefined symbol: jdk_pthread_sigmask
in /www/htdocs/javatest/javatest.php on line 8

It's not the code, the code works just fine on a machine running jdk1.2

I've been all over this site trying to get this one figured out, so I'll include all the info

**> php.ini:
[Java]
java.library.path=/usr/local/lib:/usr/local/src/php-4.0.3pl1/modules:/usr/local/j2sdk1.3.0/jre/lib:/usr/local/j2sdk1.3.0/jre/lib/i386:/usr/local/j2sdk1.3.0/jre/lib/i386/classic:/usr/local/j2sdk1.3.0/jre/lib/i386/native_threads
java.library=/usr/local/j2sdk1.3.0/jre/lib/i386/libjava.so
java.home=/usr/local/j2sdk1.3.0/
java.class.path=/usr/local/j2sdk1.3.0/lib/tools.jar:/usr/local/j2sdk1.3.0/jre/lib/rt.jar:/usr/local/lib/php_java.jar:/www/htdocs/javatest

extension_dir=/usr/local/lib/php/extensions/no-debug-non-zts-20000809
extension=libphp_java.so

**> system PATH:
echo $PATH
/usr/local/sbin:/usr/sbin:/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11R6/bin:/usr/local/j2sdk1.3.0/bin:/root/bin

**>system LD_LIBRARY_PATH
echo $LD_LIBRARY_PATH
/usr/local/lib:/usr/local/j2sdk1.3.0/jre/lib/i386:/usr/local/j2sdk1.3.0/jre/lib/i386/native_threads:/usr/local/j2sdk1.3.0/jre/lib/i386/classic

From everything I can find, this all looks right. But still I get the error mentioned at the top of the page. Anyone got any ideas?

Brad

Anon
12-29-2000, 02:21 PM
Brad,

There were some problems with 4.0.3pl1 especially in regards to the Java feature. Try this on 4.0.4 and report back.

Alex

Anon
01-02-2001, 04:04 PM
ok, all is the same except for php v4.0.4. Same error. Any other suggestions?
and thanks, by the way!

brad

akilov
01-16-2001, 06:18 PM
Brad,

I just tried Blackdown's JDK 1.3.0 and it appears that the ext/java/config.m4 needs to be updated to support the new directory structure of this JDK. I hacked it as follows to get it to work (I'll try and get this committed to CVS once I check with Sam):

Around line 69, change:
test -d $i/classic && AC_ADD_LIBPATH($i/classic)

to:
test -d $i/hotspot && AC_ADD_LIBPATH($i/hotspot)
test -d $i/server && AC_ADD_LIBPATH($i/server)
test -d $i/classic && AC_ADD_LIBPATH($i/classic)

You'll have to run ./buildconf again after making this change and then do the normal ./configure/make/make install.

There are also other changes that I need to make to that config file to support AIX and other platforms that use a different extension from Linux's .so for shared objects.

Alex

Anon
01-18-2001, 01:37 PM
Alex,
I know this info is around in other posts but could you post the php.ini [java] section you're using with this and /etc/ld.so.conf and $LD_LIBRARY_PATH ? I would like to compare them to mine. It isn't working even with the new change.

Thanks a lot!!
brad

akilov
01-18-2001, 02:24 PM
Brad,

Here's my environment settings (my --prefix for php was /home/akilov):

JAVA_HOME=/opt/j2sdk1.3.0
PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
LD_LIBRARY_PATH=/home/akilov/lib:$JAVA_HOME/jre/lib/i386:$JAVA_HOME/jre/lib/i386/hotspot:$JAVA_HOME/jre/lib/i386/native_threads
CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$CLASSPATH

php.ini:

java.class.path=/home/akilov/lib/php_java.jar
extension_dir=/home/akilov/lib
extension=libphp_java.so

When are you getting the failures? At link or runtime?

Make sure you've rerun ./buildconf, rm config.cache and then ./configure --with-java, then make and make install. If your configure didn't get built right the link steps should fail with the jdk_pthread and jdk_sem errors.

Alex

Anon
01-18-2001, 04:23 PM
I edited config.m4, rerun ./buildconf, r config.cache, then reran ./configure --with-apache=../apache_1.3.14 --with-java=/usr/local/j2sdk1.3.0 --enable-track-vars
make
make install

and still get the same error when I make a java call in a php page: "Fatal error: Unable to load Java Library /usr/local/j2skd1.3.0/jre/lib/i386/libjava.so, error: undefined symbol: jdk_pthread_sigmask"

Thanks a lot for your help so far. Any more ideas would be greatly appreciated.

brad

akilov
01-18-2001, 04:47 PM
Brad,

I admit that I haven't tried --with-java=/path-to-jdk. The way I've always
done it is by setting my JAVA_HOME/PATH/LD_LIBRARY_PATH/CLASSPATH and then simply did --with-java. I know it goes through a different path in the config script if you do it this way so try it and see if that takes care of things.

BTW, are you saying that you never see any link errors during the make/make install steps?

Also, I still haven't tried this with Apache. That may be another variable that is introducing the wrong lookup somewhere.

Alex