Re: NIO connecter does not work after startup normally

2010-11-09 Thread Pid
On 09/11/2010 06:25, Ben Xiong wrote:
 
xmlns=http://java.sun.com/xml/ns/javaee;
 xmlns:web=http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;

web-app version 2.5

xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
 http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd;
id=WebApp_ID version=3.0

schema version 3.0

Not sure how much effect that'll have, but it should be fixed.


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: NIO connecter does not work after startup normally

2010-11-09 Thread Mark Thomas
On 09/11/2010 06:47, Ben Xiong wrote:
 ?I changed the call to req.startAsync() then it seems working.
 
 But why's that? what happend in req.startAsync(req, res) which does not
 happen in req.startAsync() ? Thank you.

A bug. It has been fixed in 7.0.x and will be included in 7.0.5 onwards.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Shutting down one instance of tomcat 6 from a listener

2010-11-09 Thread Patrick Sauts
Hello,

I'm working with tomcat 6 and multiples instances; I'm looking for a
solution to stop an instance of Tomcat from a listener. The purpose of this
listener is to load and check some configurations files such as Spring
configuration. Then, if an error is found, to stop this instance. On a
Tomcat with only one instance I was using System.exit(1), this solution
isn't good of course with multiples instances. 

What would be the best solution?

Thank you for your answers.




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Shutting down one instance of tomcat 6 from a listener

2010-11-09 Thread André Warnier

Patrick Sauts wrote:

Hello,

I'm working with tomcat 6 and multiples instances; I'm looking for a
solution to stop an instance of Tomcat from a listener. The purpose of this
listener is to load and check some configurations files such as Spring
configuration. Then, if an error is found, to stop this instance. On a
Tomcat with only one instance I was using System.exit(1), this solution
isn't good of course with multiples instances. 


Why not ? it should only stop the one JVM of this one instance, no ?
Or do you mean one instance with multiple Host's ?

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: [OT] Jconsole Perform GC?

2010-11-09 Thread Caldarale, Charles R
 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com] 
 Subject: [OT] Jconsole Perform GC?

 Anyone know what exactly what kind of GC the Perform GC 
 button in Jconsole does?

The same one you get by calling System.gc() - a full GC.

 The initial work was mostly in the Eden space and Survivor 
 spaces for most of the day, then suddenly, a big chunk 
 (nearly 4GB) ended up in the Old Gen space and pretty much
 stayed there all night.

Anything too big for the Eden space will be allocated directly in tenured.

 Looking at the other individual graphs showed that there had 
 been several instances of GC performed by the JVM during that
 time, but it took my manual instance to clear the Old Gen.

Those were minor collections, cleaning out only the Eden space.

 Is this just normal JVM GC processing?

Yes, that's completely normal.  The JVM will not do a major (full) GC unless it 
has to - or is forced by the API invocation.

 - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



EL works in JSP but not in tag files

2010-11-09 Thread Georg Lackermair


Hello everyone,

The problem is that EL expressions work well in JSPs, but get ignored in
custom tags. i found several related posts on the web, but none helped
me to solve this. On adding the line
%@ tag isELIgnored=false % i get the following error message:

Tag directive: illegal to have multiple occurrences of isELIgnored with
different values (old: true, new: false)

The tag file starts like this:

%@ tag isELIgnored=false %
%@ tag import=...%
%@ tag import=... %
%@ tag import=...%
%@ tag import=... %
%@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %
%@ taglib uri=http://java.sun.com/jsp/jstl/functions; prefix=fn %

%@ attribute name=article required=true type=...%
%@ attribute name=suggestedQuantity required=true
type=java.lang.Integer%
%@ taglib uri=/tags prefix=pref %

Our web.xml starts with the following lines:

?xml version=1.0 encoding=UTF-8?
web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xmlns=http://java.sun.com/xml/ns/javaee;
xmlns:web=http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
id=WebApp_ID version=2.5

I guess it is just some configuration issue, but i can't figure out what
the problem could be (maybe growing frustration prevents me from seeing
clearly). The error occured on tomcat 6.0.29 and
 tomcat 7.0.2. Hope that somebody could help me here.

Thanks in advance!

Cheers,

Georg

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Shutting down one instance of tomcat 6 from a listener

2010-11-09 Thread Patrick Sauts
What is happening is that the tomcat is becoming unstable with the exit(1). 
Each instance respond on the same host like 192.168.0.1/instance1 and
192.168.0.1/instance2 a Proxy(Squid) do the dispatch. 


-Original Message-
From: André Warnier [mailto:a...@ice-sa.com] 
Sent: mardi 9 novembre 2010 11:23
To: Tomcat Users List
Subject: Re: Shutting down one instance of tomcat 6 from a listener

Patrick Sauts wrote:
 Hello,
 
 I'm working with tomcat 6 and multiples instances; I'm looking for a 
 solution to stop an instance of Tomcat from a listener. The purpose of 
 this listener is to load and check some configurations files such as 
 Spring configuration. Then, if an error is found, to stop this 
 instance. On a Tomcat with only one instance I was using 
 System.exit(1), this solution isn't good of course with multiples
instances.
 
Why not ? it should only stop the one JVM of this one instance, no ?
Or do you mean one instance with multiple Host's ?

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: EL works in JSP but not in tag files

2010-11-09 Thread Mark Thomas
On 09/11/2010 12:15, Georg Lackermair wrote:
 
 Hello everyone,
 
 The problem is that EL expressions work well in JSPs, but get ignored in
 custom tags. i found several related posts on the web, but none helped
 me to solve this.

Tag files are always part of tag libraries - whether or not you define
an explicit TLD.

Tag libraries have a default JSP version that is not the same as the
servlet spec version defined in the web app.

Best guess: the default version is a JSP version that doesn't support
the EL you are trying to use. Tomcat recently got a lot stricter about
this in order to fix a handful of EL related bugs.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



setenv.sh in an individual tomcat catalina base

2010-11-09 Thread Ziggy
Hi guys,

At the moment i have several catalina bases configured with the following
directories,

conf logs server webapps work

The bin, lib and common directories are all still in $CATALINA_HOME.

I now need to add a setenv.sh file in the bin directory but i dont want it
to be used by all the catalina bases. I only want 2 out of the 4 catalina
bases to use the setenv.sh file.

To do this i am thinking of adding a bin directory on the catalina_base/bin
that i want to pick up the setenv.sh file. The bin directory will only
contain the setenv.sh file and nothing else. Everything else will still be
in $CATALINA_HOME/bin/ (ie. startup.sh catalina.sh shutdown.sh etc). This
means that some catalina bases will have /bin directories and some wont.

Are there any side effects to doing this? Can tomcat use both
$CATALINA_BASE/bin/ and $CATALINA_HOME/bin during startup?


Re: EL works in JSP but not in tag files

2010-11-09 Thread Georg Lackermair
Oh, this is embarrassing! Mark, thanks so much for the hint. The TLD 
begins with


taglib xmlns=http://java.sun.com/xml/ns/j2ee; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;


xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd;
version=2.0
tlib-version1.0/tlib-version
jsp-version1.2/jsp-version

which is obviously not correct. I set tlib-version to 1.2 and
jsp-version to 2.1. This solved it!

Cheers,

Georg





Tag files are always part of tag libraries - whether or not you define
an explicit TLD.

Tag libraries have a default JSP version that is not the same as the
servlet spec version defined in the web app.

Best guess: the default version is a JSP version that doesn't support
the EL you are trying to use. Tomcat recently got a lot stricter about
this in order to fix a handful of EL related bugs.

Mark


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



HTTP request and responses mixed up

2010-11-09 Thread Colpaert, Robert
Hi all,

 

We are currently experiencing an issue on our system where user A gets
the HTTP response intended for user B. In fact, user A and user B are
two completely different users that are logged on to our system. User A
and User B both a send a different request and then BOTH users get the
same response. This problem occurs sporadically and so far we have not
been to reproduce it.

 

Our setup is as follows:

We have a server that runs apache and acts as a reverse proxy to the
second apache on another server. Both these servers run Apache 2.2.9.
The apache on the second server includes the mod_jk module and this
server also runs a tomcat which routes the requests to our backend java
application.

 

Detail specification of the problem scenario:

In the web GUI, user A requests a list of customers and user B requests
a list of the current orders (these requests are be handled in different
servlets). User A receives the correct list of its customers, however
User B gets the same HTTP response!

 

We traced both requests through the entire chain of
apache/apache/tomcat/backend etc. and we see both requests (User A and
User B) in the logging of our first and second apache. These requests
are for completely different servlets, this rules out any coding
problems inside the servlet. The reason why we can correlate the HTTP
response of User A with the HTTP response User B receives, is the size
of the HTTP response in the apache logging.

 

We have looked through the change log of tomcat/apache and we have
searched many forums to see if others have encountered this issue.
Unfortunately, we have found very little information. It is also very
difficult to reproduce this situation, since it occurs randomly and we
have only seen it happen 3 times in about 2 months time.

 

System specification:

OS: Solaris 10

Apache: 2.2.9

Tomcat: 6.0.16.0

Tomcat_jvm: 1.6.0_07-b06

mod_jk: 1.2.26

java: 1.6.07

