Re: Moving from a very old Tomcat to a new Tomcat.

2008-06-12 Thread André Warnier


Bill Davidson wrote:

Bill Barker wrote:
 This is correct. TC 3.2.4 never set the secure flag on that cookie,
 and TC 3.3.2 would only set it if you enabled an option in server.xml.
 This feature of TC is only on TC 4.0 and higher.

Thank you for confirming that.

I personally believe that this was a long but very interesting thread, 
containing a lot of information from the best authorities and otherwise 
difficult to gather and bring together intelligibly, about Tomcat's 
handling of authentication and HTTP/HTTPS sessions, session-id cookies 
under HTTP/HTTPS (and their changes over Tomcat versions), transmission 
over mod_jk of the HTTPS nature of the session, browser handling of 
secure/non-secure cookies, etc..
Might this not usefully be brought together in a FAQ or article, which 
itself would be easy to find in the future ?
With everyone's permission, I would offer to write a draft, but I 
wouldn't have a clue as to how or where to publish this.
Mind you, considering the scope, I can't even think of an appropriate 
title. Java Servlet Specification for Dummies ?


André


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Moving from a very old Tomcat to a new Tomcat.

2008-06-12 Thread Pid

André Warnier wrote:


Bill Davidson wrote:

Bill Barker wrote:
 This is correct. TC 3.2.4 never set the secure flag on that cookie,
 and TC 3.3.2 would only set it if you enabled an option in server.xml.
 This feature of TC is only on TC 4.0 and higher.

Thank you for confirming that.

I personally believe that this was a long but very interesting thread, 
containing a lot of information from the best authorities and otherwise 
difficult to gather and bring together intelligibly, about Tomcat's 
handling of authentication and HTTP/HTTPS sessions, session-id cookies 
under HTTP/HTTPS (and their changes over Tomcat versions), transmission 
over mod_jk of the HTTPS nature of the session, browser handling of 
secure/non-secure cookies, etc..
Might this not usefully be brought together in a FAQ or article, which 
itself would be easy to find in the future ?
With everyone's permission, I would offer to write a draft, but I 
wouldn't have a clue as to how or where to publish this.


Tomcat Wiki?

Mind you, considering the scope, I can't even think of an appropriate 
title. Java Servlet Specification for Dummies ?


André


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: JMX / jconsole for TOMCAT6.0.14

2008-06-12 Thread karthikn

Hi

After lot's permutation combination

export JAVA_HOME=/opt/java6
echo JAVA_HOME = $JAVA_HOME
export CATALINA_OPTS='-Dcom.sun.management.jmxremote.port=8999 
-Dcom.sun.management.jmxremote.ssl=false 
-Dcom.sun.management.jmxremote.authenticate=false'

echo CATALINA_OPTS = $CATALINA_OPTS






This Worked for me on UNIX 11i PA -RISC


bash-3.00$ ./startup.sh
JAVA_HOME = /opt/java6
CATALINA_OPTS = -Dcom.sun.management.jmxremote.port=8999 
-Dcom.sun.management.jmxremote.ssl=false 
-Dcom.sun.management.jmxremote.authenticate=false

Using CATALINA_BASE:   /infinet/karthik/TOMCAT6014
Using CATALINA_HOME:   /infinet/karthik/TOMCAT6014
Using CATALINA_TMPDIR: /infinet/karthik/TOMCAT6014/temp
Using JRE_HOME:   /opt/java6
bash-3.00$





Thx with regards
Karthik



Caldarale, Charles R wrote:

From: karthikn [mailto:[EMAIL PROTECTED]
Subject: JMX / jconsole for TOMCAT6.0.14

set CATALINA_OPTS=-Dcom.sun.management.jmxremote
   -Dcom.sun.management.jmxremote.port=8999
   -Dcom.sun.management.jmxremote.ssl=false
   -Dcom.sun.management.jmxremote.authenticate=false



Remove the quotes and put all the items on one line, separated by spaces.  
Also, since you're specifying a port, you do not need the plain 
-Dcom.sun.management.jmxremote parameter.

Depending on the shell you're using, you may or may not need to use set, or you may 
need to use export (without the quotes, of course).

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Moving from a very old Tomcat to a new Tomcat.

2008-06-12 Thread André Warnier



Pid wrote:

André Warnier wrote:



[...]

With everyone's permission, I would offer to write a draft, but I 
wouldn't have a clue as to how or where to publish this.


Tomcat Wiki?


Well, I must be too dumb even for that.
On the page http://wiki.apache.org/tomcat/HowTo , the first item is
quote

How do I add a question to this page?

Anyone may edit this page to add their own content. That is why this 
page is part of a Wiki and not a hardcoded static file in the FAQ.


unquote

However, in the upper left corner appears the legend Immutable page, 
and I don't seem to find any button, link or whatever allowing me to 
edit the page in question, add an item, whatever.


Am I using the wrong page ?

Thanks
André

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat 5.0.28 memory usage - garbage collection

2008-06-12 Thread tootbatoot

Hi Guys - Can you please help me understand behavior of 5.0.28 tomcat. When I
put load on it via my webapp - I can see the memory allocated to the process
going up (in task manager) but when I kill the session of the webapp (i.e.
remove the load) it does not come down.
Should not the tomcat process release memory when there is no load ?
thanks
-- 
View this message in context: 
http://www.nabble.com/Tomcat-5.0.28-memory-usage---garbage-collection-tp17800619p17800619.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 5.0.28 memory usage - garbage collection

2008-06-12 Thread Caldarale, Charles R
 From: tootbatoot [mailto:[EMAIL PROTECTED]
 Subject: Tomcat 5.0.28 memory usage - garbage collection

 When I put load on it via my webapp - I can see the memory
 allocated to the process going up (in task manager) but
 when I kill the session of the webapp (i.e. remove the load)
 it does not come down. Should not the tomcat process release
 memory when there is no load ?

In a word, no.  On most JVMs, once the virtual memory for the heap is allocated 
due to peak load, it stays allocated.  However, you didn't tell us if you're 
looking at real or virtual memory numbers; the real memory can fluctuate simply 
because the OS chooses to page some of it out.

You also didn't bother to tell us the JDK and OS you're using (likely some form 
of Windows), and your're running on an unsupported version of Tomcat.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 5.0.28 memory usage - garbage collection

2008-06-12 Thread tootbatoot

Thanks. Sorry for not including the environment info - here it is:
OS: Windows server 2003 SP1
jdk1.4.2_12
I am checking the numbers from task manager console and not sure whether
these are virtual or real ones? how to find this, thanks.
t


Caldarale, Charles R wrote:
 
 From: tootbatoot [mailto:[EMAIL PROTECTED]
 Subject: Tomcat 5.0.28 memory usage - garbage collection

 When I put load on it via my webapp - I can see the memory
 allocated to the process going up (in task manager) but
 when I kill the session of the webapp (i.e. remove the load)
 it does not come down. Should not the tomcat process release
 memory when there is no load ?
 
 In a word, no.  On most JVMs, once the virtual memory for the heap is
 allocated due to peak load, it stays allocated.  However, you didn't tell
 us if you're looking at real or virtual memory numbers; the real memory
 can fluctuate simply because the OS chooses to page some of it out.
 
 You also didn't bother to tell us the JDK and OS you're using (likely some
 form of Windows), and your're running on an unsupported version of Tomcat.
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the e-mail
 and its attachments from all computers.
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Tomcat-5.0.28-memory-usage---garbage-collection-tp17800619p17801715.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Moving from a very old Tomcat to a new Tomcat.

2008-06-12 Thread Steve Ochani
Date sent:  Thu, 12 Jun 2008 13:23:20 +0200
From:   André Warnier [EMAIL PROTECTED]
Subject:Re: Moving from a very old Tomcat to a new Tomcat.
To: Tomcat Users List users@tomcat.apache.org
Send reply to:  Tomcat Users List users@tomcat.apache.org



 Pid wrote:
  André Warnier wrote:
 
 [...]

  With everyone's permission, I would offer to write a draft, but I
  wouldn't have a clue as to how or where to publish this.
 
  Tomcat Wiki?
 
 Well, I must be too dumb even for that.
 On the page http://wiki.apache.org/tomcat/HowTo , the first item is
 quote

 How do I add a question to this page?

 Anyone may edit this page to add their own content. That is why this
 page is part of a Wiki and not a hardcoded static file in the FAQ.

 unquote

 However, in the upper left corner appears the legend Immutable page,
 and I don't seem to find any button, link or whatever allowing me to
 edit the page in question, add an item, whatever.

 Am I using the wrong page ?


If it's like most wikis you have to create an account first.



-Steve O.




 Thanks
 André

 -
 To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
 e-mail: [EMAIL PROTECTED] For additional commands,
 e-mail: [EMAIL PROTECTED]




-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



getAttribute(null)?

2008-06-12 Thread Leffingwell, Jonathan R CTR FRCSE, JAX 7.2.2
I have the following code that worked in Tomcat 5.0, but doesn't work in
Tomcat 5.5.26:

String formName = mapping.getAttribute();   // mapping is a variable of
type ActionMapping. In this scenario, formName is null.

if (null != session.getAttribute(formName)) {
session.removeAttribute(formName);
}


formName is null.  In Tomcat 5.0.x, no exception was thrown and
processing continued (as if passing a null argument to getAttribute
simply returned NULL).  In Tomcat 5.5.26, a ServletException is thrown
(with a NullPointerException).

I know how to code a work-around (and have done so), but is this
considered a bug in Tomcat?



RE: Tomcat 5.0.28 memory usage - garbage collection

2008-06-12 Thread Caldarale, Charles R
 From: tootbatoot [mailto:[EMAIL PROTECTED]
 Subject: RE: Tomcat 5.0.28 memory usage - garbage collection

 jdk1.4.2_12

I'd strongly recommend upgrading to a newer JVM.  1.6 especially is noticeably 
faster than 1.4 and includes better heap management.  You should upgrade Tomcat 
as well, for the similar reasons.

 I am checking the numbers from task manager console and
 not sure whether these are virtual or real ones?

While you have the Processes tab displayed, click on the View menu, then Select 
Columns.  Pick whatever you want to look at.  The memory entries that don't say 
virtual are refer to real memory usage.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 5.0.28 memory usage - garbage collection

2008-06-12 Thread Caldarale, Charles R
 From: Caldarale, Charles R [mailto:[EMAIL PROTECTED]
 Subject: RE: Tomcat 5.0.28 memory usage - garbage collection

 I'd strongly recommend upgrading to a newer JVM.  1.6
 especially is noticeably faster than 1.4 and includes better
 heap management.  You should upgrade Tomcat as well, for the
 similar reasons.

If you upgrade, you'll also have much better tools available (e.g., JConsole) 
to monitor the JVM and Tomcat.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



get rid of ViewExpiredException

2008-06-12 Thread dgreenbean

Hi,

I keep getting a ViewExpiredException when testing on my localhost.  I am
running Tomcat 6.0.16 inside Eclipse 3.3.2 with Myfaces 1.2.3 (JSF 1.2) and
Spring 2.5.4.

All I want to do is get rid of this exception.  I have restarted Tomcat,
cleared my browser cache, redeployed the webapp, cleaned the Tomcat working
directory, and rebooted my machine.  No combination of these seems to work.

I understand that before I get too far, I will need to implement some logic
for handling this exception correctly, but at the moment I just want to be
able to test everything else.

Does anyone know how to quickly and easily stop this exception from being
thrown every time I click anything in my webapp?

Thank you,
David
-- 
View this message in context: 
http://www.nabble.com/get-rid-of-ViewExpiredException-tp17802281p17802281.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 5.0.28 memory usage - garbage collection

2008-06-12 Thread tootbatoot

thanks.

The reason we have to stick to using this version is that it is recommended
by another application that tomcat is acting as a client to.

From your posts - I understand that the memory usage might show going up all
the time - and it will still be ok because it is showing the heap size of
jvm.



Caldarale, Charles R wrote:
 
 From: tootbatoot [mailto:[EMAIL PROTECTED]
 Subject: RE: Tomcat 5.0.28 memory usage - garbage collection

 jdk1.4.2_12
 
 I'd strongly recommend upgrading to a newer JVM.  1.6 especially is
 noticeably faster than 1.4 and includes better heap management.  You
 should upgrade Tomcat as well, for the similar reasons.
 
 I am checking the numbers from task manager console and
 not sure whether these are virtual or real ones?
 
 While you have the Processes tab displayed, click on the View menu, then
 Select Columns.  Pick whatever you want to look at.  The memory entries
 that don't say virtual are refer to real memory usage.
 
  - Chuck
 
 
 THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
 MATERIAL and is thus for use only by the intended recipient. If you
 received this in error, please contact the sender and delete the e-mail
 and its attachments from all computers.
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Tomcat-5.0.28-memory-usage---garbage-collection-tp17800619p17802394.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: getAttribute(null)?

2008-06-12 Thread Leffingwell, Jonathan R CTR FRCSE, JAX 7.2.2
It's not the why is formName null? that I'm worried about.  In this
case, it's supposed to be null.

What I want to know is this: Is a NullPointerException supposed to be
thrown if the argument name in session.getAttribute(name) is NULL?  If
such an exception IS supposed to be thrown, was this a change put into
Tomcat 5.5.x that wasn't in 5.0.x?


-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED] 
Sent: Thursday, June 12, 2008 11:24 AM
To: Leffingwell, Jonathan R CTR FRCSE, JAX 7.2.2
Subject: RE: getAttribute(null)?

At that point you're talking to the Struts 1.x Base class ActionConfig
getParameter method..

http://struts.apache.org/1.2.7/api/org/apache/struts/config/ActionConfig
.html#getParameter()
where JavaDoc for this parameter is defined as

public java.lang.String getParameter()

Return general purpose configuration parameter that can be used
to pass extra information to the Action instance selected by this
Action. Struts does not itself use this value in any way.

As of Struts 2.0.11
http://struts.apache.org/2.0.11.1/struts2-core/apidocs/org/apache/struts
2/dispatcher/mapper/ActionMapping.html

the getParameter() method has been refined e.g.

/** @return The extra parameters */
public java.util.Map getParams() {
return params;
}

relevant doc on java.util.Map
http://publib.boulder.ibm.com/infocenter/wsadhelp/v5r1m2/index.jsp?topic
=/com.sun.api.doc/java/util/Map.html

//code look something like
//assume the key for the form attribute will be called Form1 String
formKey=new String(Form1);

//And now to acquire the value for the Form1 key String value
=mapping.getParams().get(formKey);

Let me know if does'nt conform to your understanding..
HTH
Martin
__
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official
business of Sender. This transmission is of a confidential nature and
Sender does not endorse distribution to any party other than intended
recipient. Sender does not necessarily endorse content contained within
this transmission. 


 Subject: getAttribute(null)?
 Date: Thu, 12 Jun 2008 10:44:06 -0400
 From: [EMAIL PROTECTED]
 To: users@tomcat.apache.org
 
 I have the following code that worked in Tomcat 5.0, but doesn't work 
 in Tomcat 5.5.26:
 
 String formName = mapping.getAttribute(); // mapping is a variable of 
 type ActionMapping. In this scenario, formName is null.
 
 if (null != session.getAttribute(formName)) { 
 session.removeAttribute(formName);
 }
 
 
 formName is null. In Tomcat 5.0.x, no exception was thrown and 
 processing continued (as if passing a null argument to getAttribute 
 simply returned NULL). In Tomcat 5.5.26, a ServletException is thrown 
 (with a NullPointerException).
 
 I know how to code a work-around (and have done so), but is this 
 considered a bug in Tomcat?
 




Enjoy 5 GB of free, password-protected online storage. Get Windows Live
SkyDrive.
http://www.windowslive.com/skydrive/overview.html?ocid=TXT_TAGLM_WL_Ref
resh_skydrive_062008 

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: get rid of ViewExpiredException

2008-06-12 Thread dgreenbean

Switching from JBoss RichFaces 3.2.1.GA to 3.2.0.SR1 fixed the problem.  I
did not think this was relevant, but apparently, it is.


dgreenbean wrote:
 
 Hi,
 
 I keep getting a ViewExpiredException when testing on my localhost.  I am
 running Tomcat 6.0.16 inside Eclipse 3.3.2 with Myfaces 1.2.3 (JSF 1.2)
 and Spring 2.5.4.
 
 All I want to do is get rid of this exception.  I have restarted Tomcat,
 cleared my browser cache, redeployed the webapp, cleaned the Tomcat
 working directory, and rebooted my machine.  No combination of these seems
 to work.
 
 I understand that before I get too far, I will need to implement some
 logic for handling this exception correctly, but at the moment I just want
 to be able to test everything else.
 
 Does anyone know how to quickly and easily stop this exception from being
 thrown every time I click anything in my webapp?
 
 Thank you,
 David
 

-- 
View this message in context: 
http://www.nabble.com/get-rid-of-ViewExpiredException-tp17802281p17804902.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat 5.5.26 + JDK 6_05 - java.lang.OutOfMemoryError: PermGen Space

2008-06-12 Thread Estevam Henrique Portela Mota e Silva
Good Afternoon,

Who knows the problem of tomcat on the server.

Tomcat's war have 17 in my company
Memory (Initial memory pool: 512mb and Maximum memory pool: 1024mb)
Version:
 -- Tomcat 5.5.26
 -- JDK 6_05
Server:
 -- Gigabyte, Core 2 Duo and Memory 2 gb (motherboard has maximum of
memory is 2 gb)
Added:
 -- Isapi Redirector 1.2.14 on another server (IIS 5.0 and Win 2000)
Note:
 -- All programs are installed executable (EXE)

When I clicked generate PDF (Jasper) in my project, was wrong ... See below
pra

[ERROR] RequestExceptionHandler Processing of request failed with uncaught
exception: PermGen space
java.lang.OutOfMemoryError: PermGen Space

How resolved?

-- 
Regards,

Estevam Henrique Portela Mota e Silva
Handicapped Auditory = deaf
[EMAIL PROTECTED] / [EMAIL PROTECTED]
Programmer Java and Tapestry
Brazil - Fortaleza / CE


jk load balancing based upon ip address rather than session id

2008-06-12 Thread Simon Papillon
Hello,

I'm using jk 1.2.25 with tomcat 5.5.25 and apache 2.0 on one debian
box - 2.4.27-2-386 i686 GNU/Linux

I've set up 3 tomcat instances  that receive requests from  the jk
load balancer worker

I've implemented in the web application, a simple cross domain single
sign on (SSO)  mechanism.   This mechanism ties the different session ids in
any single container together, regardless if they've originated from
different domains, for example:
sub1.mydomain.com
sub2.yourdomain.com
sub3.hisdomain.co.uk

Hence when a user logs on this is then reflected in all the
different sessions that they might be in a particular container for
that user, from the serviced domains that they've visited.

This is fine when there is just one container.  But when there are
several all servicing requests in a load balanced context, it doesn't
work, because the session ids from different domains may be directed
to different tomcat instances / containers, which then breaks the
assumption that the SSO mechanism relies upon (that all sessions being
held in a single container).

The tomcat instances aren't in a distributed cluster and I'd like to
keep it that way.

My initial idea is to balance the traffic based upon the ip address
rather than the session id, thus I can be assured that all requests
from a particular ip address will hit the same container, and hence
the single sign on mechanism will work.  I realise that this would
give me a much less granular balancing profile.  I'd much prefer to do
this through the jk load balancer although as an alternative I could
do it through the balancer web app that comes with tomcat and
implement a Rule in java myself.

I'm open to other ideas that get the job done.

I've read the following:
http://tomcat.apache.org/connectors-doc/generic_howto/loadbalancers.html
http://tomcat.apache.org/connectors-doc/reference/workers.html
http://tomcat.apache.org/tomcat-5.5-doc/balancer-howto.html
http://venus.rainbow-it.net/manual/en/mod/mod_proxy.html

I've searched the forums as well,

I had a cheeky look at the source too for shits and giggles, but still no joy.
native/common/jk_lb_worker.c
seems like the get_most_suitable_worker function is very much driven
from the session id - I'm no a C programmer :-(

My question is has anyone already done this?  Is there a better way of
doing it that I'm missing, or should I basically just do it through
the balancer web in tomcat app and forego the jk load balancer, or
bite the bullet and make the tomcat containers a cluster.

Any suggestions / help would be very much appreciated
Cheers
Simon

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: getAttribute(null)?

2008-06-12 Thread Johnny Kewl


- Original Message - 
From: Leffingwell, Jonathan R CTR FRCSE, JAX 7.2.2 
[EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Thursday, June 12, 2008 4:44 PM
Subject: getAttribute(null)?


I have the following code that worked in Tomcat 5.0, but doesn't work in
Tomcat 5.5.26:

String formName = mapping.getAttribute();   // mapping is a variable of
type ActionMapping. In this scenario, formName is null.

if (null != session.getAttribute(formName)) {
session.removeAttribute(formName);
}


formName is null.  In Tomcat 5.0.x, no exception was thrown and
processing continued (as if passing a null argument to getAttribute
simply returned NULL).  In Tomcat 5.5.26, a ServletException is thrown
(with a NullPointerException).

I know how to code a work-around (and have done so), but is this
considered a bug in Tomcat?

==TEST==
This code
   HttpSession session = request.getSession(true);
   Object obj = session.getAttribute(null);

Raises this exception

java.lang.NullPointerException
java.util.Hashtable.get(Unknown Source)
org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:1024)
 
org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:110)
 NewServlet.processRequest(NewServlet.java:29) 
NewServlet.doGet(NewServlet.java:52) 
javax.servlet.http.HttpServlet.service(HttpServlet.java:690) 
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)The Hash Table is 
throwing it...I'm too young to remember 5 ;)But you maybe right, its possible 
that the internals used to use a Vector...and when Java introduced new 
collections, it changed.You may have spotted a little regression issue, but 
probably something thathasnt caught too many people.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 5.5.26 + JDK 6_05 - java.lang.OutOfMemoryError: PermGen Space

2008-06-12 Thread Caldarale, Charles R
 From: Estevam Henrique Portela Mota e Silva
 [mailto:[EMAIL PROTECTED]
 Subject: Tomcat 5.5.26 + JDK 6_05 -
 java.lang.OutOfMemoryError: PermGen Space

 Good Afternoon,

 Memory (Initial memory pool: 512mb and Maximum memory pool: 1024mb)
 Server:
  -- Gigabyte, Core 2 Duo and Memory 2 gb (motherboard

If you only have 1 GB of real memory, you'll need to reduce the JVM heap size 
to avoid page thrashing - it's not pretty when it happens.

 [ERROR] RequestExceptionHandler Processing of request failed
 with uncaught exception: PermGen space
 java.lang.OutOfMemoryError: PermGen Space

 How resolved?

This is a common problem, so reading the FAQ:
   http://wiki.apache.org/tomcat/FAQ/Memory
is always a good idea, as would searching the archives:
   http://marc.info/?l=tomcat-user

You may have a memory leak in your applications that's leaving class references 
lying around, preventing them from being discarded via garbage collection.  
Alternatively, if you really are running out of PermGen space, you'll have to 
increase it, which of course takes away from the real memory available for the 
rest of the heap.

Your current platform would have to be considered a toy these days, since even 
my 5-year old laptop has 2 GB of memory on it.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Farm War Deployer / Deploment Strategies

2008-06-12 Thread Theparanoidone Theparanoidone
Hola~

I'm looking for an efficient way to deploy a tomcat project to 2 or more tomcat 
servers simultaneously.

Changes to are tomcat project may affect the way it communicates with a 
database, and therefore we'd like to make sure the deployment takes place 
swiftly.

What are some of the better ways to deploy a project to multiple servers???



According to this link from 2007, the farm war deployer is broken... but it 
hints at other methods:
http://marc.info/?l=tomcat-userm=117345255505224w=2

It also seems to state it's still broken in the docs here:
http://tomcat.apache.org/tomcat-6.0-doc/config/cluster-deployer.html


What are some of the better ways to deploy a project to multiple servers???

Thoughts?





  

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Servlet navigation

2008-06-12 Thread James Rome
I am doing a project for a class of HS teachers in July, to teach them
the wonders of Java and NetBeans. I designed a set of servlets to let
them manage student grades. I am having them design the basic HTML in
NVU, and put it into the try blocks of the NB-generated processRequest
servlets, and then put it into out.println(...); blocks. I am using
Tomct.

I would use JSF myself, but I have no time to get into that, so I am
using forms and submit buttons to do the navigation.

So the first test is to see if the navigation works with the static HTML
servlet pages. When that works, I will put in the database queries. But
the navigation is not working for me. I changed the Project (classdata)
Run property in NB to point to login.

Here is the processRequest login code:
   response.setContentType(text/html;charset=UTF-8);
   PrintWriter out = response.getWriter();
   try {

   out.println(html);
   out.println(head);
   out.println(titleServlet login/title);   
out.println(/head);
   out.println(body);
   out.println(h1 style=\color: rgb(0, 102, 0);\
 +Student Grade Manager Login/h1
 + form method=\post\ action=\dataSelection\
name=\login\);
   out.println(h3User Name: input maxlength=\40\ size=\40\
  + name=\name\/h3br);
   out.println(h3Password: input maxlength=\40\ size=\40\
   + name=\password\ type=\password\/h3
   + input name=\Login\ value=\Login\
type=\submit\br);
   out.println(/body);
   out.println(/html);  } finally {
   out.flush();
   }

This displays, the debugger and html inspector show that it indeed calls
the servlet at classdata/dataSelection. Its processRequst code is:
 response.setContentType(text/html;charset=UTF-8);

 PrintWriter out = response.getWriter();

 try
 {
out.println(html);
out.println(head);
out.println(titleServlet dataSelection/title);
out.println(/head);
out.println(body);
out.println(
h1 style=\color: rgb(0, 102, 0);\Student Grade
Data/h1);
out.println(hr style=\width: 100%; height: 2px;\);
out.println(
form method=\post\ action=\studentData\ name=\User
Choice\);
out.println(h2Student Data/h2);
out.println(h3Student Name:input text=\\
name=\studentName\
+  type=\\/h3);
out.println(input name=\nameSubmit\ value=\Submit Name\
+  type=\submit\);
out.println(/form);
out.println(hr style=\width: 100%; height: 2px;\);
out.println(h2Class Data/h2);
out.println(
form method=\post\ action=\classData\
name=\classData\
+  input name=\classData\ value=\Get Class Data\
+  type=\submit\/form);
out.println(hr style=\width: 100%; height: 2px;\);
out.println(form method=\post\ action=\logout\
+  name=\Student Logout\input name=\logout\
+  value=\Logout\ type=\submit\br/form);
out.println(/body);
out.println(/html);
 }
 finally
 {
out.flush();
 }

But nothing displays! The login screen remains displayed. The browser
page source is blank.
And an initial navigation to the dataSelection URL is also blank.

What am I missing

Here is web.xml:
?xml version=1.0 encoding=UTF-8?
web-app version=2.5 xmlns=http://java.sun.com/xml/ns/javaee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
   servlet
   servlet-namelogin/servlet-name
   servlet-classARC08.login/servlet-class
   /servlet
   servlet
   servlet-namelogout/servlet-name
   servlet-classARC08.logout/servlet-class
   /servlet
   servlet
   servlet-nameclassData/servlet-name
   servlet-classARC08.classData/servlet-class
   /servlet
   servlet
   servlet-namestudentData/servlet-name
   servlet-classARC08.studentData/servlet-class
   /servlet
   servlet
   servlet-namedataSelection/servlet-name
   servlet-classARC08.dataSelection/servlet-class
   /servlet
   servlet-mapping
   servlet-namelogin/servlet-name
   url-pattern/login/url-pattern
   /servlet-mapping
   servlet-mapping
   servlet-namelogout/servlet-name
   url-pattern/logout/url-pattern
   /servlet-mapping
   servlet-mapping
   servlet-nameclassData/servlet-name
   url-pattern/classData/url-pattern
   /servlet-mapping
   servlet-mapping
   servlet-namestudentData/servlet-name
   url-pattern/studentData/url-pattern
   /servlet-mapping
   servlet-mapping
   servlet-namedataSelection/servlet-name
   url-pattern/dataSelection/url-pattern
   /servlet-mapping
   session-config
   session-timeout
   30
   /session-timeout
   /session-config
   /web-app

There is nothing in the Tomcat log file, 

Re: Servlet navigation

2008-06-12 Thread Hassan Schroeder
On Thu, Jun 12, 2008 at 12:16 PM, James Rome [EMAIL PROTECTED] wrote:
 I am doing a project for a class of HS teachers in July, to teach them
 the wonders of Java and NetBeans. I designed a set of servlets to let
 them manage student grades. I am having them design the basic HTML in
 NVU, and put it into the try blocks of the NB-generated processRequest
 servlets, and then put it into out.println(...); blocks.

e. :-)

You do know that it's considered better practice to use a separate
view technology like JSP, Velocity, Flex, whatever for display and
servlets only as controllers, right?

Makes life (and debugging) a lot easier, too :-)

FWIW,
-- 
Hassan Schroeder  [EMAIL PROTECTED]

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Please connect with me :)

2008-06-12 Thread Steve Burrus
Hi,

I looked for you on Reunion.com, but you weren't there. Please connect with me 
so we can keep in touch.
-Steve

Do You Know Steve?
YES - Connect with Steve, and see who's searching for you
http://www.reunion.com/showInviteRegistration.do?uid=264388147
NO - I don't know Steve
http://www.reunion.com/showInviteRegistration.do?unsub=trueuid=264388147[EMAIL
 PROTECTED]



Reunion.com - Find Everyone from Your Past. 
You have received this e-mail because a Reunion.com Member sent an invitation to
this e-mail address. For assistance, please refer to our FAQ or Contact Us. 
http://help.reunion.com/selfhelp?lid=2
Our Address: 2118 Wilshire Blvd., Box 1008, Santa Monica, CA 90403-5784

Please connect with me :)

