From owner-freebsd-java@FreeBSD.ORG Sun Dec 21 07:15:19 2003 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C25CA16A4CE for ; Sun, 21 Dec 2003 07:15:19 -0800 (PST) Received: from yellow-rose.iu.nl (yellow-rose.iu.nl [213.133.51.62]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2DFAA43D54 for ; Sun, 21 Dec 2003 07:15:15 -0800 (PST) (envelope-from m.whittaker-williams@iu.nl) Received: from groovebox.office.iu.nl ([10.0.1.5]) by iu.nl (iu.nl [10.0.1.3]) (MDaemon.PRO.v6.8.5.R) with ESMTP id 39-md50000000292.tmp for ; Sun, 21 Dec 2003 16:15:12 +0100 Received: by groovebox.office.iu.nl (Postfix, from userid 1005) id 3BCE338D; Sun, 21 Dec 2003 16:15:10 +0100 (CET) Date: Sun, 21 Dec 2003 16:15:10 +0100 From: Matthew Whittaker-Williams To: freebsd-java@freebsd.org Message-ID: <20031221151510.GA38275@iu.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-Spam-Processed: iu.nl, Sun, 21 Dec 2003 16:15:12 +0100 (not processed: message from valid local sender) X-MDRemoteIP: 10.0.1.5 X-Return-Path: m.whittaker-williams@iu.nl X-MDaemon-Deliver-To: freebsd-java@freebsd.org cc: m.whittaker-williams@iu.nl Subject: jdk1.3.1 with php4/apache1.3.x X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Dec 2003 15:15:20 -0000 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: getProperty("java.version")."
\n"; print "Java vendor=".$system->getProperty("java.vendor")."

\n\n"; print "OS=".$system->getProperty("os.name")." ". $system->getProperty("os.version")." on ". $system->getProperty("os.arch")."
\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. 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