#18600 [Com]: Unable to create Java Virtual Machine

2003-10-29 Thread robert at nospam dot com
 ID:   18600
 Comment by:   robert at nospam dot com
 Reported By:  nalves at equifax dot com dot br
 Status:   Bogus
 Bug Type: Java related
 Operating System: Windows 2000
 PHP Version:  4.3.3 and 5.0.0-dev
 New Comment:

Jdk 1.4.2_02
XP Pro - All patches

IIS 5.1 (ISAPI) - Same prob as described ..works once outta x tries
Apache 2.0.47 (mod_php) - No probs, works fine

Have following extensions enabled:
---
php_gd2
php_java
php_ldap
php_mssql
php_xslt


Previous Comments:


[2003-08-15 21:36:44] [EMAIL PROTECTED]

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. Because of this, we hope you add your comments
to the existing bug instead.

Thank you for your interest in PHP.

See bug #16690



[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-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

#18600 [Com]: Unable to create Java Virtual Machine

2003-10-29 Thread robert at nospam dot com
 ID:   18600
 Comment by:   robert at nospam dot com
 Reported By:  nalves at equifax dot com dot br
 Status:   Bogus
 Bug Type: Java related
 Operating System: Windows 2000
 PHP Version:  4.3.3 and 5.0.0-dev
 New Comment:

..ah yes,

This is under PHP 4.3.4RC2


Previous Comments:


[2003-10-29 09:16:41] robert at nospam dot com

Jdk 1.4.2_02
XP Pro - All patches

IIS 5.1 (ISAPI) - Same prob as described ..works once outta x tries
Apache 2.0.47 (mod_php) - No probs, works fine

Have following extensions enabled:
---
php_gd2
php_java
php_ldap
php_mssql
php_xslt



[2003-08-15 21:36:44] [EMAIL PROTECTED]

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. Because of this, we hope you add your comments
to the existing bug instead.

Thank you for your interest in PHP.

See bug #16690



[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-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