2008-06-12 Thread Steve Burrus
Hi,

I looked for you on Reunion.com, but you weren't there. Please connect with me 
so we can keep in touch.
-Steve

Do You Know Steve?
YES - Connect with Steve, and see who's searching for you
http://www.reunion.com/showInviteRegistration.do?uid=264388147
NO - I don't know Steve
http://www.reunion.com/showInviteRegistration.do?unsub=trueuid=264388147[EMAIL
 PROTECTED]



Reunion.com - Find Everyone from Your Past. 
You have received this e-mail because a Reunion.com Member sent an invitation to
this e-mail address. For assistance, please refer to our FAQ or Contact Us. 
http://help.reunion.com/selfhelp?lid=2
Our Address: 2118 Wilshire Blvd., Box 1008, Santa Monica, CA 90403-5784

Re: Tomcat 5.0.28 memory usage - garbage collection

2008-06-12 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

tootbatoot wrote:
| The reason we have to stick to using this version is that it is
recommended
| by another application that tomcat is acting as a client to.

Do you mean that your (Tomcat-hosted) application is connecting to a
3rd-party application? If they are not running in the same JVM, there
should be no reason that different JVM versions cannot be used. The
3rd-party can use whatever they want (1.4?) while you run a newer version.

| From your posts - I understand that the memory usage might show going
up all
| the time - and it will still be ok because it is showing the heap size of
| jvm.