The versions of apache/tomcat etc. have not been updated for quite some
time (more than a year at least).



If anyone could shed some light on this issue or has experienced it
themselves: any information would be greatly appreciated.

 

Regards,

 

Robert Colpaert 



Please help Logica to respect the environment by not printing this email  / 
Pour contribuer comme Logica au respect de l'environnement, merci de ne pas 
imprimer ce mail /  Bitte drucken Sie diese Nachricht nicht aus und helfen Sie 
so Logica dabei, die Umwelt zu schützen. /  Por favor ajude a Logica a 
respeitar o ambiente nao imprimindo este correio electronico.



This e-mail and any attachment is for authorised use by the intended 
recipient(s) only. It may contain proprietary material, confidential 
information and/or be subject to legal privilege. It should not be copied, 
disclosed to, retained or used by, any other party. If you are not an intended 
recipient then please promptly delete this e-mail and any attachment and all 
copies and inform the sender. Thank you.



RE: HTTP request and responses mixed up

2010-11-09 Thread Caldarale, Charles R
 From: Colpaert, Robert [mailto:robert.colpa...@logica.com] 
 Subject: HTTP request and responses mixed up

 We are currently experiencing an issue on our system where 
 user A gets the HTTP response intended for user B.

In every instance reported of this happening, it has almost always been a 
programming error in the webapp(s), often storing the request reference in a 
static variable that shouldn't be (or an instance variable of some singleton).  
Look for anything in common across the two requests, such as filters, 
libraries, loggers, beans, etc.

Regardless, it wouldn't hurt to upgrade to insure there's not some latent bug 
in one of the packages you're using.  Your Tomcat is over 2.5 years old, mod_jk 
is nearly 3 years old, httpd is over 2 years old, and the Oracle site is so 
messed up that I can't find the age of the JVM - but it's old.

 - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: setenv.sh in an individual tomcat catalina base

2010-11-09 Thread Konstantin Kolinko
2010/11/9 Ziggy zigg...@gmail.com:
 Are there any side effects to doing this? Can tomcat use both
 $CATALINA_BASE/bin/ and $CATALINA_HOME/bin during startup?


From catalina.sh:

if [ -r $CATALINA_BASE/bin/setenv.sh ]; then
  . $CATALINA_BASE/bin/setenv.sh
elif [ -r $CATALINA_HOME/bin/setenv.sh ]; then
  . $CATALINA_HOME/bin/setenv.sh
fi

i.e. it takes setenv.sh from $CATALINA_BASE if it exists, otherwise
from $CATALINA_HOME.

All the other script files are supposed to remain in $CATALINA_HOME/bin.

I am talking about the latest version of those scripts. I do not know
how old your Tomcat version is. You may look at your catalina.sh for
yourself.

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: HTTP request and responses mixed up

2010-11-09 Thread Jeffrey Janner
 -Original Message-
 From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
 Sent: Tuesday, November 09, 2010 8:06 AM
 To: Tomcat Users List
 Subject: RE: HTTP request and responses mixed up
 
  From: Colpaert, Robert [mailto:robert.colpa...@logica.com]
  Subject: HTTP request and responses mixed up
 
  We are currently experiencing an issue on our system where
  user A gets the HTTP response intended for user B.
 .
  Your Tomcat is over
 2.5 years old, mod_jk is nearly 3 years old, httpd is over 2 years
old,
 and the Oracle site is so messed up that I can't find the age of the
 JVM - but it's old.
 
  - Chuck

I happen to have that exact JDK version loaded on my system right now
(haven't used it for anything in a while, so I haven't upgraded).  The
files are dated 6/10/2008.  And yes, there are bugs in it that will give
you headaches.  You should upgrade to the most recent version.
Jeff
__

Confidentiality Notice:  This Transmission (including any attachments) may 
contain information that is privileged, confidential, and exempt from 
disclosure under applicable law.  If the reader of this message is not the 
intended recipient you are hereby notified that any dissemination, 
distribution, or copying of this communication is strictly prohibited.  

If you have received this transmission in error, please immediately reply to 
the sender or telephone (512) 343-9100 and delete this transmission from your 
system.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: setenv.sh in an individual tomcat catalina base

2010-11-09 Thread Ziggy
I am using Tomcat v5.5

Do you mean that for newer versions of Tomcat, if i want to move some of the
scripts from $CATALINA_HOME/bin to $CATALINA_BASE/bin i will not be able to?


Thanks

On Tue, Nov 9, 2010 at 1:38 PM, Konstantin Kolinko
knst.koli...@gmail.comwrote:

 2010/11/9 Ziggy zigg...@gmail.com:
  Are there any side effects to doing this? Can tomcat use both
  $CATALINA_BASE/bin/ and $CATALINA_HOME/bin during startup?
 

 From catalina.sh:

 if [ -r $CATALINA_BASE/bin/setenv.sh ]; then
  . $CATALINA_BASE/bin/setenv.sh
 elif [ -r $CATALINA_HOME/bin/setenv.sh ]; then
  . $CATALINA_HOME/bin/setenv.sh
 fi

 i.e. it takes setenv.sh from $CATALINA_BASE if it exists, otherwise
 from $CATALINA_HOME.

 All the other script files are supposed to remain in $CATALINA_HOME/bin.

 I am talking about the latest version of those scripts. I do not know
 how old your Tomcat version is. You may look at your catalina.sh for
 yourself.

 Best regards,
 Konstantin Kolinko

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




[OT] Jconsole Perform GC?

2010-11-09 Thread Jeffrey Janner
Anyone know what exactly what kind of GC the Perform GC button in
Jconsole does?

I had a Tomcat instance that I'd been monitoring since yesterday
morning, because the end users were getting some interesting OOM
errors. 

The initial work was mostly in the Eden space and Survivor spaces for
most of the day, then suddenly, a big chunk (nearly 4GB) ended up in the
Old Gen space and pretty much stayed there all night.  During that time,
the Survivor space was mostly flat, with the Eden space showing slow
constant growth (45 degree angle) with period resets to near zero.

So I came in this morning, and saw this pattern, and knowing that the
customer was not using the system yet, pressed the Perform GC button
and was surprised that the memory usage dropped to near zero.
Reviewing the individual graphs showed that the bulk of the retrieved
memory was from the Old Gen space.  It had been consistently flat at
close to 4.0 Gb since about 4:00 pm until I did the GC, which dropped it
to near zero use.  Looking at the other individual graphs showed that
there had been several instances of GC performed by the JVM during that
time, but it took my manual instance to clear the Old Gen.

Is this just normal JVM GC processing?  Does it not gc a Gen unless it
is nearly full? 

It's been awhile since I read the Sun docs on the subject, so it might
be something in the way Java 6 is architected.

 

Jeff

__

Confidentiality Notice:  This Transmission (including any attachments) may 
contain information that is privileged, confidential, and exempt from 
disclosure under applicable law.  If the reader of this message is not the 
intended recipient you are hereby notified that any dissemination, 
distribution, or copying of this communication is strictly prohibited.  

If you have received this transmission in error, please immediately reply to 
the sender or telephone (512) 343-9100 and delete this transmission from your 
system.


Re: [OT] Jconsole Perform GC?

2010-11-09 Thread Mark Thomas
On 09/11/2010 14:53, Jeffrey Janner wrote:
 Anyone know what exactly what kind of GC the Perform GC button in
 Jconsole does?

It will trigger a full GC which will GC both old and new spaces.

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Shutting down one instance of tomcat 6 from a listener

2010-11-09 Thread Caldarale, Charles R
 From: Patrick Sauts [mailto:patrick.via...@gmail.com] 
 Subject: Shutting down one instance of tomcat 6 from a listener

 I'm working with tomcat 6 and multiples instances;

The question André was trying to get you to answer is: what do you mean by 
instance?  Multiple instances of what?  That's a rather ambiguous term you 
used.

 - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: [OT] Jconsole Perform GC?

2010-11-09 Thread Jeffrey Janner
Thanks Chuck.  Just what I was interested in.


 -Original Message-
 From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
 Sent: Tuesday, November 09, 2010 9:05 AM
 To: Tomcat Users List
 Subject: RE: [OT] Jconsole Perform GC?
 
  From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
  Subject: [OT] Jconsole Perform GC?
 
  Anyone know what exactly what kind of GC the Perform GC
  button in Jconsole does?
 
 The same one you get by calling System.gc() - a full GC.
 
  The initial work was mostly in the Eden space and Survivor
  spaces for most of the day, then suddenly, a big chunk
  (nearly 4GB) ended up in the Old Gen space and pretty much
  stayed there all night.
 
 Anything too big for the Eden space will be allocated directly in
 tenured.
 
  Looking at the other individual graphs showed that there had
  been several instances of GC performed by the JVM during that
  time, but it took my manual instance to clear the Old Gen.
 
 Those were minor collections, cleaning out only the Eden space.
 
  Is this just normal JVM GC processing?
 
 Yes, that's completely normal.  The JVM will not do a major (full) GC
 unless it has to - or is forced by the API invocation.
 
  - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

__

Confidentiality Notice:  This Transmission (including any attachments) may 
contain information that is privileged, confidential, and exempt from 
disclosure under applicable law.  If the reader of this message is not the 
intended recipient you are hereby notified that any dissemination, 
distribution, or copying of this communication is strictly prohibited.  

