php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #31336 Instanciating a java object using: new Java("...") gives an access violation
Submitted: 2004-12-29 18:01 UTC Modified: 2004-12-31 11:00 UTC
From: thx1011 at yahoo dot com Assigned:
Status: Closed Package: Java related
PHP Version: 5.0.3 OS: Win XP Pro 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: thx1011 at yahoo dot com
New email:
PHP Version: OS:

 

 [2004-12-29 18:01 UTC] thx1011 at yahoo dot com
Description:
------------
Configured Apache 2.0.51+PHP 5.0.3+JVM 1.4.2-b28 on Win XP pro sp1 (development machine)
Try to run simple sample.
Always have a crash with access violation on php.exe (running from command line) or running from Apache.

Already double checked all configuration. JVM seams to load fine (using filemon from sysinternals).

Already used jre from SDK with same results and using the client and server jvm.dll

From Apache already tried to run as a SAPI and CGI module. 
But running PHP in standalone mode gives the error, so it's not apache related.

Reproduce code:
---------------
<!doctype html public "-//W3C//DTD HTML 4.01//EN">

<html>

   <head>
      <title>Java test</title>
      <meta http-equiv="generator" content="PHP Designer 2005" />
   </head>

   <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">

<?

 $system = new Java("java.lang.System");


 echo "Java version: " . $system->getProperty('java.version') . "<BR><BR>";

 ?>


   </body>
</html>


 

Expected result:
----------------
A page with "JAva version: 1.4.2-b28"

Actual result:
--------------
Nothing. Just the first HTML lines, before instatianing the Java class.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-12-29 18:09 UTC] thx1011 at yahoo dot com
Also I've already tried the latest snapshot of PHP with the same results.

My PHP.ini entries:

extension=php_java.dll
[java]
java.class.path="C:\98.Server_Software\PHP\ext\php_java.jar"
java.home="C:\Progra~1\j2ee14SDK\jdk\jre\"
java.library="C:\Progra~1\j2ee14SDK\jdk\jre\bin\client\jvm.dll"
java.library.path="C:\98.Server_Software\PHP\ext"
extension_dir="C:\98.Server_Software\PHP\ext"
 [2004-12-31 11:00 UTC] thx1011 at yahoo dot com
It's simpler to use Tomcat and Apache Axis to build web services and then use PHP soap API to call the Java interface.

Much, much cleaner.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 09:01:27 2024 UTC