Yes. The JVM generally does not request memory from the OS and then give
it back, later. The JVM's memory usage for the Java heap (from the OS's
perspective) will only increase.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhRhkoACgkQ9CaO5/Lv0PA6FgCeOrSevoJ+S7MlJuBUMpfMIJrL
H9sAnRCXFHnikaIHkCb+Epj3FRj3q00M
=w52N
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: getAttribute(null)?

2008-06-12 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jonathan,

Leffingwell, Jonathan R CTR FRCSE, JAX 7.2.2 wrote:
| I have the following code that worked in Tomcat 5.0, but doesn't work in
| Tomcat 5.5.26:
|
| String formName = mapping.getAttribute();   // mapping is a variable of
| type ActionMapping. In this scenario, formName is null.

[snip]

| formName is null.  In Tomcat 5.0.x, no exception was thrown and
| processing continued (as if passing a null argument to getAttribute
| simply returned NULL).  In Tomcat 5.5.26, a ServletException is thrown
| (with a NullPointerException).
|
| I know how to code a work-around (and have done so), but is this
| considered a bug in Tomcat?

The servlet specification does not prohibit a NullPointerException from
being thrown, but it does seem like the method should probably return
null rather than throwing an NPE.

Could you post the stack trace of the exception?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhRh2IACgkQ9CaO5/Lv0PAOOgCfUWeV+OsSiqYjmkb24ueCduk4
BkMAn1bwrj3MldbyadbsKIWmPWrE9yVL
=IoqQ
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: jk load balancing based upon ip address rather than session id