If you have received this transmission in error, please immediately reply to 
the sender or telephone (512) 343-9100 and delete this transmission from your 
system.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: [OT] Jconsole Perform GC?

2010-11-09 Thread Jeffrey Janner
I must say, I was impressed with the speed of the full GC.  Blink of an
eye fast.

 -Original Message-
 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
 Sent: Tuesday, November 09, 2010 9:51 AM
 To: Tomcat Users List
 Subject: RE: [OT] Jconsole Perform GC?
 
 Thanks Chuck.  Just what I was interested in.
 
 
  -Original Message-
  From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
  Sent: Tuesday, November 09, 2010 9:05 AM
  To: Tomcat Users List
  Subject: RE: [OT] Jconsole Perform GC?
 
   From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com]
   Subject: [OT] Jconsole Perform GC?
 
   Anyone know what exactly what kind of GC the Perform GC
   button in Jconsole does?
 
  The same one you get by calling System.gc() - a full GC.
 
   The initial work was mostly in the Eden space and Survivor
   spaces for most of the day, then suddenly, a big chunk
   (nearly 4GB) ended up in the Old Gen space and pretty much
   stayed there all night.
 
  Anything too big for the Eden space will be allocated directly in
  tenured.
 
   Looking at the other individual graphs showed that there had
   been several instances of GC performed by the JVM during that
   time, but it took my manual instance to clear the Old Gen.
 
  Those were minor collections, cleaning out only the Eden space.
 
   Is this just normal JVM GC processing?
 
  Yes, that's completely normal.  The JVM will not do a major (full)
GC
  unless it has to - or is forced by the API invocation.
 
   - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 

___
 ___
 
 Confidentiality Notice:  This Transmission (including any attachments)
 may contain information that is privileged, confidential, and exempt
 from disclosure under applicable law.  If the reader of this message
is
 not the intended recipient you are hereby notified that any
 dissemination, distribution, or copying of this communication is
 strictly prohibited.
 
 If you have received this transmission in error, please immediately
 reply to the sender or telephone (512) 343-9100 and delete this
 transmission from your system.
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

__

Confidentiality Notice:  This Transmission (including any attachments) may 
contain information that is privileged, confidential, and exempt from 
disclosure under applicable law.  If the reader of this message is not the 
intended recipient you are hereby notified that any dissemination, 
distribution, or copying of this communication is strictly prohibited.  

If you have received this transmission in error, please immediately reply to 
the sender or telephone (512) 343-9100 and delete this transmission from your 
system.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: setenv.sh in an individual tomcat catalina base

2010-11-09 Thread André Warnier

Hi.

As I recall, you are using a packaged version of Tomcat (meaning not the original one from 
the tomcat website download, but one already packaged by the people who do such things for 
your OS version).


You should then look carefully at what scripts are used to start/stop Tomcat on your 
particular system (starting with /etc/init.d/tomcat e.g.), what they invoke and when, to 
determine what you can put into CATALINA_HOME/x and CATALINA_BASE/y.
For example, these packages often use a file /etc/default/tomcat that sets some 
environment values, which are later used to determine what other scripts do.


What Konstantin indicates below is based on the standard catalina.sh as provided in the 
standard Tomcat download, but there is no guarantee that this script has not been modified 
(or is even used) in your particular package.



Ziggy wrote:

I am using Tomcat v5.5

Do you mean that for newer versions of Tomcat, if i want to move some of the
scripts from $CATALINA_HOME/bin to $CATALINA_BASE/bin i will not be able to?


Thanks

On Tue, Nov 9, 2010 at 1:38 PM, Konstantin Kolinko
knst.koli...@gmail.comwrote:


2010/11/9 Ziggy zigg...@gmail.com:

Are there any side effects to doing this? Can tomcat use both
$CATALINA_BASE/bin/ and $CATALINA_HOME/bin during startup?


From catalina.sh:

if [ -r $CATALINA_BASE/bin/setenv.sh ]; then
 . $CATALINA_BASE/bin/setenv.sh
elif [ -r $CATALINA_HOME/bin/setenv.sh ]; then
 . $CATALINA_HOME/bin/setenv.sh
fi

i.e. it takes setenv.sh from $CATALINA_BASE if it exists, otherwise
from $CATALINA_HOME.

All the other script files are supposed to remain in $CATALINA_HOME/bin.

I am talking about the latest version of those scripts. I do not know
how old your Tomcat version is. You may look at your catalina.sh for
yourself.

Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org







-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: [OT] Jconsole Perform GC?

2010-11-09 Thread Caldarale, Charles R
 From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com] 
 Subject: RE: [OT] Jconsole Perform GC?

 I was impressed with the speed of the full GC.

GC speed is proportional to the number and size of live objects, not dead ones. 
 If your apps don't persist much data, GC will be quite quick.  Set -verbose:gc 
to see detailed timings.

 - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Single webapp multiple contexts

2010-11-09 Thread Rob Gregory
Hello Tomcat Users,

 

I am trying to create multiple 'dynamic' contexts using just a single
code base. For example we currently deploy a webapps within a context of
let's say 'A'. This listens quite happily for requests coming in the
form of http://localhost/A/index.htm. What I need to be able to do is
have this same code base also listen for requests in the form of
http://localhost/B/index.htm. I have played with using 'fake'
context.xml e.g.

 

A.xml = Context useHttpOnly=true  docBase=C:/0600/ieseries.war
path=/A /

B.xml = Context useHttpOnly=true  docBase=C:/0600/ieseries.war
path=/B /

 

This seems to work but the war is expanded into both contexts and what I
really need is a single code base preferably without the requirement of
using a .war file. I have looked at virtual hosts but this seems to
involve changing the host name which is also not what I am trying to
achieve. 

 

Using Tomcat 6.0.29 under Java(TM) SE Runtime Environment (build
1.6.0_14-b08). CATALINA_HOME is C:/0600.

 

Can anyone give me a gentle push in the right direction if this is at
all possible.

 

Thanks in advance.

 

Rob

 

 



RE: Shutting down one instance of tomcat 6 from a listener

2010-11-09 Thread Patrick Sauts
I'm sorry I'm French.
Multiple cores, maybe?
As when you use the manager to deploy different web applications, several
war.

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: mardi 9 novembre 2010 14:44
To: Tomcat Users List
Subject: RE: Shutting down one instance of tomcat 6 from a listener

 From: Patrick Sauts [mailto:patrick.via...@gmail.com] 
 Subject: Shutting down one instance of tomcat 6 from a listener

 I'm working with tomcat 6 and multiples instances;

The question André was trying to get you to answer is: what do you mean by
instance?  Multiple instances of what?  That's a rather ambiguous term you
used.

 - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Single webapp multiple contexts

2010-11-09 Thread Rob Gregory
Just to expand on this a little. I have previously had something working
but that was on Tomcat 5.5.9, The same trick no longer seems to work
under 6.0.29. 

I basically created a context like 

Context swallowOutput=false reloadable=false useHttpOnly=true
path=/B 
docBase=${catalina.home}/webapps/myapp /

which used an already deployed copy of our webapp. This did work under
5.5.9 but fails with the following error under 6.0.29. Has this
functionality changed and if so is this sort of trick not a good idea?

INFO: Deploying configuration descriptor A.xml
09-Nov-2010 16:37:21 org.apache.catalina.startup.HostConfig
deployDescriptor
WARNING: A docBase C:\intweb\0600\webapps\myapp inside the host appBase
has be
en specified, and will be ignored
09-Nov-2010 16:37:21 org.apache.catalina.core.StandardContext
resourcesStart
SEVERE: Error starting static Resources
java.lang.IllegalArgumentException: Document base
C:\intweb\0600\webapps\A does
not exist or is not a readable directory
at
org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.
java:142)
at
org.apache.catalina.core.StandardContext.resourcesStart(StandardConte
xt.java:4249)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:4
418)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
.java:791)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:77
1)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)

at
org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.ja
va:637)
at
org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.j
ava:563)
at
org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498
)
at
org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
:321)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
eSupport.java:119)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)

at
org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)

at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445
)
at
org.apache.catalina.core.StandardService.start(StandardService.java:5
19)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:710
)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
09-Nov-2010 16:37:21 org.apache.catalina.core.StandardContext start
SEVERE: Error in resourceStart()
09-Nov-2010 16:37:21 org.apache.catalina.core.StandardContext start
SEVERE: Error getConfigured
09-Nov-2010 16:37:21 org.apache.catalina.core.StandardContext start
SEVERE: Context [/A] startup failed due to previous errors

Thanks
Rob


 From: Rob Gregory [mailto:rob.greg...@ibsolutions.com]
 Sent: 09 November 2010 16:22
 To: Tomcat Users List
 Subject: Single webapp multiple contexts
 
 Hello Tomcat Users,
 
 
 
 I am trying to create multiple 'dynamic' contexts using just a single
 code base. For example we currently deploy a webapps within a context
