Multithreading problems with the JK2 connector

2004-10-08 Thread jmorace
I've been seeing apache httpd processes consuming the processor, and I 
believe it has to do with multithreading issues in JK2.  I found the 
following bug in the database which seems to report exactly this problem.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=27667
The thread dump of the process shows something like this:
#0  apr_pool_cleanup_kill (p=0x816fad8, data=0x40622d90, cleanup_fn=0x4005a578 
socket_cleanup) at apr_pools.c:1910
#1  0x40061cda in apr_pool_cleanup_run (p=0x816fad8, data=0x40622d90, cleanup_fn=0x4005a578 
socket_cleanup) at apr_pools.c:1941
#2  0x4005a824 in apr_socket_close (thesocket=0x40622d90) at sockets.c:125
#3  0x4025b8b3 in jk2_channel_apr_close (env=0x8174618, ch=0x822f580, 
endpoint=0x40720b88) at ../../common/jk_channel_apr_socket.c:363
#4  0x40268ce6 in jk2_close_endpoint (env=0x8174618, ae=0x40720b88) at 
../../common/jk_worker_ajp13.c:250
#5  0x40269400 in jk2_worker_ajp13_forwardStream (env=0x8174618, worker=0x8231570, 
s=0x832c2b8, e=0x40720b88) at ../../common/jk_worker_ajp13.c:549
#6  0x40269688 in jk2_worker_ajp13_service1 (env=0x8174618, w=0x8231570, s=0x832c2b8, 
e=0x40720b88) at ../../common/jk_worker_ajp13.c:642
#7  0x40269b21 in jk2_worker_ajp13_service (env=0x8174618, w=0x8231570, s=0x832c2b8) 
at ../../common/jk_worker_ajp13.c:814
...
It seems that a cycle is created and it's getting stuck in 
apr_pool_cleanup_kill.  Has anyone else seen issues like this when using 
JK 2.0.2 or JK 2.0.4 with Apache 2.0.X?  Any suggestions for working 
around this problem or patches to the connector out there?

Thanks,
Jonathan
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


JK: Empty parameters stripped from the request

2004-01-28 Thread jmorace
Hi,

I've noticed that empty request parameters are being stripped as they
go through the JK connector.

For example, if I use the URL http://localhost/Test.jsp?a=1b=c=3, the
parameter b will be null.  When not going through the connector, the
parameter b is empty string.  I've tested this with iplanet using the JK
1.2.4 connector and on both Apache 1.3 and IIS using the JK 2.0.2
connector.

Has anyone else seen this problem?  Is there a way to prevent these
parameters from being stripped?

I've included a sample JSP page to demonstrate this error below.

Thanks,

Jonathan


 Test.jsp 

%-- Try going to this page with the URL http://localhost/Test.jsp?a=1b=c=3 --%
%@ page import=java.util.Enumeration %
html
%
  Enumeration parameterNames = request.getParameterNames();
  while (parameterNames.hasMoreElements()) {
  String parameterName = (String)parameterNames.nextElement();
  String[] parameterValues = request.getParameterValues(parameterName);
  String parameterValueString = parameterValues[0];
  for (int i = 1; i  parameterValues.length; i++) {
  parameterValueString += , ;
  parameterValueString += parameterValues[i];
  }
  out.println(parameterName +  =  + parameterValueString + br);
  }
%
/html

--

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



JK2: Sticky session problem

2004-01-28 Thread jmorace
Hi,

I was having a problems with my sessions not sticking to the correct web
server in a load balanced cluster.  If I set tomcatId/jvmRoute to a
value that does not contain a period, the problem goes away.  I'm using
Apache 2.0.47 with JK 2.0.2.

Has anyone else seend this?  Is this a known bug?

Thanks,

Jonathan

 Example error configuration 

# This configuration appears to fail because the jvmRoute becomes
# server.mydomain.com:8009 (contains . characters).

