Sticky sessions with mod_jk and tomcat don't stick

2002-05-01 Thread Barry Roberts

I followed (I think the instructions) in this article:
http://www.ubeans.com/tomcat/index.html

I have Apache 1.3.20 on RedHat Linux 7.2.  One instance of tomcat 4.0.3
is  also running on that same machine using IBM's JDK 1.3.1.  The other
tomcat is 4.0.3 running on Sun's JDK 1.4 on Solaris 8 (sparc).  Each
server.xml has a unique jvmRoute attribute on the ajp Connector element.

But when I'm using my application it will "stick" to one tomcat server
for a while, then randomly hit the other.  Since my session isn't on
that server, my app sends me back to the login page.

Since that is a somewhat unfriendly user experience, I would really like
to get sticky sessions working correctly.  Anybody have any idea what I
could be doing wrong?

Thanks,
Barry Roberts



RE: Sticky sessions with mod_jk and tomcat don't stick

2002-05-01 Thread Barry Roberts

Oops.  Nevermind.  The jvmRoute goes on the Engine element, NOT the
Connector element.

Thanks anyway,
Barry Roberts


> -Original Message-
> From: Barry Roberts 
> Sent: Wednesday, May 01, 2002 3:55 PM
> To: [EMAIL PROTECTED]
> Subject: Sticky sessions with mod_jk and tomcat don't stick
> 
> 
> I followed (I think the instructions) in this article:
> http://www.ubeans.com/tomcat/index.html
> 
> I have Apache 1.3.20 on RedHat Linux 7.2.  One instance of 
> tomcat 4.0.3
> is  also running on that same machine using IBM's JDK 1.3.1.  
> The other
> tomcat is 4.0.3 running on Sun's JDK 1.4 on Solaris 8 (sparc).  Each
> server.xml has a unique jvmRoute attribute on the ajp 
> Connector element.
> 
> But when I'm using my application it will "stick" to one tomcat server
> for a while, then randomly hit the other.  Since my session isn't on
> that server, my app sends me back to the login page.
> 
> Since that is a somewhat unfriendly user experience, I would 
> really like
> to get sticky sessions working correctly.  Anybody have any 
> idea what I
> could be doing wrong?
> 
> Thanks,
> Barry Roberts
> 



Does anyone have in-memory session replication working?

2002-05-01 Thread Barry Roberts

I am trying to get in-memory session replication working as described
here:
http://www.filip.net/tomcat/tomcat-javagroups.html

Only it doesn't seem to be working for me.  I know the classes are
getting loaded (called) because if I try to set a session attribute with
a null value, ReplicatedSession throws an exception.

If I manually kill a tomcat server while logged in to my app on that
server, mod_jk sends me to the other but it appears the session isn't
there.

If anyone has gotten this working and has any ideas for me, I would
really appreciate it.

Thanks,
Barry Roberts



Newbie mod_webapp/Oracle/jndi question

2002-01-08 Thread Barry Roberts

I'm new to the jndi part of J2EE and to tomcat.  I have my app almost
working in tomcat, but it needs to use Oracle.  I have a sample
servlet that connects to the Oracle database just fine, but only if I
connect directly to the tomcat server's http connector.

If I hit the servlet (below) throught apache, the DataSource returned
is null.  But no exception is thrown by javax.naming* calls.  I have
played endlessly with my server.xml to get the oracle resource, and my
latest one is included below.

My main question is, how do I configure this to use Oracle using
mod_webapp?  I would also like to know if it is possible to configure
tomcat so that I can use it through apache AND directly through the
http connector.

Thanks in advance,
Barry Roberts









  

  
  























  
  

  
  

  

  

  

  

  

  

  
  





















  
 


  



  

  

  
  






  
  

  
  
  
  


  
  
  

  user
  *


  password
  *


  driverClassName
  oracle.jdbc.driver.OracleDriver


  driverName
  jdbc:oracle:thin:@192.168.2.60:1521:mhsdev1

  
  
  

  user
  *


  xactnet
  *


  driverClassName
  oracle.jdbc.driver.OracleDriver


  driverName
  jdbc:oracle:thin:@10.168.1.199:1521:xnt1

  
 
 



  



/* Modified from HelloWorldExample
 *
 */

import java.io.*;
import java.text.*;
import java.util.*;
import javax.naming.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.sql.DataSource;
import java.sql.*;