of
 let's say 'A'. This listens quite happily for requests coming in the
 form of http://localhost/A/index.htm. What I need to be able to do is
 have this same code base also listen for requests in the form of
 http://localhost/B/index.htm. I have played with using 'fake'
 context.xml e.g.
 
 
 
 A.xml = Context useHttpOnly=true  docBase=C:/0600/ieseries.war
 path=/A /
 
 B.xml = Context useHttpOnly=true  docBase=C:/0600/ieseries.war
 path=/B /
 
 
 
 This seems to work but the war is expanded into both contexts and what
I
 really need is a single code base preferably without the requirement
of
 using a .war file. I have looked at virtual hosts but this seems to
 involve changing the host name which is also not what I am trying to
 achieve.
 
 
 
 Using Tomcat 6.0.29 under Java(TM) SE Runtime Environment (build
 1.6.0_14-b08). CATALINA_HOME is C:/0600.
 
 
 
 Can anyone give me a gentle push in the right direction if this is at
 all possible.
 
 
 
 Thanks in advance.
 
 
 
 Rob
 
 
 
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Single webapp multiple contexts

2010-11-09 Thread Rob Gregory
The following entries are within the Changelog so it looks like what I
am trying to do is now invalid? Can anyone suggest an alternative way to
achieve the same result of a single code base with multiple contexts?

Change Logs:-

Make context deployment error message for fixDocBase() more meaningful.
(markt)

38570: When checking docBase against appBase, make sure we check for an
exact match against the appBase. (markt)  

39013: When testing for invalid docBase, test for an exact match with
the appBase dir. (markt)  

42678: Only ignore docBase if it really is a subdir of appBase. Patch
provided by juergen. (markt)


 -Original Message-
 From: Rob Gregory [mailto:rob.greg...@ibsolutions.com]
 Sent: 09 November 2010 16:44
 To: Tomcat Users List
 Subject: RE: Single webapp multiple contexts
 
 Just to expand on this a little. I have previously had something
working
 but that was on Tomcat 5.5.9, The same trick no longer seems to work
 under 6.0.29.
 
 I basically created a context like
 
 Context swallowOutput=false reloadable=false useHttpOnly=true
 path=/B
   docBase=${catalina.home}/webapps/myapp /
 
 which used an already deployed copy of our webapp. This did work under
 5.5.9 but fails with the following error under 6.0.29. Has this
 functionality changed and if so is this sort of trick not a good idea?
 
 INFO: Deploying configuration descriptor A.xml
 09-Nov-2010 16:37:21 org.apache.catalina.startup.HostConfig
 deployDescriptor
 WARNING: A docBase C:\intweb\0600\webapps\myapp inside the host
appBase
 has be
 en specified, and will be ignored
 09-Nov-2010 16:37:21 org.apache.catalina.core.StandardContext
 resourcesStart
 SEVERE: Error starting static Resources
 java.lang.IllegalArgumentException: Document base
 C:\intweb\0600\webapps\A does
 not exist or is not a readable directory
 at
 org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.
 java:142)
 at
 org.apache.catalina.core.StandardContext.resourcesStart(StandardConte
 xt.java:4249)
 at
 org.apache.catalina.core.StandardContext.start(StandardContext.java:4
 418)
 at
 org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase
 .java:791)
 at
 org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:77
 1)
 at
 org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
 
 at
 org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.ja
 va:637)
 at
 org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.j
 ava:563)
 at
 org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:498
 )
 at
 org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
 at
 org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java
 :321)
 at
 org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Lifecycl
 eSupport.java:119)
 at
 org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
 
 at
 org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
 at
 org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
 
 at
 org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445
 )
 at
 org.apache.catalina.core.StandardService.start(StandardService.java:5
 19)
 at
 org.apache.catalina.core.StandardServer.start(StandardServer.java:710
 )
 at
org.apache.catalina.startup.Catalina.start(Catalina.java:581)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
 java:39)
 at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
 sorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at
 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
 at
 org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
 09-Nov-2010 16:37:21 org.apache.catalina.core.StandardContext start
 SEVERE: Error in resourceStart()
 09-Nov-2010 16:37:21 org.apache.catalina.core.StandardContext start
 SEVERE: Error getConfigured
 09-Nov-2010 16:37:21 org.apache.catalina.core.StandardContext start
 SEVERE: Context [/A] startup failed due to previous errors
 
 Thanks
 Rob
 
 
  From: Rob Gregory [mailto:rob.greg...@ibsolutions.com]
  Sent: 09 November 2010 16:22
  To: Tomcat Users List
  Subject: Single webapp multiple contexts
 
  Hello Tomcat Users,
 
 
 
  I am trying to create multiple 'dynamic' contexts using just a
single
  code base. For example we currently deploy a webapps within a
context
 of
  let's say 'A'. This listens quite happily for requests coming in the
  form of http://localhost/A/index.htm. What I need to be able to do
is
  have this same code base also listen for requests in the form of
  http://localhost/B/index.htm. I have played with using 'fake'
  context.xml e.g.
 
 
 
  A.xml = Context 

RE: Single webapp multiple contexts

2010-11-09 Thread Caldarale, Charles R
From: Rob Gregory [mailto:rob.greg...@ibsolutions.com] 
Subject: Single webapp multiple contexts

I am trying to create multiple 'dynamic' contexts using just a single
code base. For example we currently deploy a webapps within a context of
let's say 'A'. This listens quite happily for requests coming in the
form of http://localhost/A/index.htm. What I need to be able to do is
have this same code base also listen for requests in the form of
http://localhost/B/index.htm.

You don't say if you want a single webapp instance, or a separate instance for 
each URI path.  Assuming the latter, the only safe way to do it is to have 
separate .war files or directories; anything else will cause timing problems.  
Just copy the .war file (or directory) as needed to the properly named 
location, and get rid of the Context elements from server.xml (almost always 
a bad place for them).

 - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Shutting down one instance of tomcat 6 from a listener

2010-11-09 Thread Ziggy
Hi Patrick,

When you say multiple instances it could mean one of two things

- Running multiple instances of Tomcat using multiple CATALINA_BASES
- Running the same instance of Tomcat but with multiple virtual hosts

Do you mean that you are deploying different applications (i.e different war
files) on the same tomcat installation?




On Tue, Nov 9, 2010 at 4:36 PM, Patrick Sauts patrick.via...@gmail.comwrote:

 I'm sorry I'm French.
 Multiple cores, maybe?
 As when you use the manager to deploy different web applications, several
 war.

 -Original Message-
 From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
 Sent: mardi 9 novembre 2010 14:44
 To: Tomcat Users List
 Subject: RE: Shutting down one instance of tomcat 6 from a listener

  From: Patrick Sauts [mailto:patrick.via...@gmail.com]
  Subject: Shutting down one instance of tomcat 6 from a listener

  I'm working with tomcat 6 and multiples instances;

 The question André was trying to get you to answer is: what do you mean by
 instance?  Multiple instances of what?  That's a rather ambiguous term
 you
 used.

  - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: Single webapp multiple contexts

2010-11-09 Thread Mark Thomas
On 09/11/2010 17:18, Caldarale, Charles R wrote:
 From: Rob Gregory [mailto:rob.greg...@ibsolutions.com] 
 Subject: Single webapp multiple contexts
 
 I am trying to create multiple 'dynamic' contexts using just a single
 code base. For example we currently deploy a webapps within a context of
 let's say 'A'. This listens quite happily for requests coming in the
 form of http://localhost/A/index.htm. What I need to be able to do is
 have this same code base also listen for requests in the form of
 http://localhost/B/index.htm.
 
 You don't say if you want a single webapp instance, or a separate instance 
 for each URI path.  Assuming the latter, the only safe way to do it is to 
 have separate .war files or directories; anything else will cause timing 
 problems.  Just copy the .war file (or directory) as needed to the properly 
 named location, and get rid of the Context elements from server.xml (almost 
 always a bad place for them).

Although if you want a single WAR but multiple deployments of that WAR,
place it somewhere outside the appBase and create multiple references to
it in CATALINA_BASE/conf/enginename/hostname

Mark

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Shutting down one instance of tomcat 6 from a listener

2010-11-09 Thread Ziggy
If you are refering to wanting to undeploy a specific application from the
same instance (installation) of tomcat then there are several ways

- Using Tomcat Manager
- You can write an Ant script to undeploy the application


On Tue, Nov 9, 2010 at 5:22 PM, Ziggy zigg...@gmail.com wrote:

 Hi Patrick,

 When you say multiple instances it could mean one of two things

 - Running multiple instances of Tomcat using multiple CATALINA_BASES
 - Running the same instance of Tomcat but with multiple virtual hosts

 Do you mean that you are deploying different applications (i.e different
 war files) on the same tomcat installation?




 On Tue, Nov 9, 2010 at 4:36 PM, Patrick Sauts patrick.via...@gmail.comwrote:

 I'm sorry I'm French.
 Multiple cores, maybe?
 As when you use the manager to deploy different web applications, several
 war.

 -Original Message-
 From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
 Sent: mardi 9 novembre 2010 14:44
 To: Tomcat Users List
 Subject: RE: Shutting down one instance of tomcat 6 from a listener

  From: Patrick Sauts [mailto:patrick.via...@gmail.com]
  Subject: Shutting down one instance of tomcat 6 from a listener

  I'm working with tomcat 6 and multiples instances;

 The question André was trying to get you to answer is: what do you mean by
 instance?  Multiple instances of what?  That's a rather ambiguous term
 you
 used.

  - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org





