From: Edward H. <edw...@ya...> - 2005-09-24 01:40:07
|
Hi, I'm also wondering how instances are created and destroyed using java bridge. It seems to me (and from reading the docs) that when instances are created i.e. when u do smth like $newinstance=new java_class("java.lang.someclass"); This class and all variables/properties belonging to that class will never get destroyed? Is this correct? This is because I have a class and when I run JavaBridge.jar and execute the class for the first time it always works. But subsequent calls to that class will fail unless I shut down JavaBridge.jar (by terminating javaw.exe from Task Manager) and restart it again. And it also works when I call the java class from command prompt and calling it multiple times does not create any problem. The error that I'm getting is ArrayIndexOutofBounds Exception on one of the variables of the class. I'm just wondering if there is any difference calling java class from command prompt and calling it via the java bridge which can explain this behaviour. Thanks. --------------------------------- Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort. |
From: Jost B. <jos...@ya...> - 2005-09-24 13:33:33
|
Hi Edward, > This class and all variables/properties belonging to > that class will never get destroyed? the class is garbage collected when your VM has a class GC and this GC is called. In the standard configuration (64MB heap) the tests.php4/binaryData.php test triggers such a GC. This caching behaviour is intentional. Everything else (instance variables etc.) is destroyed after script execution. > This is because I have a class and when I run > JavaBridge.jar and execute the class for the first > time it always works. But subsequent calls to that > class will fail It is certainly possible to write a counter using a static variable so that a method call fails after some time. But I don't think this is a good programming practice. :) Can you please be more specific? If possible please set the java.log_level=4, create a bug report and attach the log up to the point where the problem occurs. (please see http://sourceforge.net/tracker/?func=add&group_id=117793&atid=679233) Regards, Jost Boekemeier ___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de |
From: Edward H. <edw...@ya...> - 2005-09-25 01:06:01
|
Hi, I was looking through other documentation and I saw the function java_reset() and I tried using that everytime I make a call to my Java class ande everything seems to be working fine now. I appreciate all the help you have given me and I think this Java-Bridge application is very helpful. Once again thanks, Ed Jost Boekemeier <jos...@ya...> wrote: Hi Edward, > This class and all variables/properties belonging to > that class will never get destroyed? the class is garbage collected when your VM has a class GC and this GC is called. In the standard configuration (64MB heap) the tests.php4/binaryData.php test triggers such a GC. This caching behaviour is intentional. Everything else (instance variables etc.) is destroyed after script execution. > This is because I have a class and when I run > JavaBridge.jar and execute the class for the first > time it always works. But subsequent calls to that > class will fail It is certainly possible to write a counter using a static variable so that a method call fails after some time. But I don't think this is a good programming practice. :) Can you please be more specific? If possible please set the java.log_level=4, create a bug report and attach the log up to the point where the problem occurs. (please see http://sourceforge.net/tracker/?func=add&group_id=117793&atid=679233) Regards, Jost Boekemeier ___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de --------------------------------- Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort. |
From: Jost B. <jos...@ya...> - 2005-09-25 11:10:10
|
Hi, > I was looking through other documentation and I saw > the function java_reset() and I tried using that > everytime I make a call to my Java class ande > everything seems to be working fine now. please do not use java_reset() in php scripts. java_reset() is a privileged procedure and should only be used by admins (after the setup or the libraries have changed for example). If possible set the log.level to 4 and check why the second call fails. If you can't find the problem yourself please create a bug report, please see http://sourceforge.net/tracker/?func=add&group_id=117793&atid=679233 Regards, Jost Boekemeier ___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de |
From: Edward H. <edw...@ya...> - 2005-09-25 13:47:24
|
Hi Jost, Thanks for the advice. I managed to find and fix the bug this morning which pertains to a static variable not being set correctly as you predicted. Just out of curiousity, what is the harm of using java_reset() unnecessarily (i.e. in the event that no libraries or setup files have been changed). This is so I can bear this in mind in the future if I happen to encounter a similar problem. Thanks very much for your assistance. Ed Jost Boekemeier <jos...@ya...> wrote: Hi, > I was looking through other documentation and I saw > the function java_reset() and I tried using that > everytime I make a call to my Java class ande > everything seems to be working fine now. please do not use java_reset() in php scripts. java_reset() is a privileged procedure and should only be used by admins (after the setup or the libraries have changed for example). If possible set the log.level to 4 and check why the second call fails. If you can't find the problem yourself please create a bug report, please see http://sourceforge.net/tracker/?func=add&group_id=117793&atid=679233 Regards, Jost Boekemeier ___________________________________________________________ Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de --------------------------------- Yahoo! for Good Click here to donate to the Hurricane Katrina relief effort. |
From: Jost B. <jos...@ya...> - 2005-09-26 17:52:11
|
Hi, > Just out of curiousity, what is the harm of using > java_reset() unnecessarily (i.e. in the event that > no libraries or setup files have been changed). if you use the standalone backend all your caches and all your session vars are gone. When the backend (JavaBridge.war) is running in a j2ee server, java_reset() does nothing. (j2ee servers have their own methods admin interfaces). Regards, Jost Boekemeier ___________________________________________________________ Was denken Sie über E-Mail? Wir hören auf Ihre Meinung: http://surveylink.yahoo.com/wix/p0379378.aspx |