From: <php...@li...> - 2007-09-07 20:39:22
|
Help! I ran into a bizarre problem that I simply don't understand. As soon as I include the PHP/Java bridge in my code (i.e. as soon as I include the following statement in my PHP file): ------------------------------ ... require_once('http://localhost:8080/JavaBridge/java/Java.inc');=20 ... ------------------------------ I am getting the following PHP error:=20 ------------------------------ Fatal error: Cannot redeclare java_last_exception_get() in http://localhost:8080/JavaBridge/java/Java.inc on line 1431 ------------------------------ Not only is the include done using "require_ONCE()" (capitalization here for emphasis only), but the Java.inc also is internally additionally guarded by: ------------------------------ <?php =20 if(!function_exists("java_get_base")) { ... function java_get_base() { ... } ... lost of stuff among them also: function java_last_exception_get() { ... } } ?> ------------------------------ So, IMHO it should NEVER EVER be possible that anything contained in this file is ever redeclared. And why is the error only at the function "java_last_exception_get(...)" which is somewhere after the middle of the file, while there are lots of other functions declared before it, which - if for some reason the file would indeed be re-read - should already cause errors much earlier... I simply don't understand what's going in here. Anyone who had similar encounters and/or can shed some light onto this? I am using this XAMPP v1.6.3a (a ready-packed combination of Apache v2.2.4 & PHP v5.2.3 & Zend Optimizer v3.3.0 & MySQL v5.0.45 - see http://www.apachefriends.org/en/xampp-windows.html) plus the Tomcat v6.10.13 -addon (on which I run the JavaBridge.war file). on WinXP Pro. Michael |
From: <php...@li...> - 2007-09-07 21:00:45
|
I believe I ran into the same error at one point. If I remember right, the way I fixed it was by removing the war file from Tomcat completely, deleting the folder named JavaBridge in the Tomcat folder (if this fails you'll need to restart first), then adding it back to the folder (thus deploying it and recreating the JavaBridge folder--effectively reinstalling the bridge) Also, make sure that PHP does NOT load the php_java extension. It doesn't need it and it may be where the function is already being declared. Hope this helps. --Nathan Shaskin Compliance Publishing php...@li... wrote: Help! I ran into a bizarre problem that I simply don't understand. As soon as I include the PHP/Java bridge in my code (i.e. as soon as I include the following statement in my PHP file): ------------------------------ ... require_once('http://localhost:8080/JavaBridge/java/Java.inc'); ... ------------------------------ I am getting the following PHP error: ------------------------------ Fatal error: Cannot redeclare java_last_exception_get() in http://localhost:8080/JavaBridge/java/Java.inc on line 1431 ------------------------------ Not only is the include done using "require_ONCE()" (capitalization here for emphasis only), but the Java.inc also is internally additionally guarded by: ------------------------------ if(!function_exists("java_get_base")) { ... function java_get_base() { ... } ... lost of stuff among them also: function java_last_exception_get() { ... } } ?> ------------------------------ So, IMHO it should NEVER EVER be possible that anything contained in this file is ever redeclared. And why is the error only at the function "java_last_exception_get(...)" which is somewhere after the middle of the file, while there are lots of other functions declared before it, which - if for some reason the file would indeed be re-read - should already cause errors much earlier... I simply don't understand what's going in here. Anyone who had similar encounters and/or can shed some light onto this? I am using this XAMPP v1.6.3a (a ready-packed combination of Apache v2.2.4 & PHP v5.2.3 & Zend Optimizer v3.3.0 & MySQL v5.0.45 - see http://www.apachefriends.org/en/xampp-windows.html) plus the Tomcat v6.10.13 -addon (on which I run the JavaBridge.war file). on WinXP Pro. Michael ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ php-java-bridge-users mailing list php...@li... https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users --------------------------------- Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. |
From: <php...@li...> - 2007-09-07 22:10:04
|
Bingo! Thank you so much!=20 The second part of you mail - disabling the php_java.dll - did the trick! I had enabled that before fully understanding, how this PHP/JavaBridge works (or actually I think, for an earlier version of the bridge (3.1.x?) it was even necessary) and had never thought about it any more, let alone realized that this is not only not required any more but can cause such adverse effects... This problem has costed me two days of desperate searching and I simply couldn't understand what was going on here. I definitely owe you a beer! Or several, actually!=20 Thanks again, Michael > -----Original Message----- > From: php...@li...=20 > [mailto:php...@li...]=20 > On Behalf Of php...@li... > Sent: Freitag, 7. September 2007 23:01 > To: php...@li... > Subject: Re: [Php-java-bridge-users] Strange "Cannot=20 > redeclare" errormessage... >=20 >=20 > I believe I ran into the same error at one point. If I=20 > remember right, the way I fixed it was by removing the war=20 > file from Tomcat completely, deleting the folder named=20 > JavaBridge in the Tomcat folder (if this fails you'll need to=20 > restart first), then adding it back to the folder (thus=20 > deploying it and recreating the JavaBridge=20 > folder--effectively reinstalling the bridge) >=20 > Also, make sure that PHP does NOT load the php_java=20 > extension. It doesn't need it and it may be where the=20 > function is already being declared. >=20 > Hope this helps. >=20 > --Nathan Shaskin > Compliance Publishing >=20 >=20 > php...@li... wrote: Help! I=20 > ran into a bizarre problem that I simply don't understand. >=20 > As soon as I include the PHP/Java bridge in my code (i.e. as=20 > soon as I include the following statement in my PHP file): > ------------------------------ > ... require_once('http://localhost:8080/JavaBridge/java/Java.inc');=20 > ... > ------------------------------ >=20 > I am getting the following PHP error:=20 > ------------------------------ > Fatal error: Cannot redeclare java_last_exception_get() in=20 > http://localhost:8080/JavaBridge/java/Java.inc on line 1431 > ------------------------------ >=20 > Not only is the include done using "require_ONCE()"=20 > (capitalization here for emphasis only), but the Java.inc=20 > also is internally additionally guarded by: > ------------------------------ > =20 > if(!function_exists("java_get_base")) { > ... > function java_get_base() { > ... > } > ... lost of stuff among them also: > function java_last_exception_get() { > ... > } > } > ?> > ------------------------------ >=20 > So, IMHO it should NEVER EVER be possible that anything=20 > contained in this file is ever redeclared. And why is the=20 > error only at the function "java_last_exception_get(...)"=20 > which is somewhere after the middle of the file, while there=20 > are lots of other functions declared before it, which - if=20 > for some reason the file would indeed be re-read - should=20 > already cause errors much earlier... >=20 > I simply don't understand what's going in here. Anyone who=20 > had similar encounters and/or can shed some light onto this? >=20 > I am using this XAMPP v1.6.3a (a ready-packed combination of=20 > Apache v2.2.4 & PHP v5.2.3 & Zend Optimizer v3.3.0 & MySQL=20 > v5.0.45 - see > http://www.apachefriends.org/en/xampp-windows.html) plus the=20 > Tomcat v6.10.13 -addon (on which I run the JavaBridge.war file). >=20 > on WinXP Pro. >=20 > Michael >=20 >=20 > -------------------------------------------------------------- > ----------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and=20 > a browser. Download your FREE copy of Splunk now >> =20 > http://get.splunk.com/ _______________________________________________ > php-java-bridge-users mailing list=20 > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users >=20 >=20 > =20 > --------------------------------- > Take the Internet to Go: Yahoo!Go puts the Internet in your=20 > pocket: mail, news, photos & more.=20 > -------------------------------------------------------------- > ----------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and=20 > a browser. Download your FREE copy of Splunk now >> =20 > http://get.splunk.com/ _______________________________________________ > php-java-bridge-users mailing list=20 > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users >=20 |
From: <php...@li...> - 2007-09-08 14:58:53
|
Hi, > Fatal error: Cannot redeclare java_last_exception_get() at the moment there are 5 other "php to java" bridges offering a similar API. One is proprietary code, two of them are obsolete, one is part of a proprietary J2EE application server and one is integrated into a PHP interpreter written in pure Java (http://www.projectzero.org/). Please try to run PHP without a php.ini file. If this works, please check your php.ini entries. Regards, Jost Boekemeier Wissenswertes für Bastler und Hobby Handwerker. BE A BETTER HEIMWERKER! www.yahoo.de/clever |