Re: setenv.sh in an individual tomcat catalina base

2010-11-09 Thread Ziggy
Hi Andre,

I am using a standard Tomcat installation downloaded from tomcat.apache.org.

I am confused as to how you determined that am using a packaged version of
Tomcat :)

--
D

On Tue, Nov 9, 2010 at 3:55 PM, André Warnier a...@ice-sa.com wrote:

 Hi.

 As I recall, you are using a packaged version of Tomcat (meaning not the
 original one from the tomcat website download, but one already packaged by
 the people who do such things for your OS version).

 You should then look carefully at what scripts are used to start/stop
 Tomcat on your particular system (starting with /etc/init.d/tomcat e.g.),
 what they invoke and when, to determine what you can put into
 CATALINA_HOME/x and CATALINA_BASE/y.
 For example, these packages often use a file /etc/default/tomcat that sets
 some environment values, which are later used to determine what other
 scripts do.

 What Konstantin indicates below is based on the standard catalina.sh as
 provided in the standard Tomcat download, but there is no guarantee that
 this script has not been modified (or is even used) in your particular
 package.



 Ziggy wrote:

 I am using Tomcat v5.5

 Do you mean that for newer versions of Tomcat, if i want to move some of
 the
 scripts from $CATALINA_HOME/bin to $CATALINA_BASE/bin i will not be able
 to?


 Thanks

 On Tue, Nov 9, 2010 at 1:38 PM, Konstantin Kolinko
 knst.koli...@gmail.comwrote:

  2010/11/9 Ziggy zigg...@gmail.com:

 Are there any side effects to doing this? Can tomcat use both
 $CATALINA_BASE/bin/ and $CATALINA_HOME/bin during startup?

  From catalina.sh:

 if [ -r $CATALINA_BASE/bin/setenv.sh ]; then
  . $CATALINA_BASE/bin/setenv.sh
 elif [ -r $CATALINA_HOME/bin/setenv.sh ]; then
  . $CATALINA_HOME/bin/setenv.sh
 fi

 i.e. it takes setenv.sh from $CATALINA_BASE if it exists, otherwise
 from $CATALINA_HOME.

 All the other script files are supposed to remain in $CATALINA_HOME/bin.

 I am talking about the latest version of those scripts. I do not know
 how old your Tomcat version is. You may look at your catalina.sh for
 yourself.

 Best regards,
 Konstantin Kolinko

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org





 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




RE: Single webapp multiple contexts

2010-11-09 Thread Rob Gregory
Hi Chuck and thanks for replying.

I want a single webapp instance e.g. c:\tomcat\webapps\myapp which can
listen for requests coming from http://localhost/A/index.htm and the
same webapp to listen for requests coming from
http://localhsot/B/index.htm, etc. 

Regards
Rob

 -Original Message-
 From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
 Sent: 09 November 2010 17:19
 To: Tomcat Users List
 Subject: RE: Single webapp multiple contexts
 
 From: Rob Gregory [mailto:rob.greg...@ibsolutions.com]
 Subject: Single webapp multiple contexts
 
 I am trying to create multiple 'dynamic' contexts using just a single
 code base. For example we currently deploy a webapps within a context
of
 let's say 'A'. This listens quite happily for requests coming in the
 form of http://localhost/A/index.htm. What I need to be able to do is
 have this same code base also listen for requests in the form of
 http://localhost/B/index.htm.
 
 You don't say if you want a single webapp instance, or a separate
instance for
 each URI path.  Assuming the latter, the only safe way to do it is to
have
 separate .war files or directories; anything else will cause timing
problems.
 Just copy the .war file (or directory) as needed to the properly named
 location, and get rid of the Context elements from server.xml
(almost always
 a bad place for them).
 
  - 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Shutting down one instance of tomcat 6 from a listener

2010-11-09 Thread Pid
On 09/11/2010 12:04, Patrick Sauts wrote:
 What is happening is that the tomcat is becoming unstable with the exit(1).

Hehe.  Yes, Tomcat will be 'unstable' if you call System.exit(1).


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


RE: Single webapp multiple contexts

2010-11-09 Thread Rob Gregory
Hi Mark, 

I presume you are the same Mark that has committed the fixes made in the
changelog? 

I have tried what you suggest but the result is that each context
defined in CATALINA_BASE/conf/enginename/hostname get
deployed/expanded into webapps which results in much more disk space
usage. Is there any way to achieve the same result as was previously
possible within Tomcat 5.5.9 where I could have a context declared
within CATALINA_BASE/conf/enginename/hostname but have that
point/map to an already deployed webapp without it deploying another
copy of the codebase or seeing the warning that is now output from
Tomcat 6. Also using a .war file is a real pain for me because of how we
deploy the different parts of our application.

Many Thanks for your time.
Rob



 -Original Message-
 From: Mark Thomas [mailto:ma...@apache.org]
 Sent: 09 November 2010 17:22
 To: Tomcat Users List
 Subject: Re: Single webapp multiple contexts
 
 On 09/11/2010 17:18, Caldarale, Charles R wrote:
  From: Rob Gregory [mailto:rob.greg...@ibsolutions.com]
  Subject: Single webapp multiple contexts
 
  I am trying to create multiple 'dynamic' contexts using just a
single
  code base. For example we currently deploy a webapps within a
context of
  let's say 'A'. This listens quite happily for requests coming in the
  form of http://localhost/A/index.htm. What I need to be able to do
is
  have this same code base also listen for requests in the form of
  http://localhost/B/index.htm.
 
  You don't say if you want a single webapp instance, or a separate
instance
 for each URI path.  Assuming the latter, the only safe way to do it is
to have
 separate .war files or directories; anything else will cause timing
problems.
 Just copy the .war file (or directory) as needed to the properly named
 location, and get rid of the Context elements from server.xml
(almost always
 a bad place for them).
 
 Although if you want a single WAR but multiple deployments of that
WAR,
 place it somewhere outside the appBase and create multiple references
to
 it in CATALINA_BASE/conf/enginename/hostname
 
 Mark
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Single webapp multiple contexts

2010-11-09 Thread Mark Thomas
On 09/11/2010 17:30, Rob Gregory wrote:
 Hi Mark, 
 
 I presume you are the same Mark that has committed the fixes made in the
 changelog?

Correct.

 I have tried what you suggest but the result is that each context
 defined in CATALINA_BASE/conf/enginename/hostname get
 deployed/expanded into webapps which results in much more disk space
 usage.

Hmm. That isn't meant to happen. Please create a Bugzilla entry for that
one and I'll get it fixed.

 Is there any way to achieve the same result as was previously
 possible within Tomcat 5.5.9 where I could have a context declared
 within CATALINA_BASE/conf/enginename/hostname but have that
 point/map to an already deployed webapp without it deploying another
 copy of the codebase or seeing the warning that is now output from
 Tomcat 6. Also using a .war file is a real pain for me because of how we
 deploy the different parts of our application.

Try using a directory rather than a WAR and have your context.xml files
point to that.

All of this should be covered in [1]  [2]. I'm guessing that those docs
aren't sufficiently clear. Suggestions for improvements welcome.

Mark

[1] http://tomcat.apache.org/tomcat-7.0-doc/config/context.html
[2]
http://tomcat.apache.org/tomcat-7.0-doc/config/host.html#Automatic%20Application%20Deployment


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Restricting access to tomcat via httpd proxy only

2010-11-09 Thread Ari King
Hi all,

I have an httpd proxy in front of my tomcat servers/instances, and I'd
like to restrict access to those tomcat servers/instances to be
through the httpd proxy. This is in a lab settings so I'd prefer to
use tomcat configurations, rather than use something like a firewall.
Anyone have any suggestions on how I can accomplish this? Thanks.

-Ari

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat log files

2010-11-09 Thread Timothy Lam
I'm trying to clean up Tomcat logging to use log4j.  I've read the Tomcat 
logging guide that comes with my version of Tomcat 6.0.28.  I'm really confused 
with all the different log files that are being generated in the default Tomcat 
before log4j configuration.  Why are there so many different log files: admin, 
manager, localhost, manager, host-manager, catalina log files and then 
System.out and System.err get appended to catalina.out?  What's the purpose of 
each of these log files?  When I configure log4j in tomcat I will have this 
single tomcat.log file but will that contain everything in the default log 
files that I previously listed in addition to catalina.out?  Or will I need to 
use both tomcat.log and catalina.out to get a full picture of all of my 
logging?  I tried to delete the logging.properties file in my Tomcat 6.0.28 and 
I get a NoClassDefFoundException in doing so.  So there doesn't seem to be any 
way of really removing java.util.logging
from Tomcat in v6.0.28.



  

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat log files

2010-11-09 Thread Mark Shifman
you need to look at
http://tomcat.apache.org/tomcat-6.0-doc/logging.html
and do what it says for log4j