public class TestOracle extends HttpServlet {


public void doGet(HttpServletRequest request,
  HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();

out.println("");
out.println("");
out.println("Test Oracle Connection");
out.println("");
out.println("");
out.println("");

// note that all links are created to be relative. this
// ensures that we can move the web application that this
// servlet belongs to to a different place in the url
// tree and not have any harmful side effects.

// XXX
// making these absolute till we work out the
// addition of a PathInfo issue
try
{
InitialContext ic = new InitialContext();
if (ic == null) {
out.println("ic == null");
}
DataSource ds = (DataSource)ic.lookup("java:comp/env/Oracle");
if (ds == null) {
out.println("ds == null");
}
Connection conn = ds.getConnection();
if (conn == null) {
out.println("conn == null");
}
Statement stmt = conn.createStatement();

ResultSet rset = stmt.executeQuery("select * from configuration");
out.println("");
while (rset.next())
{
out.println("" + rset.getString(1) + "" + 
rset.getString(2)+"");
}
out.println("");
rset.close();
stmt.close();
conn.close();
}
catch (Exception ex)
{
out.println("");
ByteArrayOutputStream bytes = new ByteArrayOutputStream();
PrintStream exOut = new PrintStream(bytes);
System.setErr(exOut);
ex.printStackTrace();
out.println(bytes.toString());
exOut.close();
out.println("");
}   
out.println("");
out.println("");
out.println("");
out.println("");
}
}



--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>




mod_jk error with Apache 2.0.49

2004-05-25 Thread Barry Roberts
I'm trying to get mod_jk working with apache 2.0.49 built from source on
RedHat ES 3.0.  I've got the module built and in the modules directory,
and my httpd.conf contains:

LoadModule jk_module modules/mod_jk.so

