ID:               18600
 Comment by:       rburke at ssss dot gouv dot qc dot ca
 Reported By:      nalves at equifax dot com dot br
 Status:           Open
 Bug Type:         Java related
 Operating System: Windows 2000
 PHP Version:      4.3.3 and 5.0.0-dev
 New Comment:

I do have the save problem, "Unable to Create Java Virtual Machine"
after about 30 sec.
Is there any solution ??????


Previous Comments:
------------------------------------------------------------------------

[2003-07-20 06:07:27] tan_ai_leen9 at hotmail dot com

Has this bug solved? What's the solutions?

------------------------------------------------------------------------

[2003-06-22 19:18:20] benj at puremourning dot co dot uk

hi all,

i just installed all the latest versions (php 4.3.2) and various forms
of the j2sdk (principally j2sdk 1.4.1_03) and i get the same problem.
Set up is Apache/1.3.27 (Win32) PHP/4.3.2 (on windows xp) php_java and
php_gd2 are the only extensions installed. Whenever i run a page with a
call to new Java() the first refresh works, but after roughly 30
seconds i must restart apache to get it to work.

has there been any updates on this? I am only experimenting with this
extension, but it would be a fantastic help if it worked reliably.

my java section of php.ini

[Java]
java.class.path = "H:\php\php-4.3.2-Win32\extensions\php_java.jar"
java.home = "C:\j2sdk1.4.1_03"
java.library = "C:\j2sdk1.4.1_03\jre\bin\server\jvm.dll"
java.library.path = "H:\php\php-4.3.2-Win32\extensions\"

i noticed somthing noone had looked into; i checked the mem usage of
apache.exe as i continually refreshed the (java) page, it climbed
steadily until it reached somthing like 15000K and then i got the
error, and with more refreshes the mem usage remained constant. however
after a while (as i ytped this) the mem usage climbed (with no
activity) by another 2000K where it is now static. i don't know if that
is useful, but it seems to me that its loaded a few too many JVMs and
not closed them.

kind regards

ben jackson

------------------------------------------------------------------------

[2003-06-19 17:19:18] dev2682 at hotmail dot com

Hi! all, 
I tried Java - PHP extension  with just simple java class which is
doing millon calculations. I haven't got any problem. And I was
thinking to use this extension for my new web project but, after
reading all these bugs I am not sure. So, please let me know how stable
this is??

I am using,
OS=Windows XP 5.1 on x86 , IIS 5, PHP 4.3.2 and 
java version 1.4.1_02 

Dev

------------------------------------------------------------------------

[2003-06-09 14:31:20] jlondon at mcg dot edu

Getting the same bug.  Running Win2k Server, IIS 5, php4.2.3,
jsdk1.4.1.  I read a while back that running as a CGI would eliminate
the error so I tried that but the performance hit was too much to bear
since I only used java on one page.  Did a little more searching and
came up with a little work around.  Still not perfect but takes much
longer to crash.  

$descriptorspec = array(
   0 => array("pipe", "r"),  // stdin is a pipe that the child will
read from
   1 => array("pipe", "w"),  // stdout is a pipe that the child will
write to
   2 => array("file", "/temp/error-output.txt", "a"), // stderr is a
file to write to
);

$process = proc_open("c:\\php\\cli\\php.exe", $descriptorspec,
$pipes);
if (is_resource($process))
{
        // $pipes now looks like this:
        // 0 => writeable handle connected to child stdin
        // 1 => readable handle connected to child stdout
        // Any error output will be appended to /tmp/error-output.txt

        $size = fwrite($pipes[0], "<? \$Login = new Java('CheckLogin'); echo
\$Login->CheckLogin('" . $username . "', '" . $password . "'); ?>");
        if(!fclose($pipes[0]))
                echo "There was an error closing the pipe";

        $result = fgets($pipes[1], $size + 1);
        fclose($pipes[1]);

        // It is important that you close any pipes before calling
        // proc_close in order to avoid a deadlock
        $return_value = proc_close($process);
}

Basically what I do is create a process and send it the lines of code I
would use to create and manipulate the java classes.  The process gives
me the output and I close the process.  It works pretty well and will
extend the "restart interval" from everytime the script runs to every
couple of days.

For those out there chasing this bug, my method fails on the
$return_value = proc_close($process); line.  Once it fails it will not
work again until IIS is restarted.  Until IIS is restarted the process
fails on $result = fgets($pipes[1], $size + 1); line.  Hope you get
this one fixed.  This could be a really powerful plugin.

-Jake

------------------------------------------------------------------------

[2003-06-04 21:37:36] jason at ipedo dot com

I meet this problem too.
Why should it recreate JVM?
Since it's module, I think it need only create JVM once.
In linux environment, althoug i don't meet the error, the preformence
is bad when system recreate JVM.
How can i disable recreating the JVM or decrease the frequence of
creating JVM?

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/18600

-- 
Edit this bug report at http://bugs.php.net/?id=18600&edit=1

Reply via email to