On 11/09/2010 01:48 PM, Timothy Lam wrote:
 I'm trying to clean up Tomcat logging to use log4j.  I've read the Tomcat 
 logging guide that comes with my version of Tomcat 6.0.28.  I'm really 
 confused with all the different log files that are being generated in the 
 default Tomcat before log4j configuration.  Why are there so many different 
 log files: admin, manager, localhost, manager, host-manager, catalina log 
 files and then System.out and System.err get appended to catalina.out?  
 What's the purpose of each of these log files?  When I configure log4j in 
 tomcat I will have this single tomcat.log file but will that contain 
 everything in the default log files that I previously listed in addition to 
 catalina.out?  Or will I need to use both tomcat.log and catalina.out to get 
 a full picture of all of my logging?  I tried to delete the 
 logging.properties file in my Tomcat 6.0.28 and I get a 
 NoClassDefFoundException in doing so.  So there doesn't seem to be any way of 
 really removing java.util.logging
 from Tomcat in v6.0.28.
 
 
 
   
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

mas

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: setenv.sh in an individual tomcat catalina base

2010-11-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Ziggy,

On 11/9/2010 9:55 AM, Ziggy wrote:
 I am using Tomcat v5.5

Which 5.5? Most apps that work under 5.5 should enjoy a seamless upgrade
to 6.0. Do you have a plan to upgrade? I would recommend one.

 Do you mean that for newer versions of Tomcat, if i want to move some of the
 scripts from $CATALINA_HOME/bin to $CATALINA_BASE/bin i will not be able to?

Which scripts were you thinking about? There should be no reason to
duplicate catalina.sh and friends, as they know how to operate under
CATALINA_BASE conditions. Everything else should be configurable. If you
find something that isn't appropriately configurable, please let us know.

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

iEYEARECAAYFAkzZpPcACgkQ9CaO5/Lv0PBUuwCgtUp0u5N81qlug+YvMb6kOlB7
c+cAnjQbacWLX87TGAZp8g2J4arQ116I
=sTMe
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Shutting down one instance of tomcat 6 from a listener

2010-11-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Patrick,

On 11/9/2010 11:36 AM, Patrick Sauts wrote:
 I'm sorry I'm French.

No problem: we can work around language difficulties. More explanation
usually helps.

 Multiple cores, maybe?

The number of CPU cores should not affect the number of instances that
you have.

 As when you use the manager to deploy different web applications, several
 war.

So, it sounds like you have a single Tomcat/JVM instance but multiple
applications running on it. You want to have one of your webapps check
some configuration and gracefully stop if there is a problem, leaving
the other webapps deployed into Tomcat to continue their business.

If that's the case, then calling System.exit will certainly cause Tomcat
to become unstable, where unstable means completely stopped.

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

iEYEARECAAYFAkzZpk8ACgkQ9CaO5/Lv0PDIzwCeL7AFHpsLKcpNbRPprDxnPKRF
yMUAoJSOfLBrIw0mvW/HlbRyKM7bl5Nj
=olUO
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Restricting access to tomcat via httpd proxy only

2010-11-09 Thread Tim Funk

See RemoteIpValve

http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Remote_IP_Valve

-Tim

On 11/9/2010 1:34 PM, Ari King wrote:

Hi all,

I have an httpd proxy in front of my tomcat servers/instances, and I'd
like to restrict access to those tomcat servers/instances to be
through the httpd proxy. This is in a lab settings so I'd prefer to
use tomcat configurations, rather than use something like a firewall.
Anyone have any suggestions on how I can accomplish this? Thanks.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Restricting access to tomcat via httpd proxy only

2010-11-09 Thread Tim Funk

Doh - too fast in copy paste - I pasted the wrong name.

You want *RemoteAddrValve* - you do NOT want RemoteIpValve

-Tim

On 11/9/2010 3:18 PM, Tim Funk wrote:

See RemoteIpValve

http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Remote_IP_Valve

-Tim

On 11/9/2010 1:34 PM, Ari King wrote:

Hi all,

I have an httpd proxy in front of my tomcat servers/instances, and I'd
like to restrict access to those tomcat servers/instances to be
through the httpd proxy. This is in a lab settings so I'd prefer to
use tomcat configurations, rather than use something like a firewall.
Anyone have any suggestions on how I can accomplish this? Thanks.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Single webapp multiple contexts

2010-11-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mark,

On 11/9/2010 12:49 PM, Mark Thomas wrote:
 On 09/11/2010 17:30, Rob Gregory wrote:
 
 I have tried what you suggest but the result is that each context
 defined in CATALINA_BASE/conf/enginename/hostname get
 deployed/expanded into webapps which results in much more disk space
 usage.
 
 Hmm. That isn't meant to happen. Please create a Bugzilla entry for that
 one and I'll get it fixed.

How about adding unpackWAR=false to your Context?

Rob,
 I want a single webapp instance e.g. c:\tomcat\webapps\myapp which can
 listen for requests coming from http://localhost/A/index.htm and the
 same webapp to listen for requests coming from
 http://localhsot/B/index.htm, etc. 

Are you using any kind of load-balancing service in front of Tomcat? If
so, you could rewrite URLs on the front-end to point to the same
deployed context. What is the advantage of using multiple URLs to refer
to this webapp? Do you use the URL for some sort of customization?

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

iEYEARECAAYFAkzZrw8ACgkQ9CaO5/Lv0PAuuACfd0Ka15GiNHufZTYL1PTzWySM
lFYAoK0y37eDE66K/Z+2jFX5H8H3tKcL
=D115
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Backend Cookie Validation

2010-11-09 Thread Martin Uria
Hi all, 

A little stumped on how to accomplish this:

I am trying to have a cookie validated in Tomcat against a mysql entry, if it 
validates it should proceed to the requested resource, and if not, it should 
redirect to a different page (which writes the cookie on successful login).  
The idea is to have tomcat somehow capture the http request, check for the 
cookie presence, capture the cookie contents and compare them against the db (I 
already have this), and proceed with the request if everything checks out, or 
redirect to a login page (which is outside of the tomcat app, I think it is 
running on rails).

Any ideas on how to do this?  Much appreciated! 
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Restricting access to tomcat via httpd proxy only

2010-11-09 Thread David Goodenough
On Tuesday 09 November 2010, Ari King wrote:
 Hi all,
 
 I have an httpd proxy in front of my tomcat servers/instances, and I'd
 like to restrict access to those tomcat servers/instances to be
 through the httpd proxy. This is in a lab settings so I'd prefer to
 use tomcat configurations, rather than use something like a firewall.
 Anyone have any suggestions on how I can accomplish this? Thanks.
 
 -Ari
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org

You could bind tomcat to localhost, and then although other processes
(such as the httpd proxy) can reach tomcat, no other machines will be
able to.

David

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat log files

2010-11-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Timothy,

On 11/9/2010 1:48 PM, Timothy Lam wrote:
 I'm trying to clean up Tomcat logging to use log4j.  I've read the
 Tomcat logging guide that comes with my version of Tomcat 6.0.28.

Excellent.

 I'm really confused with all the different log files that are being 
 generated in the default Tomcat before log4j configuration.  Why are 
 there so many different log files: admin, manager, localhost, 
 manager, host-manager, catalina log files and then System.out and 
 System.err get appended to catalina.out? What's the purpose of each 
 of these log files?

So, the log files for admin, manager, and host-manager are
application-specific log files. Anything the application sends to
ServletContext.log() will go to these files. The localhost log is for
anything emitted by the Host name=localhost and catalina.out is
exclusively for stdout and stderr, and is done via shell redirection (so
you shouldn't see any configuration for it anywhere other than
bin/catalina.sh).

All of these are configured in conf/logging.properties, though they may
not have a ton of explanation as to /why/ they are configured the way
they are. You are free to change any of this configuration -- for
instance, to remove the manager, host-manager, and admin log files. I
would recommend not deploying any unused webapps, and enabling logging
for any webapps you actually do use.

 When I configure log4j in tomcat I will have
 this single tomcat.log file but will that contain everything in the
 default log files that I previously listed in addition to
 catalina.out?

It should.

- From the docs:


You can (and should) be more picky about which packages to include in
the logging. Tomcat defines loggers by Engine and Host names. For
example, for a more detailed Catalina localhost log, add this to the end
of the log4j.properties above. Note that there are known issues with
using this naming convention (with square brackets) in log4j XML based
configuration files, so we recommend you use a properties file as
described until a future version of log4j allows this convention.


log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=DEBUG
  log4j.logger.org.apache.catalina.core=DEBUG
  log4j.logger.org.apache.catalina.session=DEBUG


If you read a bit more about log4j (not covered by the Tomcat docs, of
course), you'll find that you can set up logging for different
applications by using different appenders like this:

log4j.appender.LOCALHOST=org.apache.log4j.FileAppender
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=LOCALHOST

If you repeat this for each of the default loggers defined for the JULI
configuration (which you are replacing with log4j), you'll get the same
setup. I'm not sure why the documentation doesn't show an equivalent
configuration for log4j. Maybe I'll write one and submit it for inclusion.

 Or will I need to use both tomcat.log and catalina.out
 to get a full picture of all of my logging?

catalina.out will always include whatever goes to stdout/stderr: the use
of log4j won't change that.

 I tried to delete the
 logging.properties file in my Tomcat 6.0.28 and I get a
 NoClassDefFoundException in doing so.

