|
From: <php...@li...> - 2009-07-14 04:45:54
|
Jost-
Thanks again for the pile of tips. Based on your steps I was finally
able to isolate the problem.
In reality my situation was caused by a collision of lack of upgrade
docs with code that might not have been clean enough in the first
place. I'll tell you what happened, and ask that hopefully you can
amend the docs to prevent others from experiencing the same thing. It
literally took me and someone else about 10-12 hours of debugging over
4-5 debugging sessions to figure this out.
So, in PHP code we were doing something like:
$rs = $someJavaObject->getResultSet();
while ($rs->next()) {
// stuff
}
This works *fine* on java bridge v3.1.8. When we upgraded, it started
failing.
After installing turning on verbose debugging, we realized that the
script was actually executing in an infinite loop in that spot, which
is why it was eventually throwing a "php script timeout" error. The
debug logs allowed us to find the code shown above and realize that we
were in an infinite loop.
So why the sudden infinite loop bug?
> define ("JAVA_PREFER_VALUES", true);
> require_once('/usr/local/src/pjb/java/Java.inc');
Simply adding the JAVA_PREFER_VALES=true fixed the bug. That setting
doesn't seem to be documented anywhere. Nothing is mentioned about
anything special needing to be done to upgrade that I saw.
So, while I am very happy that we've solved our problem, I would still
like to know:
1) What exactly does JAVA_PREFER_VALES=true do?
2) Could you please add in an appropriate place in the docs something
about this setting and how it might be important when upgrading from
older versions. It would've saved me TONS of time and massive amounts
of frustration. In the end it has taken us 10-12 hours minimum off and
on for 3 weeks to solve this problem. I don't wish it on anyone else.
Thanks again for your help, without your advice we'd probably have
gone totally nuts by now.
Regards,
Alan
On Jun 20, 2009, at 2:44 AM, php-java-bridge-
us...@li... wrote:
> Hi,
>
>> bridge seems to be hanging... the first few calls will
>> work, then communication with the bridge becomes
>> interrupted and hangs the web server and
>> subsequent requests
>
> Since everybody uses the same channel w/o problems (servlet: uses
> inet:
> internally, see or faq), we need to find out what's so special with
> your
> setup and what "interrupted" and "hanging" really means.
>
> Possible causes:
>
> 1. You have migrated from 3.x to 5.x, which means that an old front
> end may
> try to communicate with the new back end. Please use the "Java.inc"
> shipped
> with the back end. You can raise the
> php.java.bridge.default_log_level to 4
> or above to observe the communication (details in faq or from java -
> jar
> JavaBridge.jar --help)
>
> 2. Your php version cannot execute the php code from Java.inc
> correctly.
> (Unlikely if you use php php 5.2, 5.3 or php 6.x).
>
> In any case, you can debug php with strace or gdb: for i in `pidof
> httpd`;
> do strace -s 1024 -ff -p $i >$i.log 2>&1 ;done traces all "httpd"
> instances
> running php and writes the system calls to $i.log.
>
> Or, slightly easier, as it uses only one executable:
>
> strace -s 1024 -ff `which httpd` -X
>
> My guess is that you use a 3.x front end, which expects an old
> response from
> the back end. The XML protocol has been revised from ver. 3.x to 5.x
> to not
> use unnecessary round-trips anymore.
>
> Regards,
> Jost Boekemeier
>
> 20. Jun 2009 1:21 vorm. schrieb am <
> php...@li...>:
>
>>> So then the "standalone" use is no longer >recommended or
>>> supported? > >
> It is still supported, o...
> Where, in the FAQ?
>
>> Example for the standalone container:
>>
>> java -Dphp.java.bridge.default_log_level=5 -jar JavaBridge.jar
>> SERVLET:8080
>
> This looks different from the previous docs, which were like:
>
>> $JAVA -server -Xmx1200m -jar $JAVA_BRIDGE_PATH INET_LOCAL:9676 3
>
>
> What is the final "3" for? And INET_LOCAL vs SERVLET? Are those java
> parameters, or arguments interpreted by the JavaBridge.jar executable?
>
> In any case is this form acceptable?
>
>> $JAVA -server -Xmx1200m -jar $JAVA_BRIDGE_PATH INET_LOCAL:9676 3
>
> If so, this is the form we're having trouble with. The bridge seems to
> be hanging... the first few calls will work, then communication with
> the bridge becomes interrupted and hangs the web server and subsequent
> requests.
>
> Any idea where to look first for errors? Nothing in the output from
> the Jar...
>
> Thanks,
>
> Alan
> ------------------------------------------------------------------------------
> Are you an op...
>
> php...@li...
>
> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
> ------------------------------------------------------------------------------
> Are you an open source citizen? Join us for the Open Source Bridge
> conference!
> Portland, OR, June 17-19. Two days of sessions, one day of
> unconference: $250.
> Need another reason to go? 24-hour hacker lounge. Register today!
> http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
|