From: genius_cse at yahoo dot com Operating system: Windows XP SP1 PHP version: 4.3.4 PHP Bug Type: Java related Bug description: Warning: java.lang.ClassNotFoundException
Description: ------------ I am using: PHP 4.3.4, J2SDK1.4.2_01, Apache 1.3 with CGI Module Current php.ini configuration: ======================================================= extension_dir = c:\php\extensions extension=php_java.dll [java] java.class.path = "c:\php\extensions\php_java.jar; c:\myclasses\" java.home = c:\j2sdk1.4.2_01\bin java.library = c:\j2sdk1.4.2_01\jre\bin\server\jvm.dll java.library.path = c:\php\extensions ======================================================== - the above c:\myclasses\ as my custom java class directory. Reproduce code: --------------- //SalesTax.java import java.util.*; import java.text.*; public class SalesTax { public String SalesTax(double price, double salesTax) { double tax = price * salesTax; NumberFormat numberFormatter; numberFormatter = NumberFormat.getCurrencyInstance(); String priceOut = numberFormatter.format(price); String taxOut = numberFormatter.format(tax); numberFormatter = NumberFormat.getPercentInstance(); String salesTaxOut = numberFormatter.format(salesTax); String str = "A sales Tax of " + salesTaxOut + " on " + priceOut + " equals " + taxOut + "."; return str; } } =========================================================== in salestax.php calling : $salesTax = new Java("SalesTax"); =========================================================== my SalesTax.class is in c:\classes as specified in java.class.path Expected result: ---------------- Expected output will print out salesTaxOut, priceOut, taxOut values. Actual result: -------------- But i just got the following error message: Warning: java.lang.ClassNotFoundException: SalesTax in c:\Program Files\Apache Group\Apache\htdocs\myclasses\SalesTaxInterface.php on line 21 Fatal error: Call to a member function on a non-object in c:\Program Files\Apache Group\Apache\htdocs\myclasses\SalesTaxInterface.php on line 28 -- Edit bug report at http://bugs.php.net/?id=27151&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=27151&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=27151&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=27151&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=27151&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=27151&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=27151&r=needscript Try newer version: http://bugs.php.net/fix.php?id=27151&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=27151&r=support Expected behavior: http://bugs.php.net/fix.php?id=27151&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=27151&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=27151&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=27151&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=27151&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=27151&r=dst IIS Stability: http://bugs.php.net/fix.php?id=27151&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=27151&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=27151&r=float