Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Dec 2003 12:18:17 +0100
From:      Matthew Whittaker-Williams <m.whittaker-williams@iu.nl>
To:        Matthew Whittaker-Williams <m.whittaker-williams@iu.nl>
Cc:        freebsd-java@freebsd.org
Subject:   Re: jdk1.3.1 with php4/apache1.3.x
Message-ID:  <20031222121817.5ebfffdb.m.whittaker-williams@iu.nl>
In-Reply-To: <20031221151510.GA38275@iu.nl>
References:  <20031221151510.GA38275@iu.nl>

next in thread | previous in thread | raw e-mail | index | archive | help
--Signature=_Mon__22_Dec_2003_12_18_17_+0100_hXK9aYe+W87ZAR=G
Content-Type: text/plain; charset=ISO-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, 21 Dec 2003 16:15:10 +0100
Matthew Whittaker-Williams <m.whittaker-williams@iu.nl> wrote:

> Good day fokes,
>=20
> 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:
>=20
> 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
>=20
> This is the script i use to test java inside php:
>=20
> <?php
>   $system =3D new Java("java.lang.System");
>   print "Java version=3D".$system->getProperty("java.version")." <br>\n";
>   print "Java vendor=3D".$system->getProperty("java.vendor")." <p>\n\n";
>   print "OS=3D".$system->getProperty("os.name")." ".
>               $system->getProperty("os.version")." on ".
>               $system->getProperty("os.arch")." <br>\n";
>   $formatter =3D new Java("java.text.SimpleDateFormat","EEEE,
>         MMMM dd, yyyy 'at' h:mm:ss a zzzz");
>   print $formatter->format(new Java("java.util.Date"))."\n";
> ?>
>=20
> As you see these are small request to the java system tho java borks on
> it.
>=20
> I took the following steps to try and get it working:
>=20
> 1) Compiled jdk1.3.1 from /usr/port/java/jdk13
> 2) Compiled apache13-modssl with LD_FLAGS=3D"-phthread -lc_r"
> 3) Compiled www/modphp4 with --with-java=3D/usr/local/jdk1.3.1
>=20
> Did a the following export before compiling to be sure it takes the
> green_threads.
> export THREADS_FLAG=3Dgreen
>=20
> 4) set extra ldconfig_paths in rc.conf:
>=20
> ldconfig_paths=3D"/usr/lib/compat /usr/X11R6/lib /usr/local/lib
> /usr/local/jdk1.3.1/jre/lib/i386"
>=20
> gave the server a reboot
>=20
> 5) set the following paths in shell enviroment:
>=20
> export LD_LIBRARY_PATH=3D/usr/local/lib:/usr/lib:/usr/local/lib:/usr/loca=
l/lib/php:/usr/local/lib/php/20020429:/usr/local/jdk1.3.1/jre/lib:/usr/loca=
l/jdk1.3.1/jre/lib/i386:/usr/local/jdk1.3.1/i386/green_threads
>=20
> 6) Linked java.so to libphp_java.so
>=20
> cd /usr/local/lib/php/20020429 ; ln -s java.so libphp_java.so
>=20
> 7) checked the libraries:
>=20
> ldd /usr/local/lib/php/20020429/libphp_java.so:
>=20
> /usr/local/lib/php/20020429/libphp_java.so:
>         libcrypto.so.3 =3D> /usr/lib/libcrypto.so.3 (0x28109000)
>         libssl.so.3 =3D> /usr/lib/libssl.so.3 (0x28207000)
>=20
> 8) set the java class paths etc in php.ini:
>=20
> [java]
> java.class.path =3D
> /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 =3D /usr/local/jdk1.3.1
> java.library =3D /usr/local/jdk1.3.1/jre/lib/i386/libjava.so
> java.library.path =3D
> /usr/local/lib/php/20020429:/usr/local/jdk1.3.1/bin:/usr/local/jdk1.3.1/i=
386/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/j=
dk1.3.1/jre/lib/i386
> extension_dir=3D/usr/local/lib/php/20020429
> extension=3Dlibphp_java.so
>=20
> 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.
>=20
> 9) started apache and it gives me the Undefined Symbol.
>=20
> If i search on google on that Symbol it doesn`t get me far.
>=20
> 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.
>=20
> So i am kinda stuck at the moment.
>=20
> Hope any of u can help me out to solve this issue.
>=20
> With kind regards
>=20
> Matthew Whittaker-Williams
>=20
> --
> Unix System Administrator
>=20
> 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
>=20
> _______________________________________________
> freebsd-java@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-java
> To unsubscribe, send any mail to "freebsd-java-unsubscribe@freebsd.org"

For some extra information , the truss on apache :

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

With kind regards

Matthew Whittaker-Williams

--=20
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=_Mon__22_Dec_2003_12_18_17_+0100_hXK9aYe+W87ZAR=G
Content-Type: application/pgp-signature

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

iD8DBQE/5tMFjRFBDDry0LERAlUuAKCEKxJ0gZxEWEx/PB3kQ4j40PeifACcDfdi
hvqM82/gXohdWOue7ZdiSB4=
=bDIk
-----END PGP SIGNATURE-----

--Signature=_Mon__22_Dec_2003_12_18_17_+0100_hXK9aYe+W87ZAR=G--



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