|
From: <php...@li...> - 2007-06-14 18:30:51
|
Hi Jonathan,
> problem most often when
> the Bridge is running in Tomcat.
ah, I think I've missed that information.
Do you use the GlobalPhpJavaServlet or do you have
only one JavaBridge.war web application?
Since version > 3.0.8 the PHP/Java Bridge used a class
loader cache, which means that there was only one
class loader for all shared web applications.
But this is only an issue if the is a JavaBridge.jar
in the global classpath, which is not the recommended
setup. From the FAQ of version 4.1.1:
-----------------------------------------
I have two different classes with the same name in two
different web apps. When using the
GlobalPhpJavaServlet, the bridge uses only one of
these classes!?!
This is a known bug in all PHP/Java Bridge versions <
4.1.0.
Please upgrade to a PHP/Java Bridge version >= 4.1.0
or use a PHP/Java Bridge version <= 3.0.8 and switch
off persistent connections:
java.persistent_connections=Off.
Since version 4.1.0, the PHP/Java Bridge correctly
uses the current thread context class loader so that,
when the Java.inc is loaded from a webApp, the class
loader from that web application is used. For example:
require_once("http://localhost:8080/webApp1/java/Java.inc");
echo java("my.TestClass")->getId(); // assuming that a
getId() procedure exists
=> TestClass of webApp1
require_once("http://localhost:8080/webApp2/java/Java.inc");
echo java("my.TestClass")->getId(); // assuming that a
getId() procedure exists
=> TestClass of webApp2
--------------------------------------
Do you have the JavaBridge.jar in the global
classpath?
> How do I configure
> the Tomcat-deployed
> Bridge to put its log file in the directory of my
> choosing?
Please start tomcat as follows (assuming you are
running tomcat under Linux):
export
JAVA_OPTS="-Dphp.java.bridge.default_log_level=4
-Dphp.java.bridge.default_log_file=/tmp/jb.log"
/opt/apache-tomcat/bin/catalina.sh start
Or please add log4j.jar to the global class path (for
example to /opt/jdk1.5/jre/lib/ext) and start the
log4j log viewer with the command:
java -cp /opt/jdk1.5/jre/lib/ext/log4j.jar
org.apache.log4j.chainsaw.Main
After you restart tomcat, the log will appear in the
log4j window, which allows you to search for certain
events etc.
Regards,
Jost Boekemeier
___________________________________________________________
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de
|