[shm:]
file=${serverRoot}/logs/jk2.shm
size=1048576

[lb:load_balancer]

[channel.socket:server.mydomain.com:8009]
port=8009
host=server.mydomain.com
group=load_balancer
lb_factor=1

[channel.socket:server.mydomain.com:8019]
port=8019
host=server.mydomain.com
group=load_balancer
lb_factor=1

[uri:/test/*]
group=lb:load_balancer

 Example working configuration (using localhost) 

# This configuration works because it constructs a jvmRoute that
# looks like localhost:8009 (no periods).

[shm:]
file=${serverRoot}/logs/jk2.shm
size=1048576

[lb:load_balancer]

[channel.socket:localhost:8009]
port=8009
host=localhost
group=load_balancer
lb_factor=1

[channel.socket:localhost:8019]
port=8019
host=localhost
group=load_balancer
lb_factor=1

[uri:/test/*]
group=lb:load_balancer

 Example working configuration (using tomcatId) 

# This configuration works because the tomcatId sets the jvmRoute
# to server1 (no periods).

[shm:]
file=${serverRoot}/logs/jk2.shm
size=1048576

[lb:load_balancer]

[channel.socket:server.mydomain.com:8009]
port=8009
host=server.mydomain.com
group=load_balancer
lb_factor=1
tomcatId=server1

[channel.socket:server.mydomain.com:8019]
port=8019
host=server.mydomain.com
group=load_balancer
lb_factor=1
tomcatId=server2

[uri:/test/*]
group=lb:load_balancer

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



JK2: Cannot configure to use port other than 8009

2004-01-20 Thread jmorace
I've been having trouble configuring JK2 (version 2.0.2) to connect to a
Jetty server on any port other than 8009.  I'm including the
workers2.properties file and the jk2.log.  I've had similar results on
both IIS and Apache 1.3.  Has anyone had any luck running on other ports?

The log below shows that it first tries to connect using port 8009 and
gets a Connection refused even though the configuration file specifies
another port (50101).  It then shows it trying to connect to the correct
port and still getting a Connection refused, but I'm pretty sure that is
bogus because I can telnet to that port and get a response.  When I start
Jetty on port 8009 instead (even with the below configuration) everything
works fine.

Any ideas?  Am I missing some configuration parameters?

Thanks,

Jonathan

 workers2.properties 

[logger:]
level=INFO

[shm:]
file=${serverRoot}/logs/jk2.shm
size=1048576

[lb:load_balancer]

[channel.socket:172.18.1.115:50101]
port=50101
host=172.18.1.115
group=load_balancer
lb_factor=1

[uri:/test/*]
group=lb:load_balancer

 jk2.log 

[Tue Jan 20 02:38:40 2004]  (error) [jk_channel_socket.c (335)]: channelSocket.open() 
connect failed 172.18.1.115:8009 146 Connection refused
[Tue Jan 20 02:38:40 2004]  (error) [jk_worker_ajp13.c (247)]: ajp13.connect() failed 
ajp13:172.18.1.115:50101
[Tue Jan 20 02:38:40 2004]  (error) [jk_worker_ajp13.c (322)]: ajp13.service() failed 
to connect endpoint errno=146 Connection refused
[Tue Jan 20 02:38:40 2004]  (error) [jk_worker_ajp13.c (512)]: ajp13.service() Error  
forwarding ajp13:172.18.1.115:50101 1 1
[Tue Jan 20 02:38:40 2004]  ( info) [jk_worker_ajp13.c (552)]: ajp13.done() close 
endpoint ajp13:172.18.1.115:50101 error_state 1
[Tue Jan 20 02:38:40 2004]  (error) [jk_worker_lb.c (402)]: lb.service() worker failed 
21000 for ajp13:172.18.1.115:50101
[Tue Jan 20 02:38:40 2004]  ( info) [jk_worker_lb.c (217)]: lb.getWorker() All workers 
in error state, use the one with oldest error
[Tue Jan 20 02:38:40 2004]  (error) [jk_channel_socket.c (335)]: channelSocket.open() 
connect failed 172.18.1.115:8009 146 Connection refused
[Tue Jan 20 02:38:40 2004]  (error) [jk_worker_ajp13.c (247)]: ajp13.connect() failed 
ajp13:172.18.1.115:50101
[Tue Jan 20 02:38:40 2004]  (error) [jk_worker_ajp13.c (322)]: ajp13.service() failed 
to connect endpoint errno=146 Connection refused
[Tue Jan 20 02:38:40 2004]  (error) [jk_worker_ajp13.c (512)]: ajp13.service() Error  
forwarding ajp13:172.18.1.115:50101 1 1
[Tue Jan 20 02:38:40 2004]  ( info) [jk_worker_ajp13.c (552)]: ajp13.done() close 
endpoint ajp13:172.18.1.115:50101 error_state 1
[Tue Jan 20 02:38:40 2004]  (error) [jk_worker_lb.c (402)]: lb.service() worker failed 
21000 for ajp13:172.18.1.115:50101
[Tue Jan 20 02:38:40 2004]  ( info) [jk_worker_lb.c (217)]: lb.getWorker() All workers 
in error state, use the one with oldest error
[Tue Jan 20 02:38:40 2004]  ( info) [jk_worker_lb.c (248)]: lb.getWorker() We tried 
all possible workers 2
[Tue Jan 20 02:38:40 2004]  (error) [jk_worker_lb.c (348)]: lb_worker.service() all 
workers in error or disabled state
[Tue Jan 20 02:38:40 2004]  (error) [mod_jk2.c (427)]: mod_jk.handler() Error 
connecting to tomcat 21000

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Mod JK2 - load balancing - sessions

2003-11-07 Thread jmorace
There is a configuration parameter for the load balancer called
stickySession, but it should be enabled by default.  You might want to
try setting it and seeing if it makes any difference.  The configuration
options are described at
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/configwebcom.html.

Are you sure the jsessionid cookie is set?

Jonathan

On Fri, 7 Nov 2003 [EMAIL PROTECTED] wrote:


I am testing load balancing configurations with two Tomcat instances on two
different hosts.

The Round Robbin dance works fine: when I connect with several seperate Browsers
instances I get approximately 50% time on one Tomcat instance or the other.

The problem is that I have the same behaviour when I simply reload my page in
the same Browser instance, jumping from one Tomcat instance to the other as if
no javax.servlet.http.HttpSession was defined (jsessionid).

I suspect some configurations are required to enable jk2 to keep trace of
javax.servlet.http.HttpSession but I did not find out how.

I use Apache 2.0.48 - Tomcat 4.1.29 - jk2-2.0.2 on RedHat Linx 9.0

Any hints or pointing to doc welcome

Patrick

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with mod_jk2

2003-11-05 Thread jmorace
On Wed, 5 Nov 2003, Andrew Davis wrote:

I've created a workers.properties file in
/usr/jakarta-tomcat-4.1.27/conf/jk. It looks like this:

   # Setting variables
   workers.tomcat_home=/usr/tomcat
   workers.java_home=/usr/java/j2sdk1.4.1_04
   ps=/
   worker.list=TomcatWorker1
   # Settings for TomcatWorker1 worker
   worker.TomcatWorker1.port=8009
   worker.TomcatWorker1.host=localhost
   worker.TomcatWorker1.type=ajp13

The syntax of the workers file is different for jk2.  It should be called
workers2.properties and be put in your apache conf directory.  The
documentation is a little light, but you can see the tomcat website for
some examples of what it should look like at
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/configwebex.html

Lastly, I've added the following to the end of my httpd.conf:

   # Load mod_jk2
   LoadModule jk2_module modules/mod_jk2.so

   # Configure mod_jk2
   JkWorkersFile /etc/httpd/conf/workers2.properties
   JkLogFile /var/log/httpd/mod_jk.log
   JkLogLevel info

   JkMount /usr/tomcat/webapps/Genvault/*.jsp TomcatWorker1

You don't need anything but the LoadModule line for jk2.  The other
stuff is configured in the workers2.properties file.  The documentation
for this is extremely light, but might be somewhat helpful.  Check
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/installhowto.html

Jonathan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Problem with mod_jk2

2003-11-05 Thread jmorace

On Wed, 5 Nov 2003, Andrew Davis wrote:

Thanks. That helps. I'm playing with the options now. I notice, however,
that in the examples at:
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jk2/jk2/configwebex.html
there are no options for specifying the path to java or tomcat anymore
as there were in the mod_jk workers.properties file. Is this oversight,
assumption, or is it simply no longer needed?

I believe you will only need the location of java and tomcat if you are
trying to do a JNI integration between them.  There is a more detailed
workers2.properties example in the
jakarta-tomcat-connectors-jk2-2.0.2-src/jk/conf directory of the source
bundle.  It has examples for setting up JNI startup, etc.  I haven't used
that feature, so I won't be able to offer that much help on it.

Jonathan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Apache cannot load jk2 (bis)

2003-10-28 Thread jmorace
Looks like you are trying to use the module built for Apache 1.3.27 with
an Apache 2 web server.  Try using the mod_jk2-2.0.43.dll binary instead.

Jonathan

On Tue, 28 Oct 2003, Jean-Max Estay wrote:

Hello,

I use the ${Apache2} in this mail for the path of my apache install
directory.

Using mod_jk2-1.3.27.dll to connect Apache2 (2.0.47 win 32) on Windows XP
Pro and Tomcat 4.1.27 on the same host,
The file mod_jk2-1.3.27.dll  is in ${Apache2}/modules
After creating the files stdout.log, stderr.log, jk2.shm,workers2.properties
Apache is running OK on port 80, Tomcat OK on 8080
When adding at the end of the Apache config file httpd.conf the lines
IfModule !mod_jk2.c
 LoadModule jk2_module modules/mod_jk2-1.3.27.dll
/IfModule
I have, when testing the apache config, the error message
JK2 : Cannot load ${Apache2}/modules/mod_jk2-1.3.27.dll into server: Le
module spécifié est introuvable.
(the required module was not found)

After reading many and many Howto, news and html pages, I don't find the
solution.
I try by changing the name to mod_jk2.dll (in both, http.conf and file
system).
I have administration rigths.
SSL module is not loaded

Who can help me ?

Dr Jean-Max Estay
[EMAIL PROTECTED]
http://www.ima.uco.fr/personnes/estay
Institut de Mathématiques Appliquées
Université Catholique de l'Ouest
44,46 rue Rabelais
BP 808
49008 ANGERS Cedex 01
France
tel +33 2 41 81 67 05
fax +33 2 41 81 67 00



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Configuring load balancing with the IIS JK 2.0.2 connectors

2003-10-21 Thread jmorace
I just setup a load balancing cluster using the IIS JK2 connector, and
spent a bit of time debugging a configuration issue.  According to the
example workers2.properties, a URI should map to a load balancer with
something that looks like the following.

  [uri:/examples1/*]
  group=lb_1

I found that this does not work, and resulted in the following messages
being logged.

  Debug: [jk_isapi_plugin.c (473)]:  HttpExtensionProc started
  Debug: [jk_isapi_plugin.c (482)]:  HttpExtensionProc could not get a worker for name 
lb_1
  Error: [jk_isapi_plugin.c (488)]:  HttpExtensionProc worker is NULL

When I changed the URI configuration to the following, it started working.

  [uri:/examples1/*]
  group=lb:lb_1

Is this an error in the sample configuration files, a bug in the JK
2.0.2 ISAPI plugin, or am I just doing something completely wrong?  Any
ideas?

Thanks,

Jonathan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]