|
From: <php...@li...> - 2007-06-18 20:55:38
|
Hi, =20 There is something you could possibly help us with. We have a cluster = with two machines that have (tomcat 5.5.17), jdk1.5.0_06 and php 5.1.2 = each. Our web application uses php-java-bridge. We have noticed a weird = behavior though. When both instances of tomcat are running within 15 to = 30 min one of the tomcat instances stops responding and a browser window = where we are accessing our php application blacks out. Has anyone = experience a similar problem? We have not found exception in the log = files, so we have no clue what could be going on. Please let me know if = you need me to provide more information to help me find out what could = be causing the failure in the tomcat cluster. =20 Thank you very much in advance. |
|
From: <php...@li...> - 2007-06-25 13:31:30
|
When I attempt to access our php - java web app. I got:=20 Warning: JavaException::__toString() must return a string in Unknown on = line 0 Fatal error: Uncaught thrown in = E:\Tomcat5.5_2\webapps\chapter\includes\inc_top.php on line 3 On all pages, after a bit of moving aroung the pages. I saw in the stdout.log the following line: INFO: 380f83@8f57a <-- <E v=3D"1" m=3D"java.lang.Exception: Invoke = failed: [o(JavaBridge)]->getSession((String)null, (boolean)o(Boolean), = (int)o(Integer)). Cause: java.lang.NullPointerException: This context = 2@E%3A%5CTomcat5.5%5Cwebapps%5Cchapter doesn't have a session proxy. = Respon... Jun 21, 2007 11:53:28 AM org.apache.catalina.core.ApplicationContext log Could some one gide me on how to enable the session proxy for a php web = app, or where to find info about this, please?=20 Thank you very much again. |
|
From: <php...@li...> - 2007-06-27 11:36:03
|
Hi,
[please excuse the delay]
which implementation of the PHP/Java Bridge do you
use?
I have tested the pure PHP implementation and could
not reproduce this problem when running two cluster
nodes on the same machine.
Can you please open a problem report and attach the
following information to the ticket:
* which implementation do you use (C or PHP)
* if C: are persistent connections enabled
* if C: which PHP version
* the log from the back end (please start the nodes
with -Dphp.java.bridge.log_level=5)
We'll look at this issue asap.
> Could some one gide me on how to enable the session
> proxy for a php web app, or where to find info about
> this, please?
Your scripts must contain a statement:
$session = java_session()
at the beginning of your scripts (as usual).
If you use the pure PHP implementation, the PHP client
will first contact the servlet, obtain a session from
there and then switch to a (persistent-) Pipe- or
SocketContextServer .
The C implementation currently does not support a
cluster environment. As a workaround please use the
pure PHP implementation. Or, if you must use PHP4,
switch off java.persistent_connections in the php.ini
file and make sure that either the Pipe- or
SocketContextServer can be reached: The C
implementation uses HTTP PUT requests if it doesn't
receive a Servlet -> ContextRunner redirect. This code
is broken since version 2.0.8 and might be removed
from the C implementation.
Regards,
Jost Boekemeier
__________________________________ BE A BETTER INTERNET-GURU: Jetzt Frage stellen und einen von 44 iPods gewinnen! www.yahoo.de/clever
|
|
From: <php...@li...> - 2007-07-03 20:28:21
|
Hi Jost, I've opened a new ticket # 1747304. I've added the information you = requested and an extract of the log files. (The upload form did not = allowed me to add a file > 256KB). We will run it using the php version = instead of the c one and let you know how it goes.=20 Please let me know if you need any other information. Thank you very much for looking into this. |
|
From: <php...@li...> - 2007-07-04 15:03:25
|
Hi,
the RemoteContextFactory doesn't initially store a
session factory.
Why is that a remote context factory anyway, do you
run PHP on the Apache instance set up as the load
balancer? This cannot work.
The setup should look like:
internet --- Apache LB -- J2EE node 1 -- PHP
.................|--------- J2EE node 2 -- PHP
.................|---------...
or
internet --- Apache LB -- Apache+PHP 1 - J2EE node
1
...............|----------- Apache+PHP 2 - J2EE node
2
...............|-----------..
Regards,
Jost Boekemeier
__________________________________ BE A BETTER WELTENBUMMLER: Jetzt Frage stellen und einen von 44 iPods gewinnen! www.yahoo.de/clever
|
|
From: <php...@li...> - 2007-07-05 20:11:54
|
Hi Jost, We tested using the php implementation and we got the same exception = error. We think we have this set up: internet --- Apache LB -- J2EE node 1 -- PHP .................|--------- J2EE node 2 -- PHP .................|---------... Is there a parameter that enables the RemoteServletContextFactory? Or = how do we disable it? Please let us know, Thanks, |
|
From: <php...@li...> - 2007-07-09 14:51:22
|
Hi,
> the same exception error. We think we have this set
> up:
>
> internet --- Apache LB -- J2EE node 1 -- PHP
> .................|--------- J2EE node 2 -- PHP
this setup doesn't use a remote context factory.
Do you use a load balancer setup where the DNS server
is changing the official name of the nodes? When the
promiscuous option is enabled, the bridge uses the
official name to connect to itself.
> Is there a parameter that enables the
> RemoteServletContextFactory?
The remote factory is used when a PHP script running
on a remote host accesses the back end.
Either there's some problem with your setup or you (or
the frame work you use) allocate this factory.
But it is hard to tell, because you haven't raised the
bridge log level. All I see is the exception message
and the stack trace.
Regards,
Jost Boekemeier
__________________________________ BE A BETTER MEDIZINMANN: Jetzt Frage stellen und einen von 44 iPods gewinnen! www.yahoo.de/clever
|
|
From: <php...@li...> - 2007-06-19 08:52:13
|
Hi, I assume your setup is like this: http://www.onjava.com/pub/a/onjava/2004/03/31/clustering.html If I understand this correctly, the management node must detect the failure of one of the cluster nodes and switch it off. I haven't tested the bridge in a cluster environment (we should do this, though); the bridge is a standard web application so that the operation mode of the J2EE environment should be completely transparent. Which cluster algorithm do you use? Do you use sessions? How do you store the sessions? Regards, Jost Boekemeier __________________________________________________ Do You Yahoo!? Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen Massenmails. http://mail.yahoo.com |
|
From: <php...@li...> - 2007-06-28 15:56:53
|
Hi,
[please excuse the delay]
> of tomcat are running within 15 to 30 min one of the
> tomcat instances stops responding and a browser
I could reproduce something like this when running
2700 instances of the sessionSharing.jsp. The reason
for the failure was an OutOfMemoryError in the session
replicator.
> We have not found exception in the log files
I have started both instances with catalina.sh run,
the error message appeared in the console window.
However, I have attached the proposed tomcat cluster
howto that someone has asked for:
----------------------------------------------
Ho do I set up a tomcat cluster?
Download tomcat 5 or higher, a Java JRE 5 or higher
and the PHP/Java Bridge 4.1.5 or higher.
The following example uses two nodes running on two
machines called "carlos" and "diego". The web server
is running on a third machine which has full access to
both nodes (at least it needs access to the ports from
the range [9267, [9367).
On all nodes: Extract the tomcat distribution into a
directory.
On "diego" add the following to conf/server.xml:
<Cluster
className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
channelSendOptions="8">
<Manager
className="org.apache.catalina.ha.session.DeltaManager"
expireSessionsOnShutdown="false"
notifyListenersOnReplication="true"/>
<Channel
className="org.apache.catalina.tribes.group.GroupChannel">
<Receiver
className="org.apache.catalina.tribes.transport.nio.NioReceiver"
address="diego"
port="4000"
autoBind="100"
selectorTimeout="5000"
maxThreads="6"/>
</Channel>
</Cluster>
On "carlos" add the following to conf/server.xml:
<Cluster
className="org.apache.catalina.ha.tcp.SimpleTcpCluster"
channelSendOptions="8">
<Manager
className="org.apache.catalina.ha.session.DeltaManager"
expireSessionsOnShutdown="false"
notifyListenersOnReplication="true"/>
<Channel
className="org.apache.catalina.tribes.group.GroupChannel">
<Receiver
className="org.apache.catalina.tribes.transport.nio.NioReceiver"
address="carlos"
port="4000"
autoBind="100"
selectorTimeout="5000"
maxThreads="6"/>
</Channel>
</Cluster>
Copy the "JavaBridge.war" into the "webapps" directory
on "diego" and "carlos" and start both nodes. For
example with the command:
JAVA_OPTS="-Dphp.java.bridge.promiscuous=true"
JAVA_HOME=/opt/jdk1.5 bin/catalina.sh run
Start the web server on the third computer "timon".
For example with the command:
apachectl restart
Create a PHP script called "sessionSharing-diego.php"
and copy it into the web server document root (usually
"/var/www/html" or "~/public_html") on "timon":
<?php
require_once("http://diego:8080/JavaBridge/java/Java.inc");
$session = java_session();
if(is_null($session->get("counter")))
$session->put("counter", new
Java("java.lang.Integer", 1));
$counter = java_values($session->get("counter"));
print "HttpSession variable \"counter\":
$counter<br>\n";
$next = new Java("java.lang.Integer", $counter+1);
$session->put("counter", $next);
?>
Create a PHP script called "sessionSharing-carlos.php"
and copy it into the web server document root (usually
"/var/www/html" or "~/public_html") on "timon":
<?php
require_once("http://carlos:8080/JavaBridge/java/Java.inc");
$session = java_session();
if(is_null($session->get("counter")))
$session->put("counter", new
Java("java.lang.Integer", 1));
$counter = java_values($session->get("counter"));
print "HttpSession variable \"counter\":
$counter<br>\n";
$next = new Java("java.lang.Integer", $counter+1);
$session->put("counter", $next);
?>
Start a web brower and remove all cookies
Browse to http://timon/sessionSharing-carlos.php and
check the generated cookie. It should have the key
"JSESSIONID", host attribute "timon" and the path
attribute "/". The value should be "1". Click on the
browser refresh button to increase the value.
Use the same browser window and navigate to
http://timon/sessionSharing-diego.php and check if
there is still only one cookie with the same
attributes as before. The value should be "3"
Use the same browser window and navigate to
http://timon/sessionSharing-carlos.php and check if
there is still only one cookie with the same
attributes as before. The value should be "4".
Switch off "diego" and start it again.
Use the same browser window and navigate to
http://timon/sessionSharing-diego.php and check if
there is still only one cookie with the same
attributes as before. The value should be "5"
Switch off "carlos".
Use the same browser window and navigate to
http://timon/sessionSharing-carlos.php and check if
you get an exception.
Start "carlos".
Use the same browser window and navigate to
http://timon/sessionSharing-carlos.php and check if
there is still only one cookie with the same
attributes as before. The value should be "6"
Please see your HTTP server documentation how to set
it up as a load balancer. This differs from the
architecture described above in that the load balancer
forwards the requests to the nodes and the nodes run
PHP using the FastCGI mechanism.
---------------------------------------------------
Regards,
Jost Boekemeier
__________________________________ Die besten Tipps und Tricks fürs Grillen. BE A BETTER GRILLMEISTER! www.yahoo.de/clever
|