logging.properties isn't supposed to be necessary, but I seem to recall
some issue with the shell scripts choking when logging wasn't completely
configured correctly. Have you correctly replaced lib/tomcat-juli.jar
and installed lib/tomcat-juli-adapters.jar? If not, you may be falling
back to the old logger which requires logging.properties.

 So there doesn't seem to be
 any way of really removing java.util.logging from Tomcat in v6.0.28.

Yes, it can be done. If it's still not working, please post your entire
log4j.properties and a directory listing of CATALINA_HOME/lib and
CATALINA_HOME/conf.

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

iEYEARECAAYFAkzZt8YACgkQ9CaO5/Lv0PBnSACgv0iBGYspjkELcUEMIUGLGUg6
paMAnRmYmi9lNydjZ/3Z2fMo4z2wcXiK
=T7Fb
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Single webapp multiple contexts

2010-11-09 Thread Konstantin Kolinko
2010/11/9 Christopher Schultz ch...@christopherschultz.net:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Mark,

 On 11/9/2010 12:49 PM, Mark Thomas wrote:
 On 09/11/2010 17:30, Rob Gregory wrote:

 I have tried what you suggest but the result is that each context
 defined in CATALINA_BASE/conf/enginename/hostname get
 deployed/expanded into webapps which results in much more disk space
 usage.


Into webapps, or into work?

 Hmm. That isn't meant to happen. Please create a Bugzilla entry for that
 one and I'll get it fixed.

 How about adding unpackWAR=false to your Context?


And antiResourceLocking=false, antiJARLocking=false if you ever
used that. (Those flags cause copying of resources. You won't need
them if you do not plan to undeploy your app while Tomcat is running).

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Backend Cookie Validation

2010-11-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Martin,

On 11/9/2010 3:30 PM, Martin Uria wrote:
 I am trying to have a cookie validated in Tomcat against a mysql
 entry, if it validates it should proceed to the requested resource,
 and if not, it should redirect to a different page (which writes the
 cookie on successful login).  The idea is to have tomcat somehow
 capture the http request, check for the cookie presence, capture the
 cookie contents and compare them against the db (I already have
 this), and proceed with the request if everything checks out, or
 redirect to a login page (which is outside of the tomcat app, I think
 it is running on rails).
 
 Any ideas on how to do this?

This what javax.servlet.Filter was made for. You will have to write your
own code to do the checking and the redirecting.

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

iEYEARECAAYFAkzZuMIACgkQ9CaO5/Lv0PAKJwCgkOEmUbQqCWoUS2MQBpCqXape
vl0AnRioaiS4hbdiMhA+LCxZvfyYegV8
=o3mZ
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat log files

2010-11-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Timothy,

On 11/9/2010 4:06 PM, Christopher Schultz wrote:
 I'm not sure why the documentation doesn't show an equivalent
 configuration for log4j. Maybe I'll write one and submit it for inclusion.

Without testing it, I've written this log4j configuration which should
be equivalent to the default one that ships with Tomcat. I apologize in
advance for any line-wrapping problems which may arise from my emailer.

log4j.rootLogger=DEBUG, CATALINA

# Define all the appenders
log4j.appender.CATALINA=org.apache.log4j.DailyRollingFileAppender
log4j.appender.CATALINA.file=${catalina.base}/logs/catalina.
log4j.appender.CATALINA.encoding=UTF-8
# Roll-over the log once per day
log4j.appender.CATALINA.DatePattern='.'-MM-dd'.log'
log4j.appender.CATALINA.conversionPattern = %d [%t] %-5p %c- %m%n
log4j.appender.CATALINA.append=true

log4j.appender.LOCALHOST=org.apache.log4j.DailyRollingFileAppender
log4j.appender.LOCALHOST.file=${catalina.base}/logs/localhost.
log4j.appender.LOCALHOST.encoding=UTF-8
log4j.appender.LOCALHOST.DatePattern='.'-MM-dd'.log'
log4j.appender.LOCALHOST.conversionPattern = %d [%t] %-5p %c- %m%n
log4j.appender.LOCALHOST.append=true

log4j.appender.MANAGER=org.apache.log4j.DailyRollingFileAppender
log4j.appender.MANAGER.file=${catalina.base}/logs/manager.
log4j.appender.MANAGER.encoding=UTF-8
log4j.appender.MANAGER.DatePattern='.'-MM-dd'.log'
log4j.appender.MANAGER.conversionPattern = %d [%t] %-5p %c- %m%n
log4j.appender.MANAGER.append=true

log4j.appender.HOST-MANAGER=org.apache.log4j.DailyRollingFileAppender
log4j.appender.HOST-MANAGER.file=${catalina.base}/logs/host-manager.
log4j.appender.HOST-MANAGER.encoding=UTF-8
log4j.appender.HOST-MANAGER.DatePattern='.'-MM-dd'.log'
log4j.appender.HOST-MANAGER.conversionPattern = %d [%t] %-5p %c- %m%n
log4j.appender.HOST-MANAGER.append=true

log4j.appender.CONSOLE=org.apache.log4j.DailyRollingFileAppender
log4j.appender.CONSOLE.file=${catalina.base}/logs/.
log4j.appender.CONSOLE.encoding=UTF-8
log4j.appender.CONSOLE.DatePattern='.'-MM-dd'.log'
log4j.appender.CONSOLE.conversionPattern = %d [%t] %-5p %c- %m%n
log4j.appender.CONSOLE.append=true

# Configure which loggers log to which appenders
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost]=INFO,
LOCALHOST
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/manager]=INFO,
MANAGER
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/host-manager]=INFO,
HOST-MANAGER
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkzZvqoACgkQ9CaO5/Lv0PBweACcC8nkWamXXjXCRgGjoHUtVpBY
iBYAoInaalGQ+H+Zbcmg/QIxfFrTGa47
=/vyy
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat log files

2010-11-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Timothy,

My CONSOLE appender was foolishly configured.

On 11/9/2010 4:35 PM, Christopher Schultz wrote:
 log4j.appender.CONSOLE=org.apache.log4j.DailyRollingFileAppender
 log4j.appender.CONSOLE.file=${catalina.base}/logs/.
 log4j.appender.CONSOLE.encoding=UTF-8
 log4j.appender.CONSOLE.DatePattern='.'-MM-dd'.log'
 log4j.appender.CONSOLE.conversionPattern = %d [%t] %-5p %c- %m%n
 log4j.appender.CONSOLE.append=true

It should be:

log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.encoding=UTF-8
log4j.appender.CONSOLE.conversionPattern = %d [%t] %-5p %c- %m%n

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

iEYEARECAAYFAkzZyGAACgkQ9CaO5/Lv0PCyGgCgvuGt1v7U86qbp4r7FwiGFHQd
89wAoKc42YxmIS7sDgPKVvDbSvHTvxZT
=6tMF
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: HTTP request and responses mixed up

2010-11-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Robert,

On 11/9/2010 8:45 AM, Colpaert, Robert wrote:
 In the web GUI, user A requests a list of customers and user B requests
 a list of the current orders (these requests are be handled in different
 servlets). User A receives the correct list of its customers, however
 User B gets the same HTTP response!

Have you received reports directly from your users, then?

 We traced both requests through the entire chain of
 apache/apache/tomcat/backend etc. and we see both requests (User A and
 User B) in the logging of our first and second apache. These requests
 are for completely different servlets, this rules out any coding
 problems inside the servlet. The reason why we can correlate the HTTP
 response of User A with the HTTP response User B receives, is the size
 of the HTTP response in the apache logging.

Responses of the same size would seem to be circumstantial at best. You
could install a component that takes a cryptographic fingerprint of each
response (say, md5sum) and logs it for comparison. You probably want to
do this at the outer-most layer of your configuration to verify that
it's actually happening, then move that fingerprinting back toward the
webapp until you pinpoint it's location.

As Chuck says, it usually turns out to be the webapp's fault.