2008-06-12 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Simon,

Simon Papillon wrote:
| when there are
| several all servicing requests in a load balanced context, it doesn't
| work, because the session ids from different domains may be directed
| to different tomcat instances / containers, which then breaks the
| assumption that the SSO mechanism relies upon (that all sessions being
| held in a single container).
|
| The tomcat instances aren't in a distributed cluster and I'd like to
| keep it that way.

Isn't this what sticky sessions are for? You get randomly assigned to
a server for your first request, and each subsequent request goes to
that same server (unless it goes down, in which case you have to
switch). This does not require distributable sessions.

Does that not solve your SSO requirement?

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhRiRMACgkQ9CaO5/Lv0PBzbwCgl5lX0EKRYqpjR040//ChN95O
sHAAnj4/xoTrHto0be4XjXWc6AAuUmn1
=LZXJ
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Any users with centralized logging?

2008-06-12 Thread Chris Pratt
Hi all,

Have a vanilla tomcat  coherence instance logging to local files--
CATALINA_BASE/logs and CACHE/logs.  I am implementing a central
logserver and want to get these into the syslog. 

I tried

tail -f [file log] | logger -p local#.info

but this resulted in each wrapped line occurring as a new syslog
message.  The tomcat and coherence events are rather long and can
include stack traces.  I want to keep the entirety of their events as a
single message event in syslog.

Has anyone faced and conquered a similar issue?  Thanks in advance.

Chris

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



java.lang.OutOfMemoryError: PermGen space

2008-06-12 Thread Shashidhar Rampally
Hey all,

