|
From: <php...@li...> - 2009-06-02 03:21:00
|
I'm getting an error when running a simple bridge demo on CentOS with Apache. The problem is that the demo PHP code runs fine when piped into PHP (version 5.2.9) on the command line, but gives the following error when accessed via the web server:
protocol error: <O v=\"1\" m=\"java.lang.System\" p=\"O\" n=\"F\"/>, > required at col 8. Check the back end log for OutOfMemoryErrors.
I also see this warning in VMBridge.log:
"VMBridge WARNING: contextfactory: Orphaned context: ContextFactory: Context# 1@, credentials: null, SimpleContextFactory: class php.java.bridge. http.SimpleContextFactory, current loader: sun.misc.Launcher$AppClassLoader@77cde100 removed."
No OOM error is logged, and a check of free memory shows over 1GB available. The memory required by the demo app is trivial. We aren't running a J2EE container, instead running the Java app standalone per the FAQ. The Java version is 1.6. Here is the relevant line of Java code in our Main class:
static final php.java.bridge.JavaBridgeRunner runner = php.java.bridge.JavaBridgeRunner.getInstance("8087");
I can connect to the runner successfully on port 8087, and have configured the bridge to connect on that port.
The demo PHP code is:
<?php require_once("java/Java.inc"); echo java("java.lang.System")->getProperties(); ?>
As noted above, this code runs fine from the command line. The error only occurs when it's run through the web server.
Is there any other kind of problem besides an OOM error that could result in a protocol error such as this?
Thanks,
-Michael
|