If you're truly paranoid, you can enable org.apache.catalina.connector.
RECYCLE_FACADES to see if that eliminates the problem
(http://tomcat.apache.org/tomcat-6.0-doc/config/systemprops.html). I'm
not sure when that configuration property was added, but it looks like
the Changelog references facade recycling around 6.0.13, so you should
be okay.

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

iEYEARECAAYFAkzZ04wACgkQ9CaO5/Lv0PAeuwCgprxAgmvH2VttWrP79nqT+6Eo
dfwAnAnegJ3EbkHLsKTjwcIcIN5hsxKg
=zm+X
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: DBCP abandoned trace - unable to understand the leak

2010-11-09 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Sasidhar,

On 11/8/2010 12:31 AM, sasidhar prabhakar wrote:
 On Thu, Nov 4, 2010 at 9:10 PM, Christopher Schultz 
 ch...@christopherschultz.net wrote:

 I have found that these exceptions can occur even when there is no leak.

 Specifically, if your SQL query takes a long time to run (that is, more
 than the ababdonedTimeout), another request to the connection pool
 complains about the connection and calls it abandoned.

 
 I think your right. Timeout  I mentioned 30sec deafault is 300sec. This is
 my context.xml

 ?xml version=1.0 encoding=UTF-8?
 Context path= 

path is not allowed in context.xml: remove it.

 validationQuery=SELECT * from dual

SELECT *? Wow. How about SELECT 1 FROM dual?

 testOnBorrow=true
 removeAbandoned=true
 removeAbandonedTimeout=30

That's a 30-second abandoned timeout.

 username=scott
 password=***

tiger, right?

 Technically speaking, the connection hasn't been leaked, but the
 connection pool can't really guess the reason why the connection hasn't
 been returned.

 Can you time your queries to see how long they take? Could you post your
 Resource configuration for your DataSource?
 
 For some queries it took more than 30 seconds, from getting data from
 ip_to_geo table, which has 3 million rows in it.

That could be your problem: you should probably increase your
removeAbandonedTimeout value to something more appropriate for your
application.

You might also want a dba to check out your queries and your database
structure. 3 million rows isn't that much, even for Oracle :)

 Another note: I notice that you are using a DataSource object that
 survives for the life of the DAO object, and is even created by the
 object in its constructor.
 
 Every DAO has only one instance for the entire life of application. Is this
 correct approach. So Every thread accessing the same datasource object to
 get connection.

It was just a recommendation which gives you flexibility: your webapp
(or the container, etc.) has the freedom to discard and completely
re-build the DataSource for your webapp if you always go to the JNDI
context to get the DataSource. Otherwise, you will force a webapp
restart just to get a new DataSource.

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

iEYEARECAAYFAkzZ180ACgkQ9CaO5/Lv0PDicACfZ/rv+FN8cT8JATK2ZlGYgWUW
CPoAn2/j0NO6af4RuL9t7j4yH9wXP+bW
=l181
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: web.xml cant load because of listener

2010-11-09 Thread Will Sumekar
Hi Pid
Thanks for your suggestion. The problem is solved. It's probably caused by
wrong classpath syntax as I had this:
valueclasspath:./hibernate.cfg.xml/value

However I still think tomcat could give a more verbose error messages.


Will


On Fri, Nov 5, 2010 at 1:45 AM, Pid p...@pidster.com wrote:

 On 04/11/2010 16:06, Will Sumekar wrote:
  AFAIK if you dont specify contextConfigLocation system looks for default
  filename applicationContext.xml at default location of ./WEB-INF/. But it
  doesnt  matter cos even if I put context-param the error still comes.
 
  So far it looks like the error is caused by listener. Once I remove it,
  it's OK. Which is really, really strange.
 
  You can set tomcat to use log4j by putting log4j jar in /common/lib and
  log4j.properties in /common/classes. In case you want to try, also put
  commons logging jar in lib dir.

 Make a simple test ServletContextListener impl and try to deploy with
 just that in this Tomcat, see if it works.


 p

?xml version=1.0 encoding=UTF-8?
web-app id=WebApp_ID version=2.4
xmlns=http://java.sun.com/xml/ns/j2ee; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee 
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
display-nametest-servlet-listener2/display-name

listener
listener-classtest.TestServletContextistener/listener-class
/listener

welcome-file-list
welcome-fileindex.html/welcome-file
welcome-fileindex.htm/welcome-file
welcome-fileindex.jsp/welcome-file
welcome-filedefault.html/welcome-file
welcome-filedefault.htm/welcome-file
welcome-filedefault.jsp/welcome-file
/welcome-file-list

/web-app

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

RE: web.xml cant load because of listener

2010-11-09 Thread Caldarale, Charles R
 From: Will Sumekar [mailto:will.sume...@gmail.com] 
 Subject: Re: web.xml cant load because of listener

 However I still think tomcat could give a more 
 verbose error messages. 

You missed the fact that it's not Tomcat generating the error messages, nor is 
the invalid value setting anything Tomcat looks at.  The issues you're having 
are with the Spring framework, not 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: NIO connecter does not work after startup normally

2010-11-09 Thread jie tang
Sorry.
I don't know about the asynchronous mechanism the servlet 3.0 introduces.
You may can read servlet 3.0 spec?

2010/11/9 Ben Xiong xpsl...@gmail.com

 ?I changed the call to req.startAsync() then it seems working.

 But why's that? what happend in req.startAsync(req, res) which does not
 happen in req.startAsync() ? Thank you.

 -Original Message- From: jie tang
 Sent: Tuesday, November 09, 2010 2:40 PM
 To: Tomcat Users List
 Subject: Re: NIO connecter does not work after startup normally


 You recursively invoke startAsync unlimitedly.

 2010/11/9 Ben Xiong xpsl...@gmail.com

  ?Another case:

 Web.xml
 ?xml version=1.0 encoding=UTF-8?
 web-app xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xmlns=http://java.sun.com/xml/ns/javaee; xmlns:web=
 http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd;
  xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
 http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd;
  id=WebApp_ID version=3.0
  display-nameTomcatComet/display-name
  servlet
  servlet-names3/servlet-name
  servlet-classcomet.Servlet3/servlet-class
  async-supportedtrue/async-supported
  /servlet
  servlet-mapping
  servlet-names3/servlet-name
  url-pattern/s3/url-pattern
  /servlet-mapping
 /web-app

 comet.Servlet3 source code:

 package comet;

 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;

 public class Servlet3 extends HttpServlet {

  public void doGet(HttpServletRequest req, HttpServletResponse res) {
  req.startAsync(req, res);
  System.out.println(=Finally, it works!
 );
  }
 }

 Server startup log:

 INFO: SessionListener: contextInitialized()
 Nov 9, 2010 2:24:13 PM org.apache.catalina.startup.HostConfig
 deployDirectory

 INFO: Deploying web application directory host-manager
 Nov 9, 2010 2:24:13 PM org.apache.catalina.startup.HostConfig
 deployDirectory

 INFO: Deploying web application directory manager
 Nov 9, 2010 2:24:13 PM org.apache.catalina.startup.HostConfig
 deployDirectory

 INFO: Deploying web application directory ROOT
 Nov 9, 2010 2:24:13 PM org.apache.coyote.http11.Http11NioProtocol start

 INFO: Starting Coyote HTTP/1.1 on http-8080
 Nov 9, 2010 2:24:14 PM org.apache.coyote.ajp.AjpAprProtocol start

 INFO: Starting Coyote AJP/1.3 on ajp-8009
 Nov 9, 2010 2:24:14 PM org.apache.catalina.startup.Catalina start
 INFO: Server startup in 1586 ms

 URL: http://localhost:8080/TomcatComet/s3

 Exception:

 INFO: Server startup in 1586 ms
 Nov 9, 2010 2:24:50 PM
 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor run
 SEVERE:
 java.lang.StackOverflowError
  at

 org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031)
  at

 org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031)
  at

 org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031)
  at

 org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031)
  at

 org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031)
  at

 org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031)
  at

 org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031)
  at

 org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1031)
  ..

 Same Win 7 64 bit, native connecter, tomcat 7.0.4, :(




 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




Re: DBCP abandoned trace - unable to understand the leak

2010-11-09 Thread sasidhar prabhakar
After changing time out value now I am getting this problem

org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection,
pool error Timeout waiting for idle object





On Tue, Nov 9, 2010 at 5:22 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Sasidhar,

 On 11/8/2010 12:31 AM, sasidhar prabhakar wrote:
  On Thu, Nov 4, 2010 at 9:10 PM, Christopher Schultz 
  ch...@christopherschultz.net wrote:
 
  I have found that these exceptions can occur even when there is no leak.
 
  Specifically, if your SQL query takes a long time to run (that is, more
  than the ababdonedTimeout), another request to the connection pool
  complains about the connection and calls it abandoned.
 
 
  I think your right. Timeout  I mentioned 30sec deafault is 300sec. This
 is
  my context.xml

  ?xml version=1.0 encoding=UTF-8?
  Context path= 

 path is not allowed in context.xml: remove it.

  validationQuery=SELECT * from dual

 SELECT *? Wow. How about SELECT 1 FROM dual?

  testOnBorrow=true
  removeAbandoned=true
  removeAbandonedTimeout=30

 That's a 30-second abandoned timeout.

  username=scott
  password=***

 tiger, right?

  Technically speaking, the connection hasn't been leaked, but the
  connection pool can't really guess the reason why the connection hasn't
  been returned.
 
  Can you time your queries to see how long they take? Could you post your
  Resource configuration for your DataSource?
 
  For some queries it took more than 30 seconds, from getting data from
  ip_to_geo table, which has 3 million rows in it.

 That could be your problem: you should probably increase your
 removeAbandonedTimeout value to something more appropriate for your
 application.

 You might also want a dba to check out your queries and your database
 structure. 3 million rows isn't that much, even for Oracle :)

  Another note: I notice that you are using a DataSource object that
  survives for the life of the DAO object, and is even created by the
  object in its constructor.
 
  Every DAO has only one instance for the entire life of application. Is
 this
  correct approach. So Every thread accessing the same datasource object to
  get connection.

 It was just a recommendation which gives you flexibility: your webapp
 (or the container, etc.) has the freedom to discard and completely
 re-build the DataSource for your webapp if you always go to the JNDI
 context to get the DataSource. Otherwise, you will force a webapp
 restart just to get a new DataSource.

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

 iEYEARECAAYFAkzZ180ACgkQ9CaO5/Lv0PDicACfZ/rv+FN8cT8JATK2ZlGYgWUW
 CPoAn2/j0NO6af4RuL9t7j4yH9wXP+bW
 =l181
 -END PGP SIGNATURE-

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org