I have deployed Alfresco (http://www.alfresco.com) on my
Apache2.0+modjk_Tomcat5.5.9 installation running on a Windows XP box.
Now, when I start Tomcat I get an OutOfMemoryError. I have searched a
lot and almost all posts say that I need to increase the heap space by
adding -Xms128m -Xmx512m to either JAVA_OPTS or CATALINA_OPTS
environment variable in the catalina.bat file. In my installation I do
not have a catalina.bat file at all! I do find catalina.policy and
catalina.properties files though in c:\Tomcat\conf directory. I tried
creating these variables in Windows Environment Variables but that did
not work.

Please advise!

Thanks,
Shashi

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



mapping tomcat to ip address behind router

2008-06-12 Thread illusion

Hey,

I want to set-up tomcat to serve http requests from behind a router.  When
there is a direct internet connection and no router, and the address
property is added and port number is changed in server.xml as below in
example 1, tomcat serves requests fine for http://99.153.32.456. 

When I set it up to run behind a router as show in example 2, with the
router forwarding requests to 192.168.0.54 which is the computer behind the
router with tomcat, it does not work for the url http://99.153.32.456.  What
is the correct way to set it tomcat behind a router?

thanks in advance for your assistance

Example 1 - no router - works

Connector port=80 protocol=HTTP/1.1 
   connectionTimeout=2 
   address=99.153.32.456
   redirectPort=8443 /
!-- A Connector using the shared thread pool--
!--
Connector executor=tomcatThreadPool
   port=80 protocol=HTTP/1.1
   address=99.153.32.456 
   connectionTimeout=2 
   redirectPort=8443 /
--   

Example 2 - behind router - does not work

Connector port=80 protocol=HTTP/1.1 
   connectionTimeout=2 
   address=192.168.0.54
   redirectPort=8443 /
!-- A Connector using the shared thread pool--
!--
Connector executor=tomcatThreadPool
   port=80 protocol=HTTP/1.1
   address=192.168.0.54 
   connectionTimeout=2 
   redirectPort=8443 /
--   


-- 
View this message in context: 
http://www.nabble.com/mapping-tomcat-to-ip-address-behind-router-tp17809837p17809837.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: java.lang.OutOfMemoryError: PermGen space

2008-06-12 Thread Caldarale, Charles R
 From: Shashidhar Rampally [mailto:[EMAIL PROTECTED]
 Subject: java.lang.OutOfMemoryError: PermGen space

 I need to increase the heap space by adding -Xms128m -Xmx512m
 to either JAVA_OPTS or CATALINA_OPTS environment variable

That won't help if you're running out of PermGen space.

 In my installation I do not have a catalina.bat file at all!

For some inexplicable reason, the .exe distribution does not include the 
scripts, but the .zip one does.  Regardless, since you're running Tomcat as a 
service, you can adjust the heap sizes and other JVM parameters with the 
tomcat5w.exe program.

Here's a posting from earlier today about the same problem:

This is a common problem, so reading the FAQ:
   http://wiki.apache.org/tomcat/FAQ/Memory
is always a good idea, as would searching the archives:
   http://marc.info/?l=tomcat-user

You may have a memory leak in your applications that's leaving class references 
lying around, preventing them from being discarded via garbage collection.  
Alternatively, if you really are running out of PermGen space, you'll have to 
increase it, which of course takes away from the real memory available for the 
rest of the heap.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: java.lang.OutOfMemoryError: PermGen space

2008-06-12 Thread Shashidhar Rampally
Thanks for the quick reply Chuck! I found java5w.exe immediately after
I sent the email. Increasing the heap did not solve my issue. I had to
increase the PermSize by setting -XX:MaxPermSize=256m

Now I am getting some IO and RMI exceptions. However, they are all
related to Alfrsco.

Thanks again!
Thanks,
Shashi

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: jk load balancing based upon ip address rather than session id

2008-06-12 Thread Simon Papillon
Hi Chris,

Thanks for the reply,

 Simon,

 Simon Papillon wrote:
 | when there are
 | several all servicing requests in a load balanced context, it doesn't
 | work, because the session ids from different domains may be directed
 | to different tomcat instances / containers, which then breaks the
 | assumption that the SSO mechanism relies upon (that all sessions being
 | held in a single container).
 |
 | The tomcat instances aren't in a distributed cluster and I'd like to
 | keep it that way.

 Isn't this what sticky sessions are for? You get randomly assigned to
 a server for your first request, and each subsequent request goes to
 that same server (unless it goes down, in which case you have to
 switch). This does not require distributable sessions.

 Does that not solve your SSO requirement?

 - -chris

Forgive me if I'm overlooking something, but as far as I understand
it, the sticky session mechanism is driven off the JSESSIONID that is
assigned by the tomcat container when a client first makes a request
that instigates a session creation, if no JSESSIONID cookie was sent
as part of the request the node is chosen according to the
worker.loadbalancer.method (Request, Session, Traffic, Busyness i
think Request is the default) .   Once a JSESSIONID has been set by a
container  the load balancer will then attach the JVMRoute onto the
end which will then be used by the jk load balancer in future requests
to determine the node to use to service the request.  e.g. if I have
three nodes (tomcatA, tomcatB, tomcatC) I could have the following
scenario...

child.first-domain.com : JSESSIONID = D75AA77AC6FBF43F2C2DDC195DDA6D44.tomcatC
doctor.second-domain.com : JSESSIONID = 5D211C177DFB064DEF731832CF07D693.tomcatA
nurse.third-domain.co.uk : JSESSIONID = E1EC672CAAA3F2F8348C2A23991DF46B.tomcatB

Where my browser has made three seperate requests for three seperate
resources, all serviced by the same group of tomcat containers through
vhosting, behind the load balancer, in which case my SSO mechanism
won't work as future requests on
child.first-domain.com, doctor.second-domain.com and
nurse.third-domain.co.uk will behandled by tomcatC, tomcatA and
tomcatB respectively.

As the SSO mechanism is based on the assumption that all requests from
the same browser are handled by the same container, this will break
the SSO,

Let me know if I'm misunderstanding some fundermental way in which the
jk load balancer works, or if I'm not explaing myself well,
Cheers
Simon

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: mapping tomcat to ip address behind router

2008-06-12 Thread Steve Ochani
On 12 Jun 2008 at 14:14, illusion wrote:

Date sent:  Thu, 12 Jun 2008 14:14:11 -0700 (PDT)
From:   illusion [EMAIL PROTECTED]
Subject:mapping tomcat to ip address behind router
To: users@tomcat.apache.org
Send reply to:  Tomcat Users List users@tomcat.apache.org

 
 Hey,
 
 I want to set-up tomcat to serve http requests from behind a router.
 When
 there is a direct internet connection and no router, and the
 address
 property is added and port number is changed in server.xml as below
 in
 example 1, tomcat serves requests fine for http://99.153.32.456. 
 
 When I set it up to run behind a router as show in example 2, with
 the
 router forwarding requests to 192.168.0.54 which is the computer
 behind the
 router with tomcat, it does not work for the url
 http://99.153.32.456.  What
 is the correct way to set it tomcat behind a router?

Your ISP, like most others, blocks port 80 for home/non business connections. 
You will have 
to run tomcat on a non standard port such as 1. Keep in mind that running 
servers on 
your connection may violate the terms of service of your ISP.


-Steve O.




 
 thanks in advance for your assistance
 
 Example 1 - no router - works
 
 Connector port=80 protocol=HTTP/1.1 
connectionTimeout=2 
address=99.153.32.456
redirectPort=8443 /
 !-- A Connector using the shared thread pool--
 !--
 Connector executor=tomcatThreadPool
port=80 protocol=HTTP/1.1
address=99.153.32.456 
connectionTimeout=2 
redirectPort=8443 /
 --   
 
 Example 2 - behind router - does not work
 
 Connector port=80 protocol=HTTP/1.1 
connectionTimeout=2 
address=192.168.0.54
redirectPort=8443 /
 !-- A Connector using the shared thread pool--
 !--
 Connector executor=tomcatThreadPool
port=80 protocol=HTTP/1.1
address=192.168.0.54 
connectionTimeout=2 
redirectPort=8443 /
 --   
 
 
 -- 
 View this message in context:
 http://www.nabble.com/mapping-tomcat-to-ip-address-behind-router-tp1
 7809837p17809837.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.
 
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: mapping tomcat to ip address behind router

2008-06-12 Thread illusion

Hey,

I tried taking the address=192... portion out in the example 2 where
tomcat is behind a router and it made no difference.  In relation to port 80
being blocked, in example 1 above where there is no router, it works fine
when tested with the url with the ip address assigned by the ISP,
http://99.;, so port 80 is not being blocked.





   



-- 
View this message in context: 
http://www.nabble.com/mapping-tomcat-to-ip-address-behind-router-tp17809837p17811501.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: jk load balancing based upon ip address rather than session id

2008-06-12 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Simon,

Simon Papillon wrote:
| Forgive me if I'm overlooking something, but as far as I understand
| it, the sticky session mechanism is driven off the JSESSIONID that is
| assigned by the tomcat container when a client first makes a request
| that instigates a session creation, if no JSESSIONID cookie was sent
| as part of the request the node is chosen according to the
| worker.loadbalancer.method (Request, Session, Traffic, Busyness i
| think Request is the default).

I'm a little unclear on the details within mod_jk, but yes, that's the idea.

| Once a JSESSIONID has been set by a
| container  the load balancer will then attach the JVMRoute onto the
| end which will then be used by the jk load balancer in future requests
| to determine the node to use to service the request.  e.g. if I have
| three nodes (tomcatA, tomcatB, tomcatC) I could have the following
| scenario...
|
| child.first-domain.com : JSESSIONID =
D75AA77AC6FBF43F2C2DDC195DDA6D44.tomcatC
| doctor.second-domain.com : JSESSIONID =
5D211C177DFB064DEF731832CF07D693.tomcatA
| nurse.third-domain.co.uk : JSESSIONID =
E1EC672CAAA3F2F8348C2A23991DF46B.tomcatB

Hmm... I'm beginning to see the problem. That wasn't entirely clear from
your original post.

Since you want to use SSO, I'm assuming that you are running all three
(or more) applications in the same instance of Tomcat, even though there
are multiple instances of Tomcat at work (on separate servers, presumably).

The first request to each of these domain names does not include a
cookie because the domains do not match. Each initial request to the
distinct domains causes a fresh random choice amongst the servers, so
you are not likely to get lucky and have all your initial requests
randomly end up at the same server, and therefore SSO fails. :(

| Let me know if I'm misunderstanding some fundermental way in which the
| jk load balancer works, or if I'm not explaing myself well,

No, you were right... I just wasn't understanding your initial question.

So, really, it's not that you want to load balance based upon IP
address... you really want to predictably choose a member of the server
farm based upon some knowledge of the client such that, regardless of
the domain name used, the initial request (and therefore all the rest)
go to a particular member.

You may be able to do this, but you'll certainly have to hack mod_jk in
order to do it.

I believe there is a method in mod_jk that chooses the jvmRoute for the
first (JSESSIONID-less) request. If you were to modify that algorithm,
you could achieve your goal, here. I'm a little worried that you might
implement a fragile algorithm, though, and end up with an unbalanced
load balancer.

Do you have options other than using SSO?

Come to think of it... how does SSO work when you switch domains with
even a single server -- that is, without load balancing in the mix? I
would expect that, since you are switching domains, your browser would
not send a JSESSIONID cookie to the server, and thus you would not be
recognized as having an existing session.

??!

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhRqswACgkQ9CaO5/Lv0PDukQCeMKv8qpvuvKsag1AMLWqsaNSV
GA4An19MrUrE/FPRTGMpWvNSLgF5Zs3K
=n6yV
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: mapping tomcat to ip address behind router

2008-06-12 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Illusion,

illusion wrote:
| I tried taking the address=192... portion out in the example 2 where
| tomcat is behind a router and it made no difference.  In relation to
port 80
| being blocked, in example 1 above where there is no router, it works fine
| when tested with the url with the ip address assigned by the ISP,
| http://99.;, so port 80 is not being blocked.

If you really are talking about a router (and not a proxy, as Chuck
suggests), have you set up your router to forward requests to port 80 to
go to your internal IP address (192.168.0.54)? If not, there's no reason
to expect your router to automagically forward port 80 traffic to one
specific machine on your internal network.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhRrAUACgkQ9CaO5/Lv0PDNuwCguS7M60B1pIYsjM/2wTD9fcNm
yDoAnjVoQi0pBGqThx4wAKR2wACJjx/m
=OI9K
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: mapping tomcat to ip address behind router

2008-06-12 Thread illusion

Hey,

Yes I do have it setup to forward to port 80 of the internal ip address
192.  Not sure what I'm missing or have incorrect.

thanks for the suggestions
-- 
View this message in context: 
http://www.nabble.com/mapping-tomcat-to-ip-address-behind-router-tp17809837p17811853.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: mapping tomcat to ip address behind router

2008-06-12 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Illusion,

illusion wrote:
| Yes I do have it setup to forward to port 80 of the internal ip address
| 192.  Not sure what I'm missing or have incorrect.

Well, whatever the solution is, there's no need to specify the address
in server.xml unless you want to specify a single network interface for
your server. For the time being, you should leave that out.

Have you tried to hit your server from outside your network, or only
from inside? Some crappy routers don't properly route internal traffic
back into the internal network when you use the outside IP address
(though it is unlikely to be affecting you, here).

Just grasping at straws since your setup seems to be sane, yet the
observations are not. :(

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhRsYQACgkQ9CaO5/Lv0PCI/wCfYStwRI/0Q2hqs5J/Prt2ScSQ
978AoIn8z+22bMVgDvFcWI/kiYZIaaRG
=zGnZ
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



GlobalRequestProcessor get Response time?

2008-06-12 Thread ubekhet

Hi folks,

Sorry for insisting this question, but I want to know how I can 
monitoring the Response Time for all requests coming for specific port.


I used GlobalRequestProcessor and RequestProcessor for getting 
prcessingTime, but I not sure what's the differents between both. Which 
one I have to use for getting what I want?


Thanks in advance!

Regards

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: mapping tomcat to ip address behind router

2008-06-12 Thread Johnny Kewl


- Original Message - 
From: illusion [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Thursday, June 12, 2008 11:14 PM
Subject: mapping tomcat to ip address behind router




Hey,

I want to set-up tomcat to serve http requests from behind a router.  When
there is a direct internet connection and no router, and the address
property is added and port number is changed in server.xml as below in
example 1, tomcat serves requests fine for http://99.153.32.456.

When I set it up to run behind a router as show in example 2, with the
router forwarding requests to 192.168.0.54 which is the computer behind 
the
router with tomcat, it does not work for the url http://99.153.32.456. 
What

is the correct way to set it tomcat behind a router?

thanks in advance for your assistance

Example 1 - no router - works

Connector port=80 protocol=HTTP/1.1
  connectionTimeout=2
  address=99.153.32.456
  redirectPort=8443 /
   !-- A Connector using the shared thread pool--
   !--
   Connector executor=tomcatThreadPool
  port=80 protocol=HTTP/1.1
  address=99.153.32.456
  connectionTimeout=2
  redirectPort=8443 /
   --

Example 2 - behind router - does not work

Connector port=80 protocol=HTTP/1.1
  connectionTimeout=2
  address=192.168.0.54
  redirectPort=8443 /
   !-- A Connector using the shared thread pool--
   !--
   Connector executor=tomcatThreadPool
  port=80 protocol=HTTP/1.1
  address=192.168.0.54
  connectionTimeout=2
  redirectPort=8443 /
   --


illusion, you have now probably screwed up the TC config...
Reload the the standard TC config, and just change the 8080, to 80, dont 
touch other stuff for now.


Then google, I think you have one of those ADSL Nat Router things
Heres an article with someone else struggling along
http://sanzon.wordpress.com/2008/04/04/setting-up-web-server-behind-router-wrt54g2/

Whats probably screwing you up is even though you have it forwarding, the 
IP's internally are being dynamicly assigned, you have to give the server a 
fixed IP, typically this is not the ISP IP, its the machine IP, and then you 
need to check the machine and make sure its using your router as the 
gateway.


Its not really a TC thing, best thing is to look at the router name and 
google for it and web server.
These little box's now a days have some amazing functionality, so you need 
to find the manual for the thing.


You need to check the Dynamip DNS is not on, DHCP is not assinged to the 
server, the DNS discovery is set or on auto, the network masks are right 
etc.
If your SP supplied the router, they should know how to set the thing up, 
dont mention tomcat, its got nothing to do with it, just tell em its a web 
server on a machine if that works, TC will work.


And then learn to do things like ping a machine etc.

Have fun


---
HARBOR : http://www.kewlstuff.co.za/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm
---  



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



URL is null and HTTP 404 error when using FROM authentication

2008-06-12 Thread exkor
Hi

I have this wierd problem i am trying to sovle for a week now, and i
already have gray hair from this mess.
My setup is Apache 2.0, Tomcat 6.0, MySQL 5.0.

I am requesting a protected page in my application:
http://127.0.0.1/myapp/home.jsp

and it takes me to the login page:
http://127.0.0.1/myapp/index.jsp

I type in my username + password and hit login, and brought back to
the login page.
I tried filtering the problem by using BASIC authentication + using
tomcat-users.xml which worked out fine.
FORM + tomcat-users.xml did not work out.

I am totally lost and begining to think that this is some kind of a
bug in j_security_check.
I saw somebody had a very very similar problem but I did not catche
the solution:
http://mail-archives.apache.org/mod_mbox/tomcat-users/200705.mbox/[EMAIL 
PROTECTED]

In addition I enabled combined logging and this is what I see:
127.0.0.1 - - [13/Jun/2008:00:32:45 -0400] GET /hamula/home.jsp
HTTP/1.1 200 2250 null Mozilla/4.0 (compatible; MSIE 6.0; Windows
NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR
3.0.04506.30; InfoPath.1)
127.0.0.1 - - [13/Jun/2008:00:32:45 -0400] GET
/hamula/images/kubrickbgcolor.jpg HTTP/1.1 404 1051
http://127.0.0.1:8080/hamula/home.jsp; Mozilla/4.0 (compatible; MSIE
6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET
CLR 3.0.04506.30; InfoPath.1)
127.0.0.1 - - [13/Jun/2008:00:32:49 -0400] POST
/hamula/j_security_check HTTP/1.1 200 2250
http://127.0.0.1:8080/hamula/home.jsp; Mozilla/4.0 (compatible; MSIE
6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET
CLR 3.0.04506.30; InfoPath.1)
127.0.0.1 - - [13/Jun/2008:00:32:49 -0400] GET
/hamula/images/kubrickbgcolor.jpg HTTP/1.1 404 1051
http://127.0.0.1:8080/hamula/j_security_check; Mozilla/4.0
(compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET
CLR 2.0.50727; .NET CLR 3.0.04506.30; InfoPath.1)


you can see that in the first entry i get null and then 404.
Why is it doing this??

My web.xml is:
?xml version=1.0 encoding=UTF-8?

!DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web
Application 2.3//EN http://java.sun.com/dtd/web-app_2_3.dtd;
web-app
   display-nameHamula/display-name
   distributable/
   servlet
   servlet-name/servlet-name
   display-name/display-name
   servlet-class/servlet-class
   load-on-startup0/load-on-startup
   /servlet

   welcome-file-list
   welcome-file
 home.jsp
   /welcome-file
   /welcome-file-list


   resource-ref
   descriptionDB Connection/description
   res-ref-namejdbc/hamula/res-ref-name
   res-typejavax.sql.DataSource/res-type
   res-authContainer/res-auth
   /resource-ref

   security-constraint
   web-resource-collection
   web-resource-nameHamula/web-resource-name
   descriptionPages accessible by registered users/description

   !-- PAGES ACCESIBLE ONLY BY REGISTERED USERS SHOULD BE
ADDED HERE --
   url-pattern/home.jsp/url-pattern
   url-pattern/events.jsp/url-pattern
   url-pattern/profile.jsp/url-pattern
   url-pattern/community.jsp/url-pattern
   !--
   THIS IS AN EXAMPLE OF A PATTERN TO MATCH MANY PAGES
   url-pattern/protected/*.jsp/url-pattern
  --
   !--
= --


   http-methodDELETE/http-method
   http-methodGET/http-method
   http-methodPOST/http-method
   http-methodPUT/http-method
   /web-resource-collection
   auth-constraint
   role-nameadmin/role-name
   role-namemanager/role-name
   /auth-constraint
   /security-constraint

   login-config
   auth-methodFORM/auth-method
   form-login-config
   form-login-page/index.jsp/form-login-page
   form-error-page/index.jsp/form-error-page
   /form-login-config
   /login-config

   security-role
   description
   The role that is required to access registered user functions and
   pages
   /description
   role-nameadmin/role-name
   /security-role
/web-app



My context.xml:
?xml version=1.0 encoding=UTF-8?
Context path=/hamula reloadable=true crossContext=true debug=99

   Logger className=org.apache.catalina.logger.FileLogger
prefix=localhost_hamula_log. suffix=.txt
timestamp=true/

   Resource name=jdbc/hamula
 auth=Container
 type=javax.sql.DataSource
 driverClassName=com.mysql.jdbc.Driver
 url=jdbc:mysql://localhost:3306/hamula?autoReconnect=true/
 username=root
 password=skywalker
 digest=MD5
 logAbandoned=true
 removeAbandoned=true
 removeAbandonedTimeout=10
 maxActive=20
 maxIdle=10
 maxWait=-1/


   Realm className=org.apache.catalina.realm.JDBCRealm
  driverName=com.mysql.jdbc.Driver
  

RE: URL is null and HTTP 404 error when using FROM authentication

2008-06-12 Thread Caldarale, Charles R
 From: exkor [mailto:[EMAIL PROTECTED]
 Subject: URL is null and HTTP 404 error when using FROM
 authentication

You have some weirdness in your web.xml and context.xml that should be 
straightened out before attempting any further analysis.

servlet
servlet-name/servlet-name
display-name/display-name
servlet-class/servlet-class
load-on-startup0/load-on-startup
/servlet

I have no idea what should be done with an empty servlet declaration, and 
it's possible Tomcat doesn't either; get rid of it.

auth-constraint
role-nameadmin/role-name
role-namemanager/role-name
/auth-constraint
...
security-role
role-nameadmin/role-name
/security-role

Either you have an extra role listed in auth-constraint, or you're missing 
one under security-role; get them in synch.

 My context.xml:

Where is your context.xml file?  It should be in your webapp's META-INF 
directory.  If you've changed the global one in Tomcat's conf directory, put it 
back the way it was and put your Context element in the proper location.

 Context path=/hamula reloadable=true crossContext=true
 debug=99

The path attribute is not allowed in a Context element in context.xml; remove 
it.

Logger className=org.apache.catalina.logger.FileLogger
 prefix=localhost_hamula_log. suffix=.txt
 timestamp=true/

There is no Logger element in Tomcat 6; remove it.

Resource name=jdbc/hamula
  auth=Container
  type=javax.sql.DataSource
  driverClassName=com.mysql.jdbc.Driver
 url=jdbc:mysql://localhost:3306/hamula?autoReconnect=true/
  username=root
  password=skywalker
  digest=MD5
  logAbandoned=true
  removeAbandoned=true
  removeAbandonedTimeout=10
  maxActive=20
  maxIdle=10
  maxWait=-1/

The above is obviously broken, since you have terminated the Resource element 
twice.  Regardless, it seems odd for the Realm and the application Resource 
to be using the exact same data base; is that what you really want?

Realm className=org.apache.catalina.realm.JDBCRealm

Change the Realm back to the MemoryRealm for testing with FORM login; once 
you get that working, then move on to the JDBCRealm.  One step at a time.

You say you have httpd 2.0 in the mix; don't use it for testing, go straight to 
Tomcat's http port.  Only after that works should you introduce any further 
complications.

All of the above may not to fix your problem, but it will remove some confusion 
from your situation.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]