Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Dec 2003 15:57:10 +0100
From:      Matthew Whittaker-Williams <m.whittaker-williams@iu.nl>
To:        freebsd-questions@freebsd.org
Subject:   java ( jdk1.3.1)  & php4 + apache 1.3.x
Message-ID:  <20031224155710.4b72c52b.m.whittaker-williams@iu.nl>

next in thread | raw e-mail | index | archive | help
--Signature=_Wed__24_Dec_2003_15_57_10_+0100_IxzB9r8f=tUgJ.s=
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: inline
Content-Transfer-Encoding: 7bit


Good day fokes,

I got several questions relating to installing java under php4 build
with apache1.3.29.
I am trying to get java to work under php, but somehow it keeps nagging
about some Undefined Symbol:

Fatal error: Unable to load Java Library
/usr/local/jdk1.3.1/jre/lib/i386/libjava.so, error:
/usr/local/jdk1.3.1/jre/lib/i386/libjava.so: Undefined symbol
"JVM_DoPrivileged" in /home/www.bobshop.nl/wwwroot/javatest.php on line
10

This is the script i use to test java inside php:

<?php
  $system = new Java("java.lang.System");
  print "Java version=".$system->getProperty("java.version")." <br>\n";
  print "Java vendor=".$system->getProperty("java.vendor")." <p>\n\n";
  print "OS=".$system->getProperty("os.name")." ".
              $system->getProperty("os.version")." on ".
              $system->getProperty("os.arch")." <br>\n";
  $formatter = new Java("java.text.SimpleDateFormat","EEEE,
        MMMM dd, yyyy 'at' h:mm:ss a zzzz");
  print $formatter->format(new Java("java.util.Date"))."\n";
?>

As you see these are small request to the java system tho java borks on
it.

I took the following steps to try and get it working:

1) Compiled jdk1.3.1 from /usr/port/java/jdk13
2) Compiled apache13-modssl with LD_FLAGS="-phthread -lc_r"
3) Compiled www/modphp4 with --with-java=/usr/local/jdk1.3.1

Did a the following export before compiling to be sure it takes the
green_threads.
export THREADS_FLAG=green

4) set extra ldconfig_paths in rc.conf:

ldconfig_paths="/usr/lib/compat /usr/X11R6/lib /usr/local/lib
/usr/local/jdk1.3.1/jre/lib/i386"

gave the server a reboot

5) set the following paths in shell enviroment:

export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/usr/local/lib:/usr/local/lib/php:/usr/local/lib/php/20020429:/usr/local/jdk1.3.1/jre/lib:/usr/local/jdk1.3.1/jre/lib/i386:/usr/local/jdk1.3.1/i386/green_threads

6) Linked java.so to libphp_java.so

cd /usr/local/lib/php/20020429 ; ln -s java.so libphp_java.so

7) checked the libraries:

ldd /usr/local/lib/php/20020429/libphp_java.so:

/usr/local/lib/php/20020429/libphp_java.so:
        libcrypto.so.3 => /usr/lib/libcrypto.so.3 (0x28109000)
        libssl.so.3 => /usr/lib/libssl.so.3 (0x28207000)

8) set the java class paths etc in php.ini:

[java]
java.class.path =
/usr/local/lib/php/php_java.jar:/usr/local/jdk1.3.1/jre/lib/rt.jar
/usr/local/lib/php/php_java.jar:/usr/local/jdk1.3.1/jre/lib/rt.jar
java.home = /usr/local/jdk1.3.1
java.library = /usr/local/jdk1.3.1/jre/lib/i386/libjava.so
java.library.path =
/usr/local/lib/php/20020429:/usr/local/jdk1.3.1/bin:/usr/local/jdk1.3.1/i386/green_threads:/usr/local/jdk1.3.1/i386/native_threads:/usr/local/jdk1.3.1/lib:/usr/local/jdk1.3.1/lib/i386:/usr/local/jdk1.3.1/jre:/usr/local/jdk1.3.1/jre/i386:/usr/local/jdk1.3.1/jre/i386/classic:/usr/local/jdk1.3.1/jre/i386/green_threads:/usr/local/jdk1.3.1/jre/i386/native_threads:/usr/local/jdk1.3.1/jre/lib/i386
extension_dir=/usr/local/lib/php/20020429
extension=libphp_java.so

As you see here i put almost every path to the java.library path to be
sure it can find all libraries it needs, tho i am not sure if this can
cause the error.
I tried minimizing the path and error kept coming up.

