php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #27151 Warning: java.lang.ClassNotFoundException
Submitted: 2004-02-04 14:18 UTC Modified: 2004-02-04 19:10 UTC
From: genius_cse at yahoo dot com Assigned:
Status: Not a bug Package: Java related
PHP Version: 4.3.4 OS: Windows XP SP1
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: genius_cse at yahoo dot com
New email:
PHP Version: OS:

 

 [2004-02-04 14:18 UTC] genius_cse at yahoo dot com
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


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-02-04 19:10 UTC] sniper@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

search the java/servlet related bug reports before you submit yet another report.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 21:01:29 2024 UTC