JkWorkersFile /usr/local/apache2/conf/workers.properties
JkLogFile /var/log/mod_jk.log
JkLogLevel debug
JkMount /apps/* xsappa
JkMount /admin xsappa

This is towards the top of the file outside of any  or
 elements (I have also tried putting this at the bottom of
the file).

My workers.properties is:


worker.list=xsappa

worker.xsappa.port=139
worker.xsappa.host=192.168.2.42
worker.xsappa.type=ajp13
worker.xsappa.lbfactor=1

Every time I try to hit a servlet or jsp I get the following in my
mod_jk.log:
[Tue May 25 12:45:38 2004]  [jk_worker.c (136)]: wc_get_worker_for_name,
done did not found a worker

And of course a 500 in the browser.

The tomcat server works fine.  I can put jk2 into the web server and it
mostly works (I get "Broken Pipe" exceptions when I KNOW it's not a user
pressing cancel in the browser, but that's another issue).  I can hit
the tomcat server on port 8080 and it's just fine.

I can't use jk2 because of the spurious broken pipes, and now I can't
get jk1 working at all.  I have this suspicion that I'm missing
something obvious, but I can't find it.

Any help would be greatly appreciated.

Thanks,
Barry Roberts


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



Re: Réf. : mod_jk error with Apache 2.0.49

2004-05-26 Thread Barry Roberts
What do you mean the "right" one?  I built jk2 from the
jakarta-tomcat-connectors-jk2-src-current.tar.gz tarball.  Is that
"right"?

The problem I'm having with jk2 is a known issue
(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=28790).  I would love
to see that one figured out, but right now I would settle for just
getting jk1 to work.

I compiled a modified mod_jk.so and inside get_map (jk_map.c) the
jk_map_t* passed in is null.  That's why there's no worker found.  I
haven't had time to try and figure out what could cause it to be null.

Thanks,
Barry


On Wed, 2004-05-26 at 01:34, [EMAIL PROTECTED]
wrote:
> Barry,
> 
> make sure you have built the right jk module.
> 
> I've exactly the same config than you.
> Redhat ES 3.0, apache 2.0.49 jk2 and jboss 3.2.3 that
> comes with tomcat 3.2.3
> 
> my httpd.conf file  contains :
> LoadModule jk2_module modules/mod_jk2.so
> 
> JKSet config.file /opt/apachessl-2.0.49/inet/conf/workers2.properties
> 
> 
> the workers2 file may contains
> [shm]
> file=/var/log/apache/inet/jk2.shm
> [channel.socket:localhost:8009]
> port=8009
> host=127.0.0.1
> 
> [ajp13:localhost:8009]
> channel=channel.socket:localhost:8009
> 
> # Uri mapping
> 
> [uri:/apps/*]
> worker=ajp13:localhost:8009
> 
> and it works fine.
> _______
> NATEXIS ASSET MANAGEMENT
> Meissa SAKHO
> 01 58 19 45 71. . . . . . . . . . . . (84571)
> [EMAIL PROTECTED]
> 
> 
> 
> 
> Barry Roberts <[EMAIL PROTECTED]>
> 25/05/2004 21:14
> Veuillez rÃpondre à "Tomcat Users List"
> 
> 
> Pour :  [EMAIL PROTECTED]
> cc :
> Objet : mod_jk error with Apache 2.0.49
> 
> 
> I'm trying to get mod_jk working with apache 2.0.49 built from source on
> RedHat ES 3.0.  I've got the module built and in the modules directory,
> and my httpd.conf contains:
> 
> LoadModule jk_module modules/mod_jk.so
> 
> JkWorkersFile /usr/local/apache2/conf/workers.properties
> JkLogFile /var/log/mod_jk.log
> JkLogLevel debug
> JkMount /apps/* xsappa
> JkMount /admin xsappa
> 
> This is towards the top of the file outside of any  or
>  elements (I have also tried putting this at the bottom of
> the file).
> 
> My workers.properties is:
> 
> 
> worker.list=xsappa
> 
> worker.xsappa.port=139
> worker.xsappa.host=192.168.2.42
> worker.xsappa.type=ajp13
> worker.xsappa.lbfactor=1
> 
> Every time I try to hit a servlet or jsp I get the following in my
> mod_jk.log:
> [Tue May 25 12:45:38 2004]  [jk_worker.c (136)]: wc_get_worker_for_name,
> done did not found a worker
> 
> And of course a 500 in the browser.
> 
> The tomcat server works fine.  I can put jk2 into the web server and it
> mostly works (I get "Broken Pipe" exceptions when I KNOW it's not a user
> pressing cancel in the browser, but that's another issue).  I can hit
> the tomcat server on port 8080 and it's just fine.
> 
> I can't use jk2 because of the spurious broken pipes, and now I can't
> get jk1 working at all.  I have this suspicion that I'm missing
> something obvious, but I can't find it.
> 
> Any help would be greatly appreciated.
> 
> Thanks,
> Barry Roberts
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> 
> L'integrite de ce message n'etant pas assuree sur internet, Natexis
> Banques Populaires ne peut etre tenu responsable de
> son contenu. Toute utilisation ou diffusion non autorisee est
> interdite. Si vous n'etes pas destinataire de ce message, merci de le
> detruire et d'avertir l'expediteur.
> 
> The integrity of this message cannot be guaranteed
> on the Internet. Natexis Banques Populaires can not therefore be
> considered responsible for the contents.Any unauthorized use or dissemination is 
> prohibited.
> If you are not the intended recipient of this message, then please delete it and
> notify the sender.

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



Re: Réf. : Re: Réf. : mod_jk error with Apache 2.0.49

2004-05-27 Thread Barry Roberts
As I've stated in both my previous messages I've tried both and jk1 is
the one I really want to get to work.

On Thu, 2004-05-27 at 01:25, [EMAIL PROTECTED]
wrote:
> You've built jk2. that's ok. Your load instruction is not correct.
> your httpc.conf contains LoadModule jk_module modules/mod_jk.so
> instead ofLoadModule jk2_module modules/mod_jk2.so
> The set of instructions I send to you must work.

It does under VERY low load.  With any reasonable load I get "Broken
Pipe" messages in the tomcat log and pages that just never load.  Again,
this is a known issue that doesn't appear to have a resolution yet.

> You are using apache 2 and jk2. And the instructions you set
> are for jk (not jk2)

No, I'm using jk1.  I'm well aware of the difference. I've used both and
I've never gotten jk2 to work reliably under Linux or Solaris.  That's
why I would prefer jk1.  I only replied to you about jk2 because you
said that's what you're using.  My original message clearly states that
I've tried both.  I have a workers.properties and a workers2.properties,
and I have verified that I'm loading jk2/jk1 when I think I am (by the
log files) and that deleting the applicable .properties prevents apache
from starting.

> 
> 
> 
> Barry Roberts <[EMAIL PROTECTED]>
> 26/05/2004 17:54
> Veuillez rÃpondre à "Tomcat Users List"
> 
> 
> Pour :  Tomcat Users List <[EMAIL PROTECTED]>
> cc :
> Objet : Re: RÃf. : mod_jk error with Apache 2.0.49
> 
> 
> What do you mean the "right" one?  I built jk2 from the
> jakarta-tomcat-connectors-jk2-src-current.tar.gz tarball.  Is that
> "right"?
> 
> The problem I'm having with jk2 is a known issue
> (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=28790).  I would love
> to see that one figured out, but right now I would settle for just
> getting jk1 to work.
> 
> I compiled a modified mod_jk.so and inside get_map (jk_map.c) the
> jk_map_t* passed in is null.  That's why there's no worker found.  I
> haven't had time to try and figure out what could cause it to be null.
> 
> Thanks,
> Barry
> 
> 
> On Wed, 2004-05-26 at 01:34, [EMAIL PROTECTED]
> wrote:
> > Barry,
> >
> > make sure you have built the right jk module.
> >
> > I've exactly the same config than you.
> > Redhat ES 3.0, apache 2.0.49 jk2 and jboss 3.2.3 that
> > comes with tomcat 3.2.3
> >
> > my httpd.conf file  contains :
> > LoadModule jk2_module modules/mod_jk2.so
> > 
> > JKSet config.file /opt/apachessl-2.0.49/inet/conf/workers2.properties
> > 
> >
> > the workers2 file may contains
> > [shm]
> > file=/var/log/apache/inet/jk2.shm
> > [channel.socket:localhost:8009]
> > port=8009
> > host=127.0.0.1
> >
> > [ajp13:localhost:8009]
> > channel=channel.socket:localhost:8009
> >
> > # Uri mapping
> >
> > [uri:/apps/*]
> > worker=ajp13:localhost:8009
> >
> > and it works fine.
> > ___
> > NATEXIS ASSET MANAGEMENT
> > Meissa SAKHO
> > 01 58 19 45 71. . . . . . . . . . . . (84571)
> > [EMAIL PROTECTED]
> >
> >
> >
> >
> > Barry Roberts <[EMAIL PROTECTED]>
> > 25/05/2004 21:14
> > Veuillez rÃpondre à "Tomcat Users List"
> >
> >
> > Pour :  [EMAIL PROTECTED]
> > cc :
> > Objet : mod_jk error with Apache 2.0.49
> >
> >
> > I'm trying to get mod_jk working with apache 2.0.49 built from source on
> > RedHat ES 3.0.  I've got the module built and in the modules directory,
> > and my httpd.conf contains:
> >
> > LoadModule jk_module modules/mod_jk.so
> >
> > JkWorkersFile /usr/local/apache2/conf/workers.properties
> > JkLogFile /var/log/mod_jk.log
> > JkLogLevel debug
> > JkMount /apps/* xsappa
> > JkMount /admin xsappa
> >
> > This is towards the top of the file outside of any  or
> >  elements (I have also tried putting this at the bottom of
> > the file).
> >
> > My workers.properties is:
> >
> >
> > worker.list=xsappa
> >
> > worker.xsappa.port=139
> > worker.xsappa.host=192.168.2.42
> > worker.xsappa.type=ajp13
> > worker.xsappa.lbfactor=1
> >
> > Every time I try to hit a servlet or jsp I get the following in my
> > mod_jk.log:
> > [Tue May 25 12:45:38 2004]  [jk_worker.c (136)]: wc_get_worker_for_name,
> > done did not found a worker
> >
> > And of course a 500 in the browser.
&g

wc_get_worker_for_name, done did not found a worker - Plea for help

2004-06-01 Thread Barry Roberts
I'm getting desperate to get mod_jk working in apache on RHES 3 talking
to tomcat 5.0.19 on (another) RHES3.  I'm getting the error from the
subject line if I set JkLogLevel to "debug."  In the browser I see 500's
for ANY servlet.

I've tried the RHES3 apache2 rpms (httpd-2.0.46-25.ent), building
apache2 from source (2.0.49), building apache1 from source (1.3.31),
with mod_jk static or DSO.  Always the same thing.

I've played with the permissions on the workers.properties to world
readable, writable, and even executable.  I strace'd httpd and it
appears to successfully read the file (strace output below).

I even copied a known workers.properties from a production web server
(apache 2.0.43 built from source on Solaris) and it does the same
thing.  So I'm reasonably sure it's not a problem with the
workers.properties file itself.

I built mod_jk from the
jakarta-tomcat-connectors-jk-1.2-src-current.tar.gz tarball which
creates a jakarta-tomcat-connectors-jk-1.2.5-src directory.

I built my own version of mod_jk that logs in the map_get function in
jk_map.c and it appears that the map passed in the parameter jk_map_t *m
is null.  I've been trying to figure out why, and I'm just about stuck.

I have also tried mod_jk2 (with a workers2.properties) and it works
under low load.  Even with only 3 thread in siege I get "Broken Pipe"
errors in the tomcat logs and AjpGetReply errors in the jk logs.  I
think this is similar to bugs 28790 and/or 28532.  We also saw this in
our production servers, and our customers were seeing pages that just
never finished loading until we switched back to jk1.  So I could use
jk2 if I knew how to get around that, but jk1 would do, too.

Relevant (I think) strace output:

stat64("/usr/local/apache/conf/workers.properties",
{st_mode=S_IFREG|0777, st_size=788, ...}) = 0
read(3, "", 4096)   = 0
close(3)= 0
munmap(0xb75ea000, 4096)= 0

from httpd.conf:

JkWorkersFile   /usr/local/apache/conf/workers.properties
JkLogFile   /var/log/mod_jk-a13.log
JkLogLevel  debug
JkMount /apps/* lb

workers.properties:
worker.list=xsappa

worker.xsappa.port=139
worker.xsappa.host=192.168.2.40
worker.xsappa.type=ajp13
worker.xsappa.lbfactor=1


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



Re: wc_get_worker_for_name, done did not found a worker - Plea for help

2004-06-01 Thread Barry Roberts
Oops, I just noticed that I cut and pasted from two different places. 
My httpd.conf from apache1 is looking for a worker lb and the
workers.properties from apache2 doesn't have that.  Here are the correct
lines from the apache2 httpd.conf

JkWorkersFile   /usr/local/apache2/conf/workers.properties
JkLogFile   /var/log/mod_jk.log
JkLogLevel  debug
JkMount /apps/* xsappa
JkMount /admin xsappa

On Tue, 2004-06-01 at 09:37, Barry Roberts wrote:
> I'm getting desperate to get mod_jk working in apache on RHES 3 talking
> to tomcat 5.0.19 on (another) RHES3.  I'm getting the error from the
> subject line if I set JkLogLevel to "debug."  In the browser I see 500's
> for ANY servlet.
> 
> I've tried the RHES3 apache2 rpms (httpd-2.0.46-25.ent), building
> apache2 from source (2.0.49), building apache1 from source (1.3.31),
> with mod_jk static or DSO.  Always the same thing.
> 
> I've played with the permissions on the workers.properties to world
> readable, writable, and even executable.  I strace'd httpd and it
> appears to successfully read the file (strace output below).
> 
> I even copied a known workers.properties from a production web server
> (apache 2.0.43 built from source on Solaris) and it does the same
> thing.  So I'm reasonably sure it's not a problem with the
> workers.properties file itself.
> 
> I built mod_jk from the
> jakarta-tomcat-connectors-jk-1.2-src-current.tar.gz tarball which
> creates a jakarta-tomcat-connectors-jk-1.2.5-src directory.
> 
> I built my own version of mod_jk that logs in the map_get function in
> jk_map.c and it appears that the map passed in the parameter jk_map_t *m
> is null.  I've been trying to figure out why, and I'm just about stuck.
> 
> I have also tried mod_jk2 (with a workers2.properties) and it works
> under low load.  Even with only 3 thread in siege I get "Broken Pipe"
> errors in the tomcat logs and AjpGetReply errors in the jk logs.  I
> think this is similar to bugs 28790 and/or 28532.  We also saw this in
> our production servers, and our customers were seeing pages that just
> never finished loading until we switched back to jk1.  So I could use
> jk2 if I knew how to get around that, but jk1 would do, too.
> 
> Relevant (I think) strace output:
> 
> stat64("/usr/local/apache/conf/workers.properties",
> {st_mode=S_IFREG|0777, st_size=788, ...}) = 0
> read(3, "", 4096)   = 0
> close(3)= 0
> munmap(0xb75ea000, 4096)= 0
> 
> from httpd.conf:
> 
> JkWorkersFile /usr/local/apache/conf/workers.properties
> JkLogFile /var/log/mod_jk-a13.log
> JkLogLeveldebug
> JkMount   /apps/* lb
> 
> workers.properties:
> worker.list=xsappa
> 
> worker.xsappa.port=139
> worker.xsappa.host=192.168.2.40
> worker.xsappa.type=ajp13
> worker.xsappa.lbfactor=1
> 
> 
> -
> 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]