9) started apache and it gives me the Undefined Symbol.

If i search on google on that Symbol it doesn`t get me far.

So i was wondering if any of u fokes got jdk1.3.1 or anyother jdk
version working with php under freebsd.
I saw some articles on building it under freebsd but they all lead me to
this error.

So i am kinda stuck at the moment.

For some extra information , the truss on apache :

read(0x6,0x80cf090,0x1000)                       ERR#35 'Resource temporarily unavailable'
poll(0x80a4000,0x1,0x0)                          = 0 (0x0)
poll(0x80a4000,0x2,0xffffffff)                   = 1 (0x1)
gettimeofday(0x28146dc8,0x0)                     = 0 (0x0)
read(0x6,0x80cf090,0x1000)                       = 487 (0x1e7)
sigaction(SIGUSR1,0xbfbfd7b8,0x0)                = 0 (0x0)
gettimeofday(0xbfbfd838,0x0)                     = 0 (0x0)
stat("/usr/local/www/data/javatest.php",0x80be100) = 0 (0x0)
umask(0x3f)                                      = 18 (0x12)
umask(0x12)                                      = 63 (0x3f)
setitimer(0x2,0xbfbff650,0x0)                    = 0 (0x0)
__getcwd(0xbfbfe238,0xfff)                       = 0 (0x0)
chdir(0xbfbfe1d8)                                = 0 (0x0)
lstat("/usr",0xbfbfe1c0)                         = 0 (0x0)
lstat("/usr/local",0xbfbfe1c0)                   = 0 (0x0)
lstat("/usr/local/www",0xbfbfe1c0)               = 0 (0x0)
lstat("/usr/local/www/data",0xbfbfe1c0)          = 0 (0x0)
readlink("/usr/local/www/data","/usr/local/www/data-dist x(_(",1023) = 24 (0x18)
lstat("/usr",0xbfbfe1c0)                         = 0 (0x0)
lstat("/usr/local",0xbfbfe1c0)                   = 0 (0x0)
lstat("/usr/local/www",0xbfbfe1c0)               = 0 (0x0)
lstat("/usr/local/www/data-dist",0xbfbfe1c0)     = 0 (0x0)
lstat("/usr/local/www/data-dist/javatest.php",0xbfbfe1c0) = 0 (0x0)
setitimer(0x2,0xbfbfe200,0x0)                    = 0 (0x0)
__getcwd(0xbfbfd700,0x400)                       = 0 (0x0)
lstat("/usr",0xbfbfd200)                         = 0 (0x0)
lstat("/usr/local",0xbfbfd200)                   = 0 (0x0)
lstat("/usr/local/www",0xbfbfd200)               = 0 (0x0)
lstat("/usr/local/www/data-dist",0xbfbfd200)     = 0 (0x0)
lstat("/usr/local/www/data-dist/javatest.php",0xbfbfd200) = 0 (0x0)
open("/usr/local/www/data-dist/javatest.php",0x0,00) = 7 (0x7)
fcntl(0x7,0x3,0x0)                               = 0 (0x0)
fcntl(0x7,0x4,0x4)                               = 0 (0x0)
fstat(7,0xbfbfdb40^[[?1;2c)                              = 0 (0x0)
fstat(7,0xbfbfdaa0)                              = 0 (0x0)
lseek(7,0x0,1)                                   = 0 (0x0)
lseek(7,0x0,0)                                   = 0 (0x0)
read(0x7,0x81b0000,0x2000)                       = 527 (0x20f)
read(0x7,0x81b0000,0x2000)                       = 0 (0x0)
fstat(7,0xbfbfe0a0)                              = 0 (0x0)
fcntl(0x7,0x3,0x0)                               = 4 (0x4)
fcntl(0x7,0x4,0x0)                               = 0 (0x0)
close(7)                                         = 0 (0x0)
sigprocmask(0x1,0x280a2420,0xbfbfd8e0)           = 0 (0x0)
open("/usr/local/jdk1.3.1/jre/lib/i386/libjava.so",0x0,054) = 7 (0x7)
fstat(7,0xbfbfd890)                              = 0 (0x0)
read(0x7,0xbfbfc860,0x1000)                      = 4096 (0x1000)
mmap(0x0,110592,0x5,0x20002,7,0x0)               = 679997440 (0x2887f000)
mprotect(0x28898000,0x1000,0x7)                  = 0 (0x0)
mprotect(0x28898000,0x1000,0x5)                  = 0 (0x0)
mmap(0x28899000,4096,0x3,0x12,7,0x19000)         = 680103936 (0x28899000)
close(7)                                         = 0 (0x0)
access("/usr/local/jdk1.3.1/jre/lib/i386/libverify.so",0) = 0 (0x0)
open("/usr/local/jdk1.3.1/jre/lib/i386/libverify.so",0x0,05002242077) = 7 (0x7)
fstat(7,0xbfbfd860)                              = 0 (0x0)
read(0x7,0xbfbfc830,0x1000)                      = 4096 (0x1000)
mmap(0x0,61440,0x5,0x20002,7,0x0)                = 680108032 (0x2889a000)
mprotect(0x288a7000,0x1000,0x7)                  = 0 (0x0)
mprotect(0x288a7000,0x1000,0x5)                  = 0 (0x0)
mmap(0x288a8000,4096,0x3,0x12,7,0xd000)          = 680165376 (0x288a8000)
close(7)                                         = 0 (0x0)
mprotect(0x2887f000,0x1a000,0x7)                 = 0 (0x0)
mmap(0x0,3928,0x3,0x1000,-1,0x0)                 = 680169472 (0x288a9000)
munmap(0x288a9000,0xf58)                         = 0 (0x0)
munmap(0x2887f000,0x1b000)                       = 0 (0x0)
munmap(0x2889a000,0xf000)                        = 0 (0x0)
sigprocmask(0x3,0x280a2430,0x0)                  = 0 (0x0)
sigprocmask(0x1,0x280a2420,0xbfbfd8e0)           = 0 (0x0)
sigprocmask(0x3,0x280a2430,0x0)                  = 0 (0x0)
chdir(0xbfbfe238)                                = 0 (0x0)
setitimer(0x2,0xbfbff530,0x0)                    = 0 (0x0)
umask(0x12)                                      = 18 (0x12)
poll(0x8174800,0x1,0x0)                          = 0 (0x0)
write(6,0x81a4010,532)                           = 532 (0x214)
gettimeofday(0xbfbfd6f8,0x0)                     = 0 (0x0)
write(20,0x80cb688,171)                          = 171 (0xab)
sigaction(SIGUSR1,0xbfbff838,0x0)                = 0 (0x0)
read(0x6,0x80cf090,0x1000)                       ERR#35 'Resource temporarily unavailable'
poll(0x80a4000,0x1,0x0)                          = 0 (0x0)
SIGNAL 14
SIGNAL 14
SIGNAL 14
poll(0x80a4000,0x2,0xffffffff)                   ERR#4 'Interrupted system call'
write(4,0x809ad9b,1)                             = 1 (0x1)
sigreturn(0x809adb8)                             ERR#4 'Interrupted system call'
read(0x3,0x809aec8,0x80)                         = 1 (0x1)
read(0x3,0x809aec8,0x80)                         ERR#35 'Resource temporarily unavailable'
gettimeofday(0x28146dc8,0x0)                     = 0 (0x0)
fstat(6,0xbfbfd114)                              = 0 (0x0)
close(6)                                         = 0 (0x0)
sigaction(SIGURG,0xbfbff828,0x0)                 = 0 (0x0)
sigaction(SIGALRM,0xbfbff838,0x0)                = 0 (0x0)
sigaction(SIGUSR1,0xbfbff838,0x0)                = 0 (0x0)

Hope any of u can help me out to solve this issue.

With kind regards

Matthew Whittaker-Williams

--
Unix System Administrator

Internet Unie
Postbus 23667
1100 ED AMSTERDAM
Tel: 020 463 0506
Fax: 020 463 2146
Email: m.whittaker-williams@iu.nl
URL: http://iu.nl


-- 
Unix System Administrator

Internet Unie
Postbus 23667
1100 ED AMSTERDAM
Tel: 020 463 0506
Fax: 020 463 2146
Email: m.whittaker-williams@iu.nl
URL: http://iu.nl

--Signature=_Wed__24_Dec_2003_15_57_10_+0100_IxzB9r8f=tUgJ.s=
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)

iD8DBQE/6alOjRFBDDry0LERAgsrAJ4gBGXzaGgbH1lJYYCuvv5U6YxAiACfTI9L
tKbnt5gH9NAbV3aomXVFyjc=
=6pmI
-----END PGP SIGNATURE-----

--Signature=_Wed__24_Dec_2003_15_57_10_+0100_IxzB9r8f=tUgJ.s=--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031224155710.4b72c52b.m.whittaker-williams>