RE: Private JVM Heap Size

2009-06-10 Thread Peter Crowther
 From: William Biggs [mailto:kc8...@gmail.com]
 I'm looking at a new web hosting they give Private JVM Heap
 Size what is the min jvm heap size would you go with ?

It depends entirely on your application.  Some apps can handle fairly high 
loads with under 100 Mbytes of heap; others need 2 Gbytes or more for even 
moderate loads.  You're the only person who knows what application you want to 
deploy; profile the application you want to deploy, under the load you want it 
to support, then purchase a hosting service with that much heap.

- Peter

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



Re: Apache Tomcat connection question

2009-06-10 Thread Rainer Jung
On 10.06.2009 06:00, R Ravichandran wrote:
 Hello,
 
 This is an urgent request. Any feedback is really appreciated.
 
 I have two web applications (let us call main app., and helper app.) running
 on Tomcat with an Apache server in from of Tomcat. Both Apache and Tomcat
 are running on the same host. The first web app on Tomcat is running as ROOT
 webapp.
 
 I have two websites mapped to the single IP address of the host. I want the
 right application accessed depending on the domain name used.
 
 - For example, for the domain name www.app1.com, I want the first tomcat
 web app reached.
 - for the domain name www.app2.com I want the second web app reached.
 
 Here is the config, I am using:
 =
 In Apache httpd.conf file:
 
 NameVirtualHost *:80
 
 VirtualHost www.app1.com
   ServerName www.app1.com
   ProxyPreserveHost On
   ProxyPass / http://localhost:8080/app1
   ProxyPassReverse / http://localhost:8080/app1
 /VirtualHost
 
 VirtualHost www.app2.com
 ServerName www.app2.com
   ProxyPreserveHost On
   ProxyPass /totelistm http://localhost:8080/app2
   ProxyPassReverse /totelistm http://localhost:8080/app2
 /VirtualHost
 
 
 Here is the uriworkmap.properties file for mod_jk
 worker.list=loadbalancer,status
 
 /=loadbalancer
 /*=loadbalancer
 
 /app2=loadbalancer
 /app2/*=loadbalancer

You forgot to tell us, what your actual problem is.

Remarks:

- I don't understand, why you want to use mod_proxy *and* mod_jk. Choose
one of them, not both.

- You can use virtual hosts in Tomcat too and put each webapp as the
ROOT context in the respective vhost.

- When using mod_proxy make sure to use ProxyPreserveHost to forward the
original Hosts header, so that Tomcat can choose the correct vhost.

Regards,

Rainer

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



Re: custom header

2009-06-10 Thread André Warnier

Anthony J. Biacco wrote:

Thanx for that, that sets the header for me, but to something static.
Only problem I have is I can't seem to figure out how to set it to the hostname 
of the tomcat server, or a tomcat variable (set from the hostname of the server 
- i.e. -Dmyjvmroute=`/bin/hostname -s` and then trying to use ${myjvmroute} in 
a rule such as:


I must be missing something here.  Why would you want it to be dynamic ?

If you have several Tomcat instances as back-ends, then each one has its 
own webapps, and each one of these webapps has its own web.xml, which is 
where you configure its own urlrewrite filter.  So what is the problem 
in having it static in there ?


Or, wait, is it purely because you would like to be able to always 
distribute the same identical web.xml to all instances ?
That would then become a more generic issue like how do I distribute 
the same war-file to several Tomcat instances, but have each instance 
pick up something instance-specific to include in its web.xml at load 
time ?


Now, in this case I do believe that the urlrewrite filter uses a 
separate config file, in which maybe there is a way to specify something 
like that.  Maybe then just that file would need to be instance-specific ?



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



Tomcat 6.0.20 WIndows installer - permission problems when installing servoce

2009-06-10 Thread Christoph Kukulies
Due to the recently discovered security holes in Tomcat 6 I wanted to 
update to 6.0.20,
downloaded the Windows installer and ran it (after stopping the running 
service first).


During the install process I'm getting an alert box, saying:

(X) Failed to install Tomcat6 service.
 Check your settings and permissions.
 Ignore and continue anyway (not recommended)?

I continued and after copying back my backed up server.xml and my (own) 
ROOT webapplication

I could start the service (net start tomcat6) again.

Probably it's just because tomcat6 has not been deinstalled before?

Is there a way to upgrade tomcat6 smoothly under Windows?

--
Christoph Kukulies



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



Re: tomcat6.0.18 service unable to start

2009-06-10 Thread André Warnier

teoh wrote:

my tomcat6 service unable to startup with error 0 code. i already tried put
msvcr71.dll in tomcat/bin directory. still the same

i'm using tomcat 6.0.18 with windows xp 32bits system

in console, i able to start up the tomcat, but not on service.  any suggestion
what i missed out?

my process monitor log at  http://www.sendspace.com/file/t0tahr

Not an answer to the problem, but the link you provide requires a 
signup, which many people will not want to do.

So, basically, we can't see your logfile.
Can't you paste the relevant few lines right here ?


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



Re: tomcat6.0.18 service unable to start

2009-06-10 Thread teoh
dude,
   found a solution. work for tomcat6 . for those people that facing similar
problem.  try download javaservice.exe  put it in {tomcat}\bin directory and
install .javaservice.exe -install liferaytomcat
%JDK_HOME%\jre\bin\server\jvm.dll ..
after that, if u trying to start tomcat and it give you error loadlibrary
function failed..
Solution: 
copy msvcr71.dll from {jdk1.6}\bin  to {tomcat}\bin 
tomcat6+jdk6 able to run as service on windows2003




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



Re: Tomcat 6.0.20 WIndows installer - permission problems when installing servoce

2009-06-10 Thread André Warnier

Christoph Kukulies wrote:
Due to the recently discovered security holes in Tomcat 6 I wanted to 
update to 6.0.20,
downloaded the Windows installer and ran it (after stopping the running 
service first).


During the install process I'm getting an alert box, saying:

(X) Failed to install Tomcat6 service.
 Check your settings and permissions.
 Ignore and continue anyway (not recommended)?

I continued and after copying back my backed up server.xml and my (own) 
ROOT webapplication

I could start the service (net start tomcat6) again.

Probably it's just because tomcat6 has not been deinstalled before?


Probably.


Is there a way to upgrade tomcat6 smoothly under Windows?



My guess :
The error message appears when the Windows service wrapper included in 
 the Tomcat installer tries to install itself as a Windows Service, and 
itself gets back an error, because this same Service Name already exists 
in the Windows Registry.

In this case however, the error is harmless.
You can probably avoid it by running this command from a command window, 
in the /bin directory of your Tomcat installation, prior to 
re-installing/upgrading Tomcat :

.\tomcat?w.exe //DS//(service name)
where (probably) ? should be 6 in your case, and (service name) 
should be whatever name appears for Tomcat when the service is started 
and you type net start to list the active services.


For a full explanation, have a look here :
http://commons.apache.org/daemon/procrun.html

Another way to (maybe) avoid this would be as follows :
- instead of downloading and installing the installer version of 
Tomcat for Windows, download the zip version.

- unzip this version in the desired Tomcat installation directory
- run the bin\install.bat script to install the Tomcat service.
Once you have done that, you have essentially the same Tomcat as with 
the installer.  The difference is that you will have a few more files in 
the \bin subdirectory, allowing you for instance to run Tomcat in a 
command window, should you want to do that.


I'm sure more information is available somewhere, but it quickly gets 
rather tedious to explain the full background of all this, so I'll skip 
it for now.



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



RE: Why do stacktraces from servlets print to stdout, when the other end up in the log4j -log file?

2009-06-10 Thread Imner, Andreas
Hi

The Servlet does not propegate the error. This perticular servlet is one we use 
for handling unhandled exceptions and displaying an unexpected-error page to 
the user.
_
From web.xml

servlet
servlet-nameexceptionHandler/servlet-name

servlet-classse.kgk.webshop.web.general.ExceptionHandlerServlet/servlet-class
init-param
param-nameerrorPageURL/param-name
param-valuegoto.do?forward=error/param-value
/init-param
load-on-startup3/load-on-startup
/servlet

servlet-mapping
servlet-nameexceptionHandler/servlet-name
url-pattern/error/url-pattern
/servlet-mapping

error-page
  exception-typejava.lang.Throwable/exception-type
  location/error/location
/error-page


The servlet code looks something like this 

private static final Log log = 
LogFactory.getLog(ExceptionHandlerServlet.class);

protected void doPost(final HttpServletRequest request, final 
HttpServletResponse response)
throws ServletException {
try {
Throwable throwable = null;

( Some code to extract the throwable, the requestURI etc... )

log.error(Exception while handling request:  + requestURI, 
throwable);

request.getRequestDispatcher(errorPageURL).forward(request, 
response);

} catch (final Throwable t) {
   t.printStackTrace();
}
}




If we run the webapp in Weblogic, both the Exception while handling... 
message and the stacktrace gets printed to the log file specified by log4j

If we run exactly the same webapp in Tomcat, the Exception while handling... 
message is printed to the log4j -logfile but the stacktrace gets printed to 
stdout.log!?! 
Note that this only applies to log calls from within this servlet. Then doing 
the exact same log4j-call from within one of our filter -classes, everything 
works as expected. 

I suspect something is different with the servlet load sequence or log settings 
when using Tomcat, but what?






Med vänlig hälsning
Andreas Imner
Systemutvecklare 
KG Knutsson AB
Autokatalogen

Tel: +46 8 92 34 37
Mobil: +46 70 606 34 37
andreas.im...@kgk.se 



-Ursprungligt meddelande-
Från: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Skickat: den 9 juni 2009 21:57
Till: Tomcat Users List
Ämne: Re: Why do stacktraces from servlets print to stdout, when the other end 
up in the log4j -log file?

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andreas,

On 6/9/2009 3:31 PM, Imner, Andreas wrote:
 My companys web application uses log4j 1.2.8 for logging and have
 just recently switched from Weblogic to Tomcat 6.0.18.
 
 Since the we switched to Tomcat, when we do some logging within a
 servlet
 
  private static final Log log =
 LogFactory.getLog(ExceptionHandlerServlet.class);
 log.error(some message, throwable);
 
 
 The some message -line is written to the file specified by log4j,
 but why does the stacktrace gets written to Tomcats stdout.log?

That depends on what else is going on in your servlet. If you let the
exception propagate (by re-throwing it or throwing a new exception) and
nobody else catches it, then Tomcat's request processing thread code
will catch it and log it to stdout.

 This is our log4j.properties file
 
 
 log4j.appender.A1=org.apache.log4j.RollingFileAppender
 log4j.appender.A1.MaxBackupIndex=20
 log4j.appender.A1.MaxFileSize=10MB
 
 log4j.appender.A1.layout=org.apache.log4j.PatternLayout
 
 log4j.appender.A1.layout.ConversionPattern=%d{ABSOLUTE} %-5p %X{ak} [%c{1}] 
 %m%n
 log4j.rootLogger=ERROR, A1
 
 log4j.category.se=INFO
 
 # All System.out.println is redirected to stdout logger, INFO level
 log4j.category.stdout=INFO
 
 # All System.err.println (includes Exception.printStackTrace() is redirected 
 to stderr logger, INFO level
 log4j.category.stderr=INFO
 

The code you provided does not show any use of the stdout category,
but it doesn't really matter because the stdout category does not
actually log to stdout :)

Check to see that your code is not allowing exceptions to propagate.

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

iEYEARECAAYFAkouvpkACgkQ9CaO5/Lv0PDwrACgsjUoqePn7xzDy5qVoBukKdOz
iboAn2qKdOJxCDKQ+/mtp5vDnbv1v5ZN
=AvA2
-END PGP SIGNATURE-

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



Re: Why do stacktraces from servlets print to stdout, when the other end up in the log4j -log file?

2009-06-10 Thread André Warnier

Imner, Andreas wrote:
...
Hi.
I do not know the answer, but I am sure that if you would like some 
answers from the experts on this list, it would not hurt to add some 
information like :

- the version of this Tomcat
- where you got it from : is it a standard Tomcat from the Tomcat 
website, or a packaged distribution from some other source ?

- on which platform and OS you are running this
- how is this Tomcat started ? (e.g. if under some Unix/Linux, are there 
some specific things happening re. logfiles/stdout/stderr re-direction 
in the /etc/init.d/tomcatxx or similar startup scripts ?)


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



Re: setenv.sh - how to set system properties to values containing spaces

2009-06-10 Thread Bap

Hi Chris,

Thanks for the reply.
Unfortunately I had already tried all of those suggestions - and more  
- before posting. I have just retried the three below, to double  
check, but unfortunately all with similar results - either looking to  
run ssl ssl or ssl'


I am pretty sure that the issue is with the shell, and have been using  
the code below to test all sorts of combinations of values for OPTS -  
the only way I can get the arg to print on one line is to quote $OPTS  
when it is expanded, which obviously will not work if there are any  
other options required in CATALINA_OPTS.


Can anyone provide any more suggestions, or am I going to have to  
modify catalina.sh - I really do not want to do that, for obvious  
reasons.



Again, thanks, in advance, for any help offered,
Bap.




shell_script
#!/bin/sh

OPTS='lkjxdf adf'

function echo_args() {
echo $1
echo $2
}

echo_args $OPTS
/shell_script



Quoting Christopher Schultz ch...@christopherschultz.net:


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Bap,

On 6/9/2009 1:06 PM, Bap wrote:

I am trying to set the following system property/value in setenv.sh
com.sun.jndi.ldap.connect.pool.protocol=plain ssl



If I enclose the whole CATALINA_OPTS in single quotes, then the value
looks fine when echoed, but the catalina.out contains Exception in
thread main java.lang.NoClassDefFoundError: ssl



The complete contents of setenv.sh is the single line below.
CATALINA_OPTS='-Xms128m -Xmx256m
-Dcom.sun.jndi.ldap.connect.pool.protocol=plain ssl
-Dcom.sun.jndi.ldap.connect.pool.timeout=1'


So, the above echos fine but causes the NoClassDefFoundError?

Try any one of the following, which might work:

CATALINA_OPTS=-Xms128m -Xmx256m
- -Dcom.sun.jndi.ldap.connect.pool.protocol=plain\ ssl
- -Dcom.sun.jndi.ldap.connect.pool.timeout=1
CATALINA_OPTS='-Xms128m -Xmx256m
- -Dcom.sun.jndi.ldap.connect.pool.protocol=plain\ ssl
- -Dcom.sun.jndi.ldap.connect.pool.timeout=1'
CATALINA_OPTS=-Xms128m -Xmx256m
- -Dcom.sun.jndi.ldap.connect.pool.protocol=\plain ssl\
- -Dcom.sun.jndi.ldap.connect.pool.timeout=1

These will probably not work:

CATALINA_OPTS=-Xms128m -Xmx256m
- -Dcom.sun.jndi.ldap.connect.pool.protocol='plain ssl'
- -Dcom.sun.jndi.ldap.connect.pool.timeout=1
CATALINA_OPTS='-Xms128m -Xmx256m
- -Dcom.sun.jndi.ldap.connect.pool.protocol=plain ssl
- -Dcom.sun.jndi.ldap.connect.pool.timeout=1'

I suspect that there is some quoting being done in the catalina.sh
script itself which is confusing things. Try looking at the script
itself to see where such quoting is being done, and how you might
defeat it :)

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

iEYEARECAAYFAkousdUACgkQ9CaO5/Lv0PA1QQCfT88n8/vMnkbtiC7wnPgQgdVg
438AmwV8lUADAdBfcWd9VeOZYGJqX2Y6
=zRFk
-END PGP SIGNATURE-

-
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: Deploying .war-file in Tomcat 5.5

2009-06-10 Thread Kai Behncke

Thank you all very much for your help.

I did now like:

$ wget
'http://apache.crihan.fr/dist/tomcat/tomcat-6/v6.0.20/bin/apache-tomcat-6.0.20.tar.gz'
$ tar xvzf apache-tomcat-6.0.20.tar.gz
$ cp MapFishPrintModule/print-servlet/target/print-servlet-1.1.war
apache-tomcat-6.0.20/webapps
$ cd apache-tomcat-6.0.20/bin
$ ./startup.sh


and all the problems are gone :-)

Best regards, Kai




Caldarale, Charles R wrote:
 
 From: Christopher Schultz [mailto:ch...@christopherschultz.net]
 Subject: Re: Deploying .war-file in Tomcat 5.5
 
 I disagree with Chuck's complaint about this packaging: it actually
 looks quite sane to me: system-installed stuff goes into
 /usr/share/tomcat5.5/webapps and probably has XML context files in an
 appropriate location (don't ask me where!) to load those.
 /var/lib/tomcat5.5/webapps is the auto-deploy directory that mere
 mortals get to use (though usually /var is read-only for non-root
 users, so... wtf?).
 
 Your don't ask me where and wtf comments seem to conflict with your
 looks quite sane to me statement...
 
 The Debian file scattering approach makes it extremely difficult for
 anyone not running that Debian level and that specific Debian repackaged
 version of Tomcat to provide anything other than general advice.  When the
 repackagers start to muck around in server.xml changing defaults (some of
 them do), it gets even worse.
 
 Ergo, if you want advice from the Tomcat users mailing list, it's best to
 use a standard Tomcat; otherwise, you will likely need help from a
 platform-specific forum.
 
  - 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.
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Deploying-.war-file-in-Tomcat-5.5-tp23886971p23960188.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



Re: setenv.sh - how to set system properties to values containing spaces

2009-06-10 Thread André Warnier

Bap wrote:
...
Looks very much like the problem from hell, where the number of extra 
quoting levels depends on the number of times this thing ends up being 
interpolated.


A suggestion, which involves modifying catalina.sh, but maybe with less 
nefarious effects if it ever gets replaced :


- modify catalina.sh such that, in each command-line executing Tomcat 
and in which $JAVA_OPTS is invoked, you add another $MY_JAVA_OPTS after 
the $JAVA_OPTS.
- then define MY_JAVA_OPTS in setenv.sh, with what you want as 
additional options, using only 1 level of additional quoting.


e.g.

exec $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \

becomes

exec $_RUNJAVA $JAVA_OPTS $MY_JAVA_OPTS $CATALINA_OPTS \

and in setenv.sh :

MY_JAVA_OPTS=-Dsomeparam=\this and that\
or
MY_JAVA_OPTS='-Dsomeparam=this and that'


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



[SECURITY] UPDATED CVE-2008-5515 RequestDispatcher directory traversal vulnerability

2009-06-10 Thread Mark Thomas
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Updated to add additional patches required for 5.5.x and 4.1.x

CVE-2008-5515: Apache Tomcat information disclosure vulnerability

Severity: Important

Vendor:
The Apache Software Foundation

Versions Affected:
Tomcat 4.1.0 to 4.1.39
Tomcat 5.5.0 to 5.5.27
Tomcat 6.0.0 to 6.0.18
The unsupported Tomcat 3.x, 4.0.x and 5.0.x versions may be also affected

Description:
When using a RequestDispatcher obtained from the Request, the target
path was normalised before the query string was removed. A request that
included a specially crafted request parameter could be used to access
content that would otherwise be protected by a security constraint or by
locating it in under the WEB-INF directory.

Mitigation:
6.0.x users should upgrade to 6.0.20 or apply this patch:
http://svn.apache.org/viewvc?view=revrevision=734734
5.5.x users should upgrade to 5.5.28 when released or apply these patches:
http://svn.apache.org/viewvc?view=revrevision=782757
http://svn.apache.org/viewvc?view=revrevision=783291
4.1.x users should upgrade to 4.1.40 when released or apply these patches:
http://svn.apache.org/viewvc?view=revrevision=782763
http://svn.apache.org/viewvc?view=revrevision=783292

Example:
For a page that contains:
%
request.getRequestDispatcher( bar.jsp?somepar=somevalpar= +
request.getParameter( blah ) ).forward( request, response );
%

an attacker can use:
http://host/page.jsp?blah=/../WEB-INF/web.xml

Credit:
This issue was discovered by Iida Minehiko, Fujitsu Limited

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

iEYEARECAAYFAkovmMwACgkQb7IeiTPGAkNPigCcDBEKxwuBoXnvixbqoqM8CIaN
VKYAni4kHySG2JmbYi1hz4xAGpgm36Gr
=7FT9
-END PGP SIGNATURE-


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



How to use a gzip javascript file in a webapp running under tomcat

2009-06-10 Thread balachandra maddina
Hi There,

   Im wondering if its possible to referr a javascript file something like
script ... src ='scriptfile.js.gz' in a html page where the script file is
located in one of the tomcat webapps?
  if not how to send a gzip javascript file to browser? any help would be
appreciated.

Thx,
bala.


Re: setenv.sh - how to set system properties to values containing spaces

2009-06-10 Thread Bap

Hi André,

The solution you have suggested just introduces a new variable, but  
with exactly the same characteristics of the existing CATALINA_OPTS  
variable (unless I am missing something.)


The issue is, that even when the CATALINA_OPTS value looks like it is  
correctly quoted (echo of CATALINA_OPTS below), when java is invoked,  
it gets the system property com.sun.jndi.ldap.connect.pool.protocol  
set to plain and the next argument is ssl which it expects to be the  
class containing main.


-Xms128m -Xmx256m -Dcom.sun.jndi.ldap.connect.pool.protocol=plain  
ssl -Dcom.sun.jndi.ldap.connect.pool.timeout=1


Thanks for the suggestion,
Bap.

Quoting André Warnier a...@ice-sa.com:


Bap wrote:
...
Looks very much like the problem from hell, where the number of  
extra quoting levels depends on the number of times this thing ends  
up being interpolated.


A suggestion, which involves modifying catalina.sh, but maybe with  
less nefarious effects if it ever gets replaced :


- modify catalina.sh such that, in each command-line executing  
Tomcat and in which $JAVA_OPTS is invoked, you add another  
$MY_JAVA_OPTS after the $JAVA_OPTS.
- then define MY_JAVA_OPTS in setenv.sh, with what you want as  
additional options, using only 1 level of additional quoting.


e.g.

   exec $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \

becomes

   exec $_RUNJAVA $JAVA_OPTS $MY_JAVA_OPTS $CATALINA_OPTS \

and in setenv.sh :

MY_JAVA_OPTS=-Dsomeparam=\this and that\
or
MY_JAVA_OPTS='-Dsomeparam=this and that'


-
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



Loading dynamically created content: An old chestnut but still a problem.

2009-06-10 Thread Lyallex
apache-tomcat-6.0.16
jdk1.6.0_03

Dev box : Windows
Deployment box: Linux

Hi

I've read some other posts that seem to be asking similar questions
but I can't find the answer so far.
maybe someone here would be kind enough to give me a hint

I have a retail application that stores the product images in a database.
Each product can have many images and products are being uploaded all the time.

Fetching images from the database every time results in a clunky page
load so I want to cache the images to disk
the first time an item is accessed my cache manager checks the disk
cache to see if images for that item are available.
If not it loads them onto the disk.
this happens in the servlet that serves the item details up so the
images are in the disk cache before the request is forwarded to the
view (jsp)
In the jsp I access the images from the disk cache.

The problem is, the first time I access the item details the images
are written to the cache which resides directly under the
context root but they are not loaded in the view.
If I restart tomcat the images disply fine so I know all the caching
is working correctly.

I can't restart tomcat everytime I upload a new product so how can I
force tomcat to recognise the new images 'on the fly' so as to speak?
The application is running as the ROOT application on the server and
is the only application being served.

An example image might be
../apache-tomcat-6.0.16/webapps/ROOT/imagecache/830_main.jpg
(example)

I'm quite happy that the imagecache is deleted everytime I redeploy
the application because the application is starting to stabilise and
once I have this last problem ironed out
I will only be doing irregular maintenance. The faster loading of
images is more than enough compensation.

I can't use symbolic links to place the imagecache outside the
application space because I develop on Windows and deploy to Linux
(historical, nothing I can do about it)

Any ideas much appreciated.


Many thanks
lyallex

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



Re: Apache Tomcat connection question

2009-06-10 Thread R Ravichandran
Rainer,
Here is my problem. I have a host with one IP address mapped to two domain
names, let us say www.app1.com and www.app2.com served by two web apps
running on Tomcat say webapp1 and webapp2.

I have Apache Tomcat config. setup to forward any requests coming for any of
these two domain names to be routed to Tomcat.

My problem is both of these web apps need to be the ROOT applications on
Tomcat, and somehow the right app must be executed based on the incoming
domain name. How do I setup both apps. as root context and Vhost on Tomcat.

Thanks

Ravi



On Wed, Jun 10, 2009 at 12:58 AM, Rainer Jung rainer.j...@kippdata.dewrote:

 On 10.06.2009 06:00, R Ravichandran wrote:
  Hello,
 
  This is an urgent request. Any feedback is really appreciated.
 
  I have two web applications (let us call main app., and helper app.)
 running
  on Tomcat with an Apache server in from of Tomcat. Both Apache and Tomcat
  are running on the same host. The first web app on Tomcat is running as
 ROOT
  webapp.
 
  I have two websites mapped to the single IP address of the host. I want
 the
  right application accessed depending on the domain name used.
 
  - For example, for the domain name www.app1.com, I want the first
 tomcat
  web app reached.
  - for the domain name www.app2.com I want the second web app reached.
 
  Here is the config, I am using:
  =
  In Apache httpd.conf file:
 
  NameVirtualHost *:80
 
  VirtualHost www.app1.com
ServerName www.app1.com
ProxyPreserveHost On
ProxyPass / http://localhost:8080/app1
ProxyPassReverse / http://localhost:8080/app1
  /VirtualHost
 
  VirtualHost www.app2.com
  ServerName www.app2.com
ProxyPreserveHost On
ProxyPass /totelistm http://localhost:8080/app2
ProxyPassReverse /totelistm http://localhost:8080/app2
  /VirtualHost
 
 
  Here is the uriworkmap.properties file for mod_jk
  worker.list=loadbalancer,status
 
  /=loadbalancer
  /*=loadbalancer
 
  /app2=loadbalancer
  /app2/*=loadbalancer

 You forgot to tell us, what your actual problem is.

 Remarks:

 - I don't understand, why you want to use mod_proxy *and* mod_jk. Choose
 one of them, not both.

 - You can use virtual hosts in Tomcat too and put each webapp as the
 ROOT context in the respective vhost.

 - When using mod_proxy make sure to use ProxyPreserveHost to forward the
 original Hosts header, so that Tomcat can choose the correct vhost.

 Regards,

 Rainer

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




Re: setenv.sh - how to set system properties to values containingspaces

2009-06-10 Thread Rainer Jung
On 10.06.2009 15:09, Bap wrote:
 Hi André,
 
 The solution you have suggested just introduces a new variable, but with
 exactly the same characteristics of the existing CATALINA_OPTS variable
 (unless I am missing something.)
 
 The issue is, that even when the CATALINA_OPTS value looks like it is
 correctly quoted (echo of CATALINA_OPTS below), when java is invoked, it
 gets the system property com.sun.jndi.ldap.connect.pool.protocol set to
 plain and the next argument is ssl which it expects to be the class
 containing main.
 
 -Xms128m -Xmx256m -Dcom.sun.jndi.ldap.connect.pool.protocol=plain ssl
 -Dcom.sun.jndi.ldap.connect.pool.timeout=1
 
 Thanks for the suggestion,
 Bap.
 
 Quoting André Warnier a...@ice-sa.com:
 
 Bap wrote:
 ...
 Looks very much like the problem from hell, where the number of extra
 quoting levels depends on the number of times this thing ends up being
 interpolated.

 A suggestion, which involves modifying catalina.sh, but maybe with
 less nefarious effects if it ever gets replaced :

 - modify catalina.sh such that, in each command-line executing Tomcat
 and in which $JAVA_OPTS is invoked, you add another $MY_JAVA_OPTS
 after the $JAVA_OPTS.
 - then define MY_JAVA_OPTS in setenv.sh, with what you want as
 additional options, using only 1 level of additional quoting.

 e.g.

exec $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \

 becomes

exec $_RUNJAVA $JAVA_OPTS $MY_JAVA_OPTS $CATALINA_OPTS \

 and in setenv.sh :

 MY_JAVA_OPTS=-Dsomeparam=\this and that\
 or
 MY_JAVA_OPTS='-Dsomeparam=this and that'

I know that's not the solution you are looking for, but you can add
system properties in the form

key=value

to the file conf/catalina.properties.

They will automatically be added by Tomcat to the System properties, so
they will be visible to your webapps.

I didn't play around with whitespace there, but at least there's no
shell token expansion involved in catalina.properties and you don't have
to hardcode the flags into your catalina.sh.

In your speciaql case it is not clear, how early during bootstrap the
code which is looking for the properties runs (whether Tomcat already
handled the catalina.properties file), but it is worth a try.

Regards,

Rainer

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



Re: Apache Tomcat connection question

2009-06-10 Thread Rainer Jung
On 10.06.2009 15:42, R Ravichandran wrote:
 Rainer,
 Here is my problem. I have a host with one IP address mapped to two domain
 names, let us say www.app1.com and www.app2.com served by two web apps
 running on Tomcat say webapp1 and webapp2.
 
 I have Apache Tomcat config. setup to forward any requests coming for any of
 these two domain names to be routed to Tomcat.
 
 My problem is both of these web apps need to be the ROOT applications on
 Tomcat, and somehow the right app must be executed based on the incoming
 domain name. How do I setup both apps. as root context and Vhost on Tomcat.

http://tomcat.apache.org/tomcat-6.0-doc/virtual-hosting-howto.html

 On Wed, Jun 10, 2009 at 12:58 AM, Rainer Jung rainer.j...@kippdata.dewrote:
 
 On 10.06.2009 06:00, R Ravichandran wrote:
 Hello,

 This is an urgent request. Any feedback is really appreciated.

 I have two web applications (let us call main app., and helper app.)
 running
 on Tomcat with an Apache server in from of Tomcat. Both Apache and Tomcat
 are running on the same host. The first web app on Tomcat is running as
 ROOT
 webapp.

 I have two websites mapped to the single IP address of the host. I want
 the
 right application accessed depending on the domain name used.

 - For example, for the domain name www.app1.com, I want the first
 tomcat
 web app reached.
 - for the domain name www.app2.com I want the second web app reached.

 Here is the config, I am using:
 =
 In Apache httpd.conf file:

 NameVirtualHost *:80

 VirtualHost www.app1.com
   ServerName www.app1.com
   ProxyPreserveHost On
   ProxyPass / http://localhost:8080/app1
   ProxyPassReverse / http://localhost:8080/app1
 /VirtualHost

 VirtualHost www.app2.com
 ServerName www.app2.com
   ProxyPreserveHost On
   ProxyPass /totelistm http://localhost:8080/app2
   ProxyPassReverse /totelistm http://localhost:8080/app2
 /VirtualHost


 Here is the uriworkmap.properties file for mod_jk
 worker.list=loadbalancer,status

 /=loadbalancer
 /*=loadbalancer

 /app2=loadbalancer
 /app2/*=loadbalancer
 You forgot to tell us, what your actual problem is.

 Remarks:

 - I don't understand, why you want to use mod_proxy *and* mod_jk. Choose
 one of them, not both.

 - You can use virtual hosts in Tomcat too and put each webapp as the
 ROOT context in the respective vhost.

 - When using mod_proxy make sure to use ProxyPreserveHost to forward the
 original Hosts header, so that Tomcat can choose the correct vhost.

 Regards,

 Rainer

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



Re: setenv.sh - how to set system properties to values containing spaces

2009-06-10 Thread André Warnier

Sorry, I mistook CATALINA_OPTS for JAVA_OPTS,
but

Bap wrote:

Hi André,

The solution you have suggested just introduces a new variable, but with 
exactly the same characteristics of the existing CATALINA_OPTS variable 
(unless I am missing something.)


Say that, originally in setenv.sh, you set CATALINA_OPTS as follows (in 
one single line) :


CATALINA_OPTS='-Dcom.sun.jndi.ldap.connect.pool.protocol=plain ssl'

Then, in catalina.sh, a line such as the following :

CATALINA_OPTS=$CATALINA_OPTS $JPDA_OPTS

would make CATALINA_OPTS now be :

-Dcom.sun.jndi.ldap.connect.pool.protocol=plain ssl

then, at the next invocation, say here :

exec $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS 

this would be seen as

exec (whatever) (whatever_java_opts) 
-Dcom.sun.jndi.ldap.connect.pool.protocol=plain ssl (whatever_follows)


which is pretty much what you are seeing, right ?

Now, what I am trying to tell you is :

the CATALINA_OPTS variable is used several times in the catalina.sh 
script, in a way that may make it difficult to determine how many times 
it is being so interpolated into itself before being finally used.

Each level of such interpolation, will remove one level of quoting.

By defining your own variable, and using it just once in catalina.sh, at 
least you know how many times it is being interpolated (just once), and 
you can quote it correctly.




Now, all this being said, why don't you try this in setenv.sh :

CATALINA_OPTS='-Dcom.sun.jndi.ldap.connect.pool.protocol=\plain ssl\'

And all of that being said, whoever decided that the property 
com.sun.jndi.ldap.connect.pool.protocol could be set to a value with 
embedded spaces ought to be exiled to a remote arctic island.

Together with whomever invented file paths with embedded spaces.
Together with whomever decided to install Tomcat by default in 
c:\program files\apache software foundation\.



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



Re: setenv.sh - how to set system properties to values containing spaces

2009-06-10 Thread Rainer Jung
On 10.06.2009 15:47, André Warnier wrote:
 Sorry, I mistook CATALINA_OPTS for JAVA_OPTS,
 but
 
 Bap wrote:
 Hi André,

 The solution you have suggested just introduces a new variable, but
 with exactly the same characteristics of the existing CATALINA_OPTS
 variable (unless I am missing something.)
 
 Say that, originally in setenv.sh, you set CATALINA_OPTS as follows (in
 one single line) :
 
 CATALINA_OPTS='-Dcom.sun.jndi.ldap.connect.pool.protocol=plain ssl'
 
 Then, in catalina.sh, a line such as the following :
 
 CATALINA_OPTS=$CATALINA_OPTS $JPDA_OPTS
 
 would make CATALINA_OPTS now be :
 
 -Dcom.sun.jndi.ldap.connect.pool.protocol=plain ssl
 
 then, at the next invocation, say here :
 
 exec $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS 
 
 this would be seen as
 
 exec (whatever) (whatever_java_opts)
 -Dcom.sun.jndi.ldap.connect.pool.protocol=plain ssl (whatever_follows)
 
 which is pretty much what you are seeing, right ?
 
 Now, what I am trying to tell you is :
 
 the CATALINA_OPTS variable is used several times in the catalina.sh
 script, in a way that may make it difficult to determine how many times
 it is being so interpolated into itself before being finally used.
 Each level of such interpolation, will remove one level of quoting.
 
 By defining your own variable, and using it just once in catalina.sh, at
 least you know how many times it is being interpolated (just once), and
 you can quote it correctly.
 
 
 
 Now, all this being said, why don't you try this in setenv.sh :
 
 CATALINA_OPTS='-Dcom.sun.jndi.ldap.connect.pool.protocol=\plain ssl\'
 
 And all of that being said, whoever decided that the property
 com.sun.jndi.ldap.connect.pool.protocol could be set to a value with
 embedded spaces ought to be exiled to a remote arctic island.
 Together with whomever invented file paths with embedded spaces.
 Together with whomever decided to install Tomcat by default in
 c:\program files\apache software foundation\.

Adding to what André explains: the following small script shows a
working procedure:

#!/usr/bin/ksh

OPTS=-DXXX=a b

# or alternatively
# OPTS=-DXXX=a b

exec /usr/local/jdk1.6.0/bin/java $OPTS myprog

What is important here:

- the original variable including the system property is used on the
commandline, no intermediate expansion or adding other tokens to the
same variable

- there is only one system property in the variable. You cann add the
non-problematic ones to the standard variable, or if there are multiple
properties with spaces, use multiple aditional variables.

- The quotes aroung $OPTS in the line starting java. They are used, so
that the shell passes the whole of $OPTS as one argument to the java
process.

The exec is only there, because it is done like that in the standard script.

Regards,

Rainer

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



RE: custom header

2009-06-10 Thread Anthony J. Biacco
It's the latter. I'm trying to avoid more than one war file across multiple 
instances. I was hoping the urlrewritefilter had a global config, something I 
could put in the tomcat conf dir, but couldn't find such a thing.
I'll go over to their m-list, as that'll be more appropriate now I think.
Thanx again for the pointer in the right direction.

-Tony
 


Sent from my Windows Mobile® phone.

-Original Message-
From: André Warnier a...@ice-sa.com
Sent: Wednesday, June 10, 2009 2:27 AM
To: Tomcat Users List users@tomcat.apache.org
Subject: Re: custom header

Anthony J. Biacco wrote:
 Thanx for that, that sets the header for me, but to something static.
 Only problem I have is I can't seem to figure out how to set it to the 
 hostname of the tomcat server, or a tomcat variable (set from the hostname of 
 the server - i.e. -Dmyjvmroute=`/bin/hostname -s` and then trying to use 
 ${myjvmroute} in a rule such as:
 
I must be missing something here.  Why would you want it to be dynamic ?

If you have several Tomcat instances as back-ends, then each one has its 
own webapps, and each one of these webapps has its own web.xml, which is 
where you configure its own urlrewrite filter.  So what is the problem 
in having it static in there ?

Or, wait, is it purely because you would like to be able to always 
distribute the same identical web.xml to all instances ?
That would then become a more generic issue like how do I distribute 
the same war-file to several Tomcat instances, but have each instance 
pick up something instance-specific to include in its web.xml at load 
time ?

Now, in this case I do believe that the urlrewrite filter uses a 
separate config file, in which maybe there is a way to specify something 
like that.  Maybe then just that file would need to be instance-specific ?


-
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 - how to set system properties to values containingspaces

2009-06-10 Thread Bap

Thank you,

Unfortunately I think I will have to go with this suggestion,  
setenv.sh does not look like it will bear fruit.


Thanks again,
Bap.

Quoting Rainer Jung rainer.j...@kippdata.de:


On 10.06.2009 15:09, Bap wrote:

Hi André,

The solution you have suggested just introduces a new variable, but with
exactly the same characteristics of the existing CATALINA_OPTS variable
(unless I am missing something.)

The issue is, that even when the CATALINA_OPTS value looks like it is
correctly quoted (echo of CATALINA_OPTS below), when java is invoked, it
gets the system property com.sun.jndi.ldap.connect.pool.protocol set to
plain and the next argument is ssl which it expects to be the class
containing main.

-Xms128m -Xmx256m -Dcom.sun.jndi.ldap.connect.pool.protocol=plain ssl
-Dcom.sun.jndi.ldap.connect.pool.timeout=1

Thanks for the suggestion,
Bap.

Quoting André Warnier a...@ice-sa.com:


Bap wrote:
...
Looks very much like the problem from hell, where the number of extra
quoting levels depends on the number of times this thing ends up being
interpolated.

A suggestion, which involves modifying catalina.sh, but maybe with
less nefarious effects if it ever gets replaced :

- modify catalina.sh such that, in each command-line executing Tomcat
and in which $JAVA_OPTS is invoked, you add another $MY_JAVA_OPTS
after the $JAVA_OPTS.
- then define MY_JAVA_OPTS in setenv.sh, with what you want as
additional options, using only 1 level of additional quoting.

e.g.

   exec $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \

becomes

   exec $_RUNJAVA $JAVA_OPTS $MY_JAVA_OPTS $CATALINA_OPTS \

and in setenv.sh :

MY_JAVA_OPTS=-Dsomeparam=\this and that\
or
MY_JAVA_OPTS='-Dsomeparam=this and that'


I know that's not the solution you are looking for, but you can add
system properties in the form

key=value

to the file conf/catalina.properties.

They will automatically be added by Tomcat to the System properties, so
they will be visible to your webapps.

I didn't play around with whitespace there, but at least there's no
shell token expansion involved in catalina.properties and you don't have
to hardcode the flags into your catalina.sh.

In your speciaql case it is not clear, how early during bootstrap the
code which is looking for the properties runs (whether Tomcat already
handled the catalina.properties file), but it is worth a try.

Regards,

Rainer

-
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 - how to set system properties to values containing spaces

2009-06-10 Thread Bap

Hi André,

Now I understand the issue regarding the -jdpa option. I had not even  
considerred that one - if set, then CATALINA_OPTS would require 2  
levels of escape, and, if not set, just one!


I have only been looking at the start block as called by startup.sh  
without using -security


exec (whatever) (whatever_java_opts)  
-Dcom.sun.jndi.ldap.connect.pool.protocol=plain ssl (whatever_follows)


which is pretty much what you are seeing, right ?


No, if I place echo at the start of the line that starts tomcat  
(start block, no -security) what I see is:


/usr/java/default/bin/java  
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager  
-Djava.util.logging.config.file=/opt/bh-adws/conf/logging.properties  
-Xms128m -Xmx256m -Dcom.sun.jndi.ldap.connect.pool.protocol=\plain  
ssl\ -Dcom.sun.jndi.ldap.connect.pool.timeout=1  
-Djava.endorsed.dirs=/opt/bh-adws/endorsed -classpath  
:/opt/bh-adws/bin/bootstrap.jar -Dcatalina.base=/opt/bh-adws  
-Dcatalina.home=/opt/bh-adws -Djava.io.tmpdir=/opt/bh-adws/temp  
org.apache.catalina.startup.Bootstrap start


using you suggestion below, and

/usr/java/default/bin/java  
-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager  
-Djava.util.logging.config.file=/opt/bh-adws/conf/logging.properties  
-Xms128m -Xmx256m -Dcom.sun.jndi.ldap.connect.pool.protocol=plain  
ssl -Dcom.sun.jndi.ldap.connect.pool.timeout=1  
-Djava.endorsed.dirs=/opt/bh-adws/endorsed -classpath  
:/opt/bh-adws/bin/bootstrap.jar -Dcatalina.base=/opt/bh-adws  
-Dcatalina.home=/opt/bh-adws -Djava.io.tmpdir=/opt/bh-adws/temp  
org.apache.catalina.startup.Bootstrap start


if I use

CATALINA_OPTS='-Xms128m -Xmx256m  
-Dcom.sun.jndi.ldap.connect.pool.protocol=plain ssl  
-Dcom.sun.jndi.ldap.connect.pool.timeout=1'


as you can see, the quoting looks correct, yet the shell passes  
through 2 separate arguments for the property first as  
-Dcom.sun.jndi.ldap.connect.pool.protocol=plain and the seccond as ssl


I think I am going to have to go with Rainer's suggestion of appending  
to conf/catalina.properties - not very nice, but should work.


Thanks for all your help,
Bap.


As far as system properties go - why does Sun insist on using them for  
configuration, with no alternatives for configuration within a given  
scope, not jvm wide?



Quoting André Warnier a...@ice-sa.com:


Sorry, I mistook CATALINA_OPTS for JAVA_OPTS,
but

Bap wrote:

Hi André,

The solution you have suggested just introduces a new variable, but  
with exactly the same characteristics of the existing CATALINA_OPTS  
variable (unless I am missing something.)


Say that, originally in setenv.sh, you set CATALINA_OPTS as follows  
(in one single line) :


CATALINA_OPTS='-Dcom.sun.jndi.ldap.connect.pool.protocol=plain ssl'

Then, in catalina.sh, a line such as the following :

CATALINA_OPTS=$CATALINA_OPTS $JPDA_OPTS

would make CATALINA_OPTS now be :

-Dcom.sun.jndi.ldap.connect.pool.protocol=plain ssl

then, at the next invocation, say here :

exec $_RUNJAVA $JAVA_OPTS $CATALINA_OPTS 

this would be seen as

exec (whatever) (whatever_java_opts)  
-Dcom.sun.jndi.ldap.connect.pool.protocol=plain ssl (whatever_follows)


which is pretty much what you are seeing, right ?

Now, what I am trying to tell you is :

the CATALINA_OPTS variable is used several times in the catalina.sh  
script, in a way that may make it difficult to determine how many  
times it is being so interpolated into itself before being finally  
used.

Each level of such interpolation, will remove one level of quoting.

By defining your own variable, and using it just once in  
catalina.sh, at least you know how many times it is being  
interpolated (just once), and you can quote it correctly.




Now, all this being said, why don't you try this in setenv.sh :

CATALINA_OPTS='-Dcom.sun.jndi.ldap.connect.pool.protocol=\plain ssl\'

And all of that being said, whoever decided that the property  
com.sun.jndi.ldap.connect.pool.protocol could be set to a value  
with embedded spaces ought to be exiled to a remote arctic island.

Together with whomever invented file paths with embedded spaces.
Together with whomever decided to install Tomcat by default in  
c:\program files\apache software foundation\.



-
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 - how to set system properties to values containing spaces

2009-06-10 Thread Bap

Thanks again Rainer,


Your seccond two points were covered in my initial mail containing the  
test code


orig-quote
I am pretty sure that the issue is with the shell, and have been using  
the code below to test all sorts of combinations of values for OPTS -  
the only way I can get the arg to print on one line is to quote $OPTS  
when it is expanded, which obviously will not work if there are any  
other options required in CATALINA_OPTS.

/orig-quote

exec is not included in my example, as tc 6.0.16 does not include it  
when it starts only when it runs.


Thanks again, catalina.properties it is.
Bap.





Adding to what André explains: the following small script shows a
working procedure:

#!/usr/bin/ksh

OPTS=-DXXX=a b

# or alternatively
# OPTS=-DXXX=a b

exec /usr/local/jdk1.6.0/bin/java $OPTS myprog

What is important here:

- the original variable including the system property is used on the
commandline, no intermediate expansion or adding other tokens to the
same variable

- there is only one system property in the variable. You cann add the
non-problematic ones to the standard variable, or if there are multiple
properties with spaces, use multiple aditional variables.

- The quotes aroung $OPTS in the line starting java. They are used, so
that the shell passes the whole of $OPTS as one argument to the java
process.

The exec is only there, because it is done like that in the standard script.

Regards,

Rainer

-
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



Tomcat maxThreads Issue

2009-06-10 Thread Jones, Keven
Hello,

I have Tomcat (can't figure out what version as the version.sh script is giving 
all kinds of errors) running on separate Linux servers. So an overview of my 
config is
1 web server, 4 app servers (tomcat), and 1 db server.

We were seeing an increase in the httpd processes on the web server to the 
point where I had to increase the MaxClients on the apache 2 server to 2048. I 
finally figured out that the normal number of httpd daemons on the web server 
(50-100) was spiking due to tomcat processes stalling or going completely down.

So I started looking at why tomcat was failing and I found this error message 
in the ACStarError.log :


SEVERE: All threads (200) are currently busy, waiting. Increase maxThreads 
(200) or check the servlet status.
So I checked the server.xml file and found the following:

Connector port=81 protocol=HTTP/1.1
  server=-
  maxThreads=600 connectionTimeout=2
   redirectPort=443 /
!-- Awele 20070402 For SSL Requests, processed non-SSL,
due to Coyote SSL Accelerator --
!--
Connector port=443 address=10.5.3.9 protocol=HTTP/1.1
   server=-
   secure=true
   maxThreads=600 connectionTimeout=2
/
--
!-- Define a SSL HTTP/1.1 Connector on port 8443
 This connector uses the JSSE configuration, when using APR, the
 connector should be using the OpenSSL style configuration
 described in the APR documentation --
!--
Connector port=8443 protocol=HTTP/1.1 SSLEnabled=true
   maxThreads=150 scheme=https secure=true
   clientAuth=false sslProtocol=TLS /
--

So It looks like the maxThreads has already been increased to 600. The server 
has been rebooted and tomcat stopped/started multiple times. Again all servers 
are Red Hat 5.2. Is there an additional parameter that needs to be set in order 
for tomcat to actually increase the maxThreads ?
Thank You

Keven Jones



Re: Tomcat maxThreads Issue

2009-06-10 Thread Mark Thomas
Jones, Keven wrote:
 Hello,
 
 I have Tomcat (can't figure out what version as the version.sh script is 
 giving all kinds of errors) running on separate Linux servers. So an overview 
 of my config is
 1 web server, 4 app servers (tomcat), and 1 db server.
 
 We were seeing an increase in the httpd processes on the web server to the 
 point where I had to increase the MaxClients on the apache 2 server to 2048. 
 I finally figured out that the normal number of httpd daemons on the web 
 server (50-100) was spiking due to tomcat processes stalling or going 
 completely down.
 
 So I started looking at why tomcat was failing and I found this error message 
 in the ACStarError.log :
 
 
 SEVERE: All threads (200) are currently busy, waiting. Increase maxThreads 
 (200) or check the servlet status.
 So I checked the server.xml file and found the following:
 
 Connector port=81 protocol=HTTP/1.1
   server=-
   maxThreads=600 connectionTimeout=2
redirectPort=443 /
 !-- Awele 20070402 For SSL Requests, processed non-SSL,
 due to Coyote SSL Accelerator --
 !--
 Connector port=443 address=10.5.3.9 protocol=HTTP/1.1
server=-
secure=true
maxThreads=600 connectionTimeout=2
 /
 --
 !-- Define a SSL HTTP/1.1 Connector on port 8443
  This connector uses the JSSE configuration, when using APR, the
  connector should be using the OpenSSL style configuration
  described in the APR documentation --
 !--
 Connector port=8443 protocol=HTTP/1.1 SSLEnabled=true
maxThreads=150 scheme=https secure=true
clientAuth=false sslProtocol=TLS /
 --
 
 So It looks like the maxThreads has already been increased to 600. The server 
 has been rebooted and tomcat stopped/started multiple times. Again all 
 servers are Red Hat 5.2. Is there an additional parameter that needs to be 
 set in order for tomcat to actually increase the maxThreads ?
 Thank You

That is the http connector. What about the APR connector? You can leave
out stuff that is commented out.

Mark



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



RE: Tomcat maxThreads Issue

2009-06-10 Thread Jones, Keven
 Here is the complete config file. Thanks for the quick reply.



-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Wednesday, June 10, 2009 11:14 AM
To: Tomcat Users List
Subject: Re: Tomcat maxThreads Issue

Jones, Keven wrote:
 Hello,
 
 I have Tomcat (can't figure out what version as the version.sh script 
 is giving all kinds of errors) running on separate Linux servers. So 
 an overview of my config is
 1 web server, 4 app servers (tomcat), and 1 db server.
 
 We were seeing an increase in the httpd processes on the web server to the 
 point where I had to increase the MaxClients on the apache 2 server to 2048. 
 I finally figured out that the normal number of httpd daemons on the web 
 server (50-100) was spiking due to tomcat processes stalling or going 
 completely down.
 
 So I started looking at why tomcat was failing and I found this error message 
 in the ACStarError.log :
 
 
 SEVERE: All threads (200) are currently busy, waiting. Increase maxThreads 
 (200) or check the servlet status.
 So I checked the server.xml file and found the following:
 
 Connector port=81 protocol=HTTP/1.1
   server=-
   maxThreads=600 connectionTimeout=2
redirectPort=443 /
 !-- Awele 20070402 For SSL Requests, processed non-SSL, due to Coyote 
 SSL Accelerator --
 !--
 Connector port=443 address=10.5.3.9 protocol=HTTP/1.1
server=-
secure=true
maxThreads=600 connectionTimeout=2
 /
 --
 !-- Define a SSL HTTP/1.1 Connector on port 8443
  This connector uses the JSSE configuration, when using APR, the
  connector should be using the OpenSSL style configuration
  described in the APR documentation --
 !--
 Connector port=8443 protocol=HTTP/1.1 SSLEnabled=true
maxThreads=150 scheme=https secure=true
clientAuth=false sslProtocol=TLS /
 --
 
 So It looks like the maxThreads has already been increased to 600. The server 
 has been rebooted and tomcat stopped/started multiple times. Again all 
 servers are Red Hat 5.2. Is there an additional parameter that needs to be 
 set in order for tomcat to actually increase the maxThreads ?
 Thank You

That is the http connector. What about the APR connector? You can leave out 
stuff that is commented out.

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: Tomcat maxThreads Issue

2009-06-10 Thread Peter Crowther
 From: Jones, Keven [mailto:keven.jo...@ncr.com]
  Here is the complete config file. Thanks for the quick reply.

The list strips attachments - please paste inline.

- Peter

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



Re: tomcat6.0.18 service unable to start

2009-06-10 Thread Steve Ochani
Send reply to:  Tomcat Users List users@tomcat.apache.org
Date sent:  Wed, 10 Jun 2009 10:32:27 +0200
From:   André Warnier a...@ice-sa.com
Send reply to:  a...@ice-sa.com
To: Tomcat Users List users@tomcat.apache.org
Subject:Re: tomcat6.0.18 service unable to start

 teoh wrote:
  my tomcat6 service unable to startup with error 0 code. i already
  tried put msvcr71.dll in tomcat/bin directory. still the same
 
  i'm using tomcat 6.0.18 with windows xp 32bits system
 
  in console, i able to start up the tomcat, but not on service.  any
  suggestion what i missed out?
 
  my process monitor log at  http://www.sendspace.com/file/t0tahr
 
 Not an answer to the problem, but the link you provide requires a
 signup, which many people will not want to do. So, basically, we can't


Not really, scroll down and click the link to download, ignore the ad about 
registration.


 see your logfile. Can't you paste the relevant few lines right here ?


 -
 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: Tomcat maxThreads Issue

2009-06-10 Thread Jones, Keven
Sorry, here is the complete server.xml file:

!-- Note:  A Server is not itself a Container, so you may not
 define subcomponents such as Valves at this level.
 Documentation at /docs/config/server.html
 --
Server port=9011 shutdown=SHUTDOWN

  !--APR library loader. Documentation at /docs/apr.html --
  Listener className=org.apache.catalina.core.AprLifecycleListener 
SSLEngine=on /
  !--Initialize Jasper prior to webapps are loaded. Documentation at 
/docs/jasper-howto.html --
  Listener className=org.apache.catalina.core.JasperListener /
  !-- JMX Support for the Tomcat server. Documentation at 
/docs/non-existent.html --
  Listener className=org.apache.catalina.mbeans.ServerLifecycleListener /
  Listener 
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener /

  !-- Global JNDI resources
   Documentation at /docs/jndi-resources-howto.html
  --
  GlobalNamingResources
!-- Editable user database that can also be used by
 UserDatabaseRealm to authenticate users
--
Resource name=UserDatabase auth=Container
  type=org.apache.catalina.UserDatabase
  description=User database that can be updated and saved
  factory=org.apache.catalina.users.MemoryUserDatabaseFactory
  pathname=conf/tomcat-users.xml /
  /GlobalNamingResources

  !-- A Service is a collection of one or more Connectors that share
   a single Container Note:  A Service is not itself a Container,
   so you may not define subcomponents such as Valves at this level.
   Documentation at /docs/config/service.html
   --
  Service name=Catalina

!-- A Connector represents an endpoint by which requests are received
 and responses are returned. Documentation at :
 Java HTTP Connector: /docs/config/http.html (blocking  non-blocking)
 Java AJP  Connector: /docs/config/ajp.html
 APR (HTTP/AJP) Connector: /docs/apr.html
 Define a non-SSL HTTP/1.1 Connector on port 8080
--

Connector port=81 protocol=HTTP/1.1
   server=-
   maxThreads=600 connectionTimeout=2
   redirectPort=443 /

!-- Awele 20070402 For SSL Requests, processed non-SSL,
due to Coyote SSL Accelerator --
!--
Connector port=443 address=10.5.3.9 protocol=HTTP/1.1
   server=-
   secure=true
   maxThreads=600 connectionTimeout=2
/

--
!-- Define a SSL HTTP/1.1 Connector on port 8443
 This connector uses the JSSE configuration, when using APR, the
 connector should be using the OpenSSL style configuration
 described in the APR documentation --
!--
Connector port=8443 protocol=HTTP/1.1 SSLEnabled=true
   maxThreads=150 scheme=https secure=true
   clientAuth=false sslProtocol=TLS /
--

!-- Define an AJP 1.3 Connector on port 8009 --

Connector port=8011
enableLookups=false protocol=AJP/1.3 redirectPort=8443 /


!-- An Engine represents the entry point (within Catalina) that processes
 every request.  The Engine implementation for Tomcat stand alone
 analyzes the HTTP headers included with the request, and passes them
 on to the appropriate Host (virtual host).
 Documentation at /docs/config/engine.html --

!-- You should set jvmRoute to support load-balancing via AJP ie :
--
Engine name=Standalone defaultHost=localhost jvmRoute=mweb3a
!--
Engine name=Catalina defaultHost=localhost
--
  !--For clustering, please take a look at documentation at:
  /docs/cluster-howto.html  (simple how to)
  /docs/config/cluster.html (reference documentation) --
  !--
  Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster/
  --

  !-- The request dumper valve dumps useful debugging information about
   the request and response data received and sent by Tomcat.
   Documentation at: /docs/config/valve.html --
  !--
  Valve className=org.apache.catalina.valves.RequestDumperValve/
  --

  !-- This Realm uses the UserDatabase configured in the global JNDI
   resources under the key UserDatabase.  Any edits
   that are performed against this UserDatabase are immediately
   available for use by the Realm.  --
  Realm className=org.apache.catalina.realm.UserDatabaseRealm
 resourceName=UserDatabase/

  !-- Define the default virtual host
   Note: XML Schema validation will not work with Xerces 2.2.
   --
  Host name=localhost  appBase=/usr/local/tomcat/webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

!-- SingleSignOn valve, share authentication between web applications
 Documentation at: /docs/config/valve.html --
!--
Valve className=org.apache.catalina.authenticator.SingleSignOn /
--

!-- Access log 

RE: Tomcat maxThreads Issue

2009-06-10 Thread Caldarale, Charles R
 From: Jones, Keven [mailto:keven.jo...@ncr.com]
 Subject: RE: Tomcat maxThreads Issue
 
 !-- Define an AJP 1.3 Connector on port 8009 --
 Connector port=8011
 enableLookups=false protocol=AJP/1.3 redirectPort=8443 /

This is the connector Mark was referring to (he should have said AJP, not APR). 
 Since you have no maxThreads attribute, it defaults to 200, which may or may 
not be appropriate for your expected load.

The real question is what are those 200 threads doing?  Try taking a couple of 
thread dumps when you get into the problem and see what they're stuck on.

 Engine name=Standalone defaultHost=localhost
 jvmRoute=mweb3a

You really should have the Engine and Service names the same, to keep JMX 
happy.

 - 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: Tomcat maxThreads Issue

2009-06-10 Thread Jones, Keven
I don't have any tomcat knowledge. Thank you for the reply.
How do I

A. get thread dumps when the processes are dying

And

B. You mentioned the engine and service name. I see we have Engine set to 
Standalone,
And I see the Service is catalina (?) which should I adjust?

Thx again

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Wednesday, June 10, 2009 11:33 AM
To: Tomcat Users List
Subject: RE: Tomcat maxThreads Issue

 From: Jones, Keven [mailto:keven.jo...@ncr.com]
 Subject: RE: Tomcat maxThreads Issue
 
 !-- Define an AJP 1.3 Connector on port 8009 --
 Connector port=8011
 enableLookups=false protocol=AJP/1.3 redirectPort=8443 
 /

This is the connector Mark was referring to (he should have said AJP, not APR). 
 Since you have no maxThreads attribute, it defaults to 200, which may or may 
not be appropriate for your expected load.

The real question is what are those 200 threads doing?  Try taking a couple of 
thread dumps when you get into the problem and see what they're stuck on.

 Engine name=Standalone defaultHost=localhost
 jvmRoute=mweb3a

You really should have the Engine and Service names the same, to keep JMX 
happy.

 - 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: Tomcat maxThreads Issue

2009-06-10 Thread Peter Crowther
 From: Jones, Keven [mailto:keven.jo...@ncr.com]
 How do I

 A. get thread dumps when the processes are dying

The top of 
http://java.sun.com/developer/technicalArticles/Programming/Stacktrace/ is good 
general reading.

kill -QUIT pid of Java process

If ps is confused by all the threads, depending on your Java version, you might 
be able to use jps 
(http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jps.html) to get the pid.

Depending on your Java version, jstack 
(http://java.sun.com/j2se/1.5.0/docs/tooldocs/share/jstack.html) will also give 
you thread dumps.

- Peter

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



RE: Tomcat maxThreads Issue

2009-06-10 Thread Jones, Keven
FYI, I'm just the linux admin as the applicatons group/developer and coder is 
not making any headway into resolving this. This is a mobility application (ie. 
Mobile banking, so you go to your iphone and go to your bank.mobi..)not that it 
matter but

Ok, So yesterday I did perform a kill -3 and got a THREAD DUMP in the 
catalina.out file. I have copied most of it below:

= FULL THREAD DUMP ===
Tue Jun  9 15:32:27 2009
BEA JRockit(R) R27.1.0-109-73164-1.5.0_08-20061129-1415-linux-x86_64

Main Thread id=1 idx=0x2 tid=10410 prio=5 alive, in native

(Signal Handler) id=2 idx=0x4 tid=10412 prio=5 alive, in native, daemon

(Code Generation Thread 1) id=3 idx=0x6 tid=10413 prio=5 alive, in native, 
native_waiting, daemon

(Code Optimization Thread 1) id=4 idx=0x8 tid=10414 prio=5 alive, in native, 
native_waiting, daem
on

(GC Main Thread) id=5 idx=0xa tid=10415 prio=5 alive, in native, daemon

(GC Worker Thread 1) id=? idx=0xc tid=10416 prio=5 terminated, daemon

(GC Worker Thread 2) id=? idx=0xe tid=10417 prio=5 terminated, daemon

(GC Worker Thread 3) id=? idx=0x10 tid=10418 prio=5 terminated, daemon

(GC Worker Thread 4) id=? idx=0x12 tid=10419 prio=5 terminated, daemon

(GC Worker Thread 5) id=? idx=0x14 tid=10420 prio=5 terminated, daemon

(GC Worker Thread 6) id=? idx=0x16 tid=10421 prio=5 terminated, daemon

(GC Worker Thread 7) id=? idx=0x18 tid=10422 prio=5 terminated, daemon
(GC Worker Thread 8) id=? idx=0x1a tid=10423 prio=5 terminated, daemon

(VM Periodic Task) id=6 idx=0x1c tid=10424 prio=10 alive, in native, daemon

Finalizer id=7 idx=0x1e tid=10425 prio=8 alive, in native, native_waiting, 
daemon
at jrockit/memory/Finalizer.getPendingFinalizee(Z)Ljava/lang/Object;(Native 
Method)
at jrockit/memory/Finalizer.access$100(Z)Ljava/lang/Object;(Unknown 
Source)[optimized]
at jrockit/memory/Finalizer$4.run()V(Unknown Source)
at java/lang/Thread.run(Thread.java:595)
at jrockit/vm/RNI.c2java()V(Native Method)
-- end of trace

Reference Handler id=8 idx=0x20 tid=10426 prio=10 alive, in native, 
native_waiting, daemon
at java/lang/ref/Reference.getPending()Ljava/lang/ref/Reference;(Native 
Method)
at java/lang/ref/Reference.access$000()Ljava/lang/ref/Reference;(Unknown 
Source)
at java/lang/ref/Reference$ReferenceHandler.run()V(Unknown Source)
at jrockit/vm/RNI.c2java()V(Native Method)
-- end of trace

(Sensor Event Thread) id=9 idx=0x22 tid=10427 prio=5 alive, in native, daemon

Thread-1 id=12 idx=0x24 tid=10436 prio=1 alive, in native, sleeping, 
native_waiting
at java/lang/Thread.sleep(J)V(Native Method)
at com/mshift/d/j.run()V(Unknown Source)
at jrockit/vm/RNI.c2java()V(Native Method)
-- end of trace

ContainerBackgroundProcessor[StandardEngine[Standalone]] id=13 idx=0x26 
tid=10437 prio=5 alive, i
n native, sleeping, native_waiting, daemon
at java/lang/Thread.sleep(J)V(Native Method)
at 
org/apache/catalina/core/ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1
549)
at java/lang/Thread.run(Thread.java:595)
at jrockit/vm/RNI.c2java()V(Native Method)
-- end of trace

http-81-Acceptor-0 id=14 idx=0x28 tid=10439 prio=5 alive, in native, daemon
at java/net/PlainSocketImpl.socketAccept(Ljava/net/SocketImpl;)V(Native 
Method)
at java/net/PlainSocketImpl.accept(PlainSocketImpl.java:384)
^-- Holding lock: java/net/sockssocketi...@0x13141ec0[thin lock]
at java/net/ServerSocket.implAccept(ServerSocket.java:450)
at java/net/ServerSocket.accept(ServerSocket.java:421)
at 
org/apache/tomcat/util/net/DefaultServerSocketFactory.acceptSocket(DefaultServerSocketFactor
y.java:61)
at org/apache/tomcat/util/net/JIoEndpoint$Acceptor.run(JIoEndpoint.java:310)
at java/lang/Thread.run(Thread.java:595)
at jrockit/vm/RNI.c2java()V(Native Method)
-- end of trace

aRequest: -Completed- id=105163 idx=0x2a tid=18944 prio=5 alive, in native, 
waiting, daemon
-- Waiting for notification on: 
org/apache/tomcat/util/net/jioendpoint$wor...@0x27a6a568[fat lo
ck]
at jrockit/vm/Threads.waitForSignal(J)Z(Native Method)
at jrockit/vm/Locks.wait(Ljava/lang/Object;J)V(Unknown Source)[inlined]
at java/lang/Object.wait()V(Native Method)[optimized]
at org/apache/tomcat/util/net/JIoEndpoint$Worker.await(JIoEndpoint.java:414)
^-- Lock released while waiting: 
org/apache/tomcat/util/net/jioendpoint$wor...@0x27a6a568[fat l
ock]
at org/apache/tomcat/util/net/JIoEndpoint$Worker.run(JIoEndpoint.java:440)
at java/lang/Thread.run(Thread.java:595)[optimized]
at jrockit/vm/RNI.c2java()V(Native Method)
-- end of trace

aRequest: -Completed- id=16 idx=0x2c tid=10441 prio=5 alive, in native, daemon
at 
jrockit/net/SocketNativeIO.readBytesPinned(Ljava/io/FileDescriptor;[BIII)I(Native
 Method)
at 
jrockit/net/SocketNativeIO.socketRead(Ljava/io/FileDescriptor;[BIII)I(Unknown 
Source)[inline
d]
at 

Re: Loading dynamically created content: An old chestnut but still a problem.

2009-06-10 Thread Jonathan Mast
So you are actually storing the image data in the database, as opposed to
the filepath? interesting...

So your webapp accesses the image data as needed and writes it to imagecache
dir?  Is this feature not working? i don't understand what exactly the issue
is that you are having.  please explain.



On Wed, Jun 10, 2009 at 9:41 AM, Lyallex lyal...@gmail.com wrote:

 apache-tomcat-6.0.16
 jdk1.6.0_03

 Dev box : Windows
 Deployment box: Linux

 Hi

 I've read some other posts that seem to be asking similar questions
 but I can't find the answer so far.
 maybe someone here would be kind enough to give me a hint

 I have a retail application that stores the product images in a database.
 Each product can have many images and products are being uploaded all the
 time.

 Fetching images from the database every time results in a clunky page
 load so I want to cache the images to disk
 the first time an item is accessed my cache manager checks the disk
 cache to see if images for that item are available.
 If not it loads them onto the disk.
 this happens in the servlet that serves the item details up so the
 images are in the disk cache before the request is forwarded to the
 view (jsp)
 In the jsp I access the images from the disk cache.

 The problem is, the first time I access the item details the images
 are written to the cache which resides directly under the
 context root but they are not loaded in the view.
 If I restart tomcat the images disply fine so I know all the caching
 is working correctly.

 I can't restart tomcat everytime I upload a new product so how can I
 force tomcat to recognise the new images 'on the fly' so as to speak?
 The application is running as the ROOT application on the server and
 is the only application being served.

 An example image might be
 ../apache-tomcat-6.0.16/webapps/ROOT/imagecache/830_main.jpg
 (example)

 I'm quite happy that the imagecache is deleted everytime I redeploy
 the application because the application is starting to stabilise and
 once I have this last problem ironed out
 I will only be doing irregular maintenance. The faster loading of
 images is more than enough compensation.

 I can't use symbolic links to place the imagecache outside the
 application space because I develop on Windows and deploy to Linux
 (historical, nothing I can do about it)

 Any ideas much appreciated.


 Many thanks
 lyallex

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




RE: Tomcat maxThreads Issue

2009-06-10 Thread Peter Crowther
OK, so that's a JRockit JVM, not a Sun JVM.  Remind me not to point you at any 
more Sun documentation!

As a rough look at that, there are a few threads in the HTTP connector thread 
pool, a bunch of threads reading data from JK connections, and one or two in 
your app code.  I've never looked at the innards of JK, so will have to leave 
that to one of the JK experts to interpret.

- Peter

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



Does user's network connection speed affect response time logged by AccessLogValve (i.e. %D) ?

2009-06-10 Thread William Milbratz

Hi all,
 
Pardon me if this seems an ignorant question.
 
I’ve recently discovered the %D option in the tomcat
AccessLogValve to record response times on the “server side”.
 
I wanted to doublecheck an issue: does the user’s network
connection speed affect the time recorded by the AccessLogValve.
 
Initially I thought that this time is “pure server side”.
 
Then as I considered TCP/IP socket details (and my
ignorance), as well as  where/when
buffering takes place in the Tomcat/Coyote stack,  I thought I should dig a bit 
deeper.
 
I’ve delved into the tomcat source (5.5) but didn’t get
terribly far.  I do know that the coyote
“outputBuffer” has a default 8K buffer size, but don’t know if classes farther
up the stack has more buffering .
 
Thanks,
 
bill




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



Re: Tomcat maxThreads Issue

2009-06-10 Thread Tim Funk

Looking at the history of the thread - here are some guesses 

You have a connector on port 81 (http) and a connector on 8011 (ajp) and 
commented out connector for 443.


The port 81 connector and commented out connector are set to 600 - which 
means absolutely nothing if apache is talking to tomcat via jk.


Set |maxThreads on the connector for using port 8011 and life should be 
better.


If there are mulitple apache servers in front of tomcat  - you need to 
ensure you have (#apaches * max number connections per apache) threads 
available on each tomcat. The thread history seems to indicate you only 
have one apache with 100 workers max. So raising the maxThreads in 
tomcat from 200 to something higher is not needed.


Is there a firewall between apache and tomcat? If so - it could mean 
that your firewall is timing out the connection and then bad things happen.

|
http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html


-Tim

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



Re: Tomcat maxThreads Issue

2009-06-10 Thread Jonathan Mast
I encountered a similar issue of numerous Httpd processes spawning b/c of
Tomcat.  The issue for me was that Tomcat was running out of memory, and
Httpd for some reason thought spawning a bunch a threads would help ;)

Do you know how much memory these instances of Tomcat are using?  The
default JVM memory is ridiculously low and requires the adjustment to higher
maximum value for production servers.

Grep heap catalina.out to see if tomcat is indeed running out of memory.

On Wed, Jun 10, 2009 at 12:44 PM, Peter Crowther 
peter.crowt...@melandra.com wrote:

 OK, so that's a JRockit JVM, not a Sun JVM.  Remind me not to point you at
 any more Sun documentation!

 As a rough look at that, there are a few threads in the HTTP connector
 thread pool, a bunch of threads reading data from JK connections, and one or
 two in your app code.  I've never looked at the innards of JK, so will have
 to leave that to one of the JK experts to interpret.

- Peter

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




Re: Does user's network connection speed affect response time logged by AccessLogValve (i.e. %D) ?

2009-06-10 Thread Tim Funk
AccessLogValve cannot log until the request is done. Done meaning that 
the Servlet is done writing its content.


So AccessLogValve can execute once the Servlet is done writing. It may 
(or may not) mean the client has yet received all the content since the 
OS might do some buffering. The outputBuffer with a default of 8k is 
unrelated to this topic.


-Tim

William Milbratz wrote:

Hi all,
 
Pardon me if this seems an ignorant question.
 
I’ve recently discovered the %D option in the tomcat

AccessLogValve to record response times on the “server side”.
 
I wanted to doublecheck an issue: does the user’s network

connection speed affect the time recorded by the AccessLogValve.
 
Initially I thought that this time is “pure server side”.
 
Then as I considered TCP/IP socket details (and my

ignorance), as well as  where/when
buffering takes place in the Tomcat/Coyote stack,  I thought I should dig a bit 
deeper.
 
I’ve delved into the tomcat source (5.5) but didn’t get

terribly far.  I do know that the coyote
“outputBuffer” has a default 8K buffer size, but don’t know if classes farther
up the stack has more buffering .
 



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



RE: Tomcat maxThreads Issue

2009-06-10 Thread Jones, Keven
I did a grep for heap in catalina.out but do not see any out of memory entries.
How do I check the default JVM memory setting and how do I adjust it?

Thx 

-Original Message-
From: Jonathan Mast [mailto:jhmast.develo...@gmail.com] 
Sent: Wednesday, June 10, 2009 1:04 PM
To: Tomcat Users List
Subject: Re: Tomcat maxThreads Issue

I encountered a similar issue of numerous Httpd processes spawning b/c of 
Tomcat.  The issue for me was that Tomcat was running out of memory, and Httpd 
for some reason thought spawning a bunch a threads would help ;)

Do you know how much memory these instances of Tomcat are using?  The default 
JVM memory is ridiculously low and requires the adjustment to higher maximum 
value for production servers.

Grep heap catalina.out to see if tomcat is indeed running out of memory.

On Wed, Jun 10, 2009 at 12:44 PM, Peter Crowther  peter.crowt...@melandra.com 
wrote:

 OK, so that's a JRockit JVM, not a Sun JVM.  Remind me not to point 
 you at any more Sun documentation!

 As a rough look at that, there are a few threads in the HTTP connector 
 thread pool, a bunch of threads reading data from JK connections, and 
 one or two in your app code.  I've never looked at the innards of JK, 
 so will have to leave that to one of the JK experts to interpret.

- Peter

 -
 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: Loading dynamically created content: An old chestnut but still a problem.

2009-06-10 Thread Lyallex
Hi

I'll try to explain in as few words as possible.

When I upload a new product I store the image data and the text in the
database. I did this to try and separate the data from the application
 with the intention of eventually having the data reside on a separate
device optimised for serving data ... well that was my original
thinking anyway.

At the moment, when I load an image I use a proxy servlet and extract
the imageid from the 'Product' (p below)

img src=ImageProxy?%=WebConstants.IMAGE_ID%=%=p.calculateImageId()%...
etc '/

This gets the image from the database and displays it in the page.

This is clunky and slow and the image is not cached by the browser

So, when a user views an item detail I do something like this

getProductDetails?productId='whatever'

In the GetProductDetails servlet I check the disk cache to see if the
image is there, if not I get it from the database an write it to the
cache, just one database access as opposed to many, the next time
anyone sees that item the images are already cached.

now, in the jsp I can use img
src=imagecache/%=p.getProductId()%_thumb.jpg  ...' etc/

In other words, as opposed to getting an anonymous byte stream and
displaying it in the browser I'm now accessing a named image and the
browser caches it. It all works beautifully apart from the fact that
it appears the DefaultServlet will not load resources that have been
written to disk after the server has been started. If I restart the
server I can see my images, but only the ones loaded thus far ...

Anyway, I'm currently looking at the serveResource() method in the
DefaultServlet to try and figure out if it is possible to configure it
to load resoures that have appeared after the server has started ...
it doesn't look like it is possible which is slightly depressing ...
unless of course I am missing something.

Surely this is not an unusual requirement, how do others deal with
serving up images that have been uploaded after the server has
started.

Anyway

Thanks for taking the time to reply
lyallex


2009/6/10 Jonathan Mast jhmast.develo...@gmail.com:
 So you are actually storing the image data in the database, as opposed to
 the filepath? interesting...

 So your webapp accesses the image data as needed and writes it to imagecache
 dir?  Is this feature not working? i don't understand what exactly the issue
 is that you are having.  please explain.



 On Wed, Jun 10, 2009 at 9:41 AM, Lyallex lyal...@gmail.com wrote:

 apache-tomcat-6.0.16
 jdk1.6.0_03

 Dev box : Windows
 Deployment box: Linux

 Hi

 I've read some other posts that seem to be asking similar questions
 but I can't find the answer so far.
 maybe someone here would be kind enough to give me a hint

 I have a retail application that stores the product images in a database.
 Each product can have many images and products are being uploaded all the
 time.

 Fetching images from the database every time results in a clunky page
 load so I want to cache the images to disk
 the first time an item is accessed my cache manager checks the disk
 cache to see if images for that item are available.
 If not it loads them onto the disk.
 this happens in the servlet that serves the item details up so the
 images are in the disk cache before the request is forwarded to the
 view (jsp)
 In the jsp I access the images from the disk cache.

 The problem is, the first time I access the item details the images
 are written to the cache which resides directly under the
 context root but they are not loaded in the view.
 If I restart tomcat the images disply fine so I know all the caching
 is working correctly.

 I can't restart tomcat everytime I upload a new product so how can I
 force tomcat to recognise the new images 'on the fly' so as to speak?
 The application is running as the ROOT application on the server and
 is the only application being served.

 An example image might be
 ../apache-tomcat-6.0.16/webapps/ROOT/imagecache/830_main.jpg
 (example)

 I'm quite happy that the imagecache is deleted everytime I redeploy
 the application because the application is starting to stabilise and
 once I have this last problem ironed out
 I will only be doing irregular maintenance. The faster loading of
 images is more than enough compensation.

 I can't use symbolic links to place the imagecache outside the
 application space because I develop on Windows and deploy to Linux
 (historical, nothing I can do about it)

 Any ideas much appreciated.


 Many thanks
 lyallex

 -
 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: Tomcat maxThreads Issue

2009-06-10 Thread Jones, Keven
Thank you Tim

I am going to attempt to set the maxThreads on 8011 to 600 and hope it helps.

The config is 1 linux apache2 server with 4 linux tomcat servers and each 
tomcat server has 4 sepearte tomcat instances. So we have a total of 16 tomcat 
instances across 4 servers.

Yes, there is a firewall between the web sever and the app(tomcat)/db(mysql) 
server.

KJ

-Original Message-
From: Tim Funk [mailto:funk...@apache.org] 
Sent: Wednesday, June 10, 2009 1:02 PM
To: Tomcat Users List
Subject: Re: Tomcat maxThreads Issue

Looking at the history of the thread - here are some guesses 

You have a connector on port 81 (http) and a connector on 8011 (ajp) and 
commented out connector for 443.

The port 81 connector and commented out connector are set to 600 - which means 
absolutely nothing if apache is talking to tomcat via jk.

Set |maxThreads on the connector for using port 8011 and life should be better.

If there are mulitple apache servers in front of tomcat  - you need to ensure 
you have (#apaches * max number connections per apache) threads available on 
each tomcat. The thread history seems to indicate you only have one apache with 
100 workers max. So raising the maxThreads in tomcat from 200 to something 
higher is not needed.

Is there a firewall between apache and tomcat? If so - it could mean that your 
firewall is timing out the connection and then bad things happen.
|
http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html


-Tim

-
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: Loading dynamically created content: An old chestnut but still a problem.

2009-06-10 Thread Jonathan Mast
Ok, so this approach of writing to disk after reading the database is not
working at all.  I thought you were saying previously that was working up to
a point, but then failing for new products.

I know its completely possible to add images the root of a Web-App folder
after deployment and have Tomcat see them.

Are you by chance running Tomcat behind Apache Httpd or some other server?


On Wed, Jun 10, 2009 at 1:10 PM, Lyallex lyal...@gmail.com wrote:

 Hi

 I'll try to explain in as few words as possible.

 When I upload a new product I store the image data and the text in the
 database. I did this to try and separate the data from the application
  with the intention of eventually having the data reside on a separate
 device optimised for serving data ... well that was my original
 thinking anyway.

 At the moment, when I load an image I use a proxy servlet and extract
 the imageid from the 'Product' (p below)

 img
 src=ImageProxy?%=WebConstants.IMAGE_ID%=%=p.calculateImageId()%...
 etc '/

 This gets the image from the database and displays it in the page.

 This is clunky and slow and the image is not cached by the browser

 So, when a user views an item detail I do something like this

 getProductDetails?productId='whatever'

 In the GetProductDetails servlet I check the disk cache to see if the
 image is there, if not I get it from the database an write it to the
 cache, just one database access as opposed to many, the next time
 anyone sees that item the images are already cached.

 now, in the jsp I can use img
 src=imagecache/%=p.getProductId()%_thumb.jpg  ...' etc/

 In other words, as opposed to getting an anonymous byte stream and
 displaying it in the browser I'm now accessing a named image and the
 browser caches it. It all works beautifully apart from the fact that
 it appears the DefaultServlet will not load resources that have been
 written to disk after the server has been started. If I restart the
 server I can see my images, but only the ones loaded thus far ...

 Anyway, I'm currently looking at the serveResource() method in the
 DefaultServlet to try and figure out if it is possible to configure it
 to load resoures that have appeared after the server has started ...
 it doesn't look like it is possible which is slightly depressing ...
 unless of course I am missing something.

 Surely this is not an unusual requirement, how do others deal with
 serving up images that have been uploaded after the server has
 started.

 Anyway

 Thanks for taking the time to reply
 lyallex


 2009/6/10 Jonathan Mast jhmast.develo...@gmail.com:
  So you are actually storing the image data in the database, as opposed to
  the filepath? interesting...
 
  So your webapp accesses the image data as needed and writes it to
 imagecache
  dir?  Is this feature not working? i don't understand what exactly the
 issue
  is that you are having.  please explain.
 
 
 
  On Wed, Jun 10, 2009 at 9:41 AM, Lyallex lyal...@gmail.com wrote:
 
  apache-tomcat-6.0.16
  jdk1.6.0_03
 
  Dev box : Windows
  Deployment box: Linux
 
  Hi
 
  I've read some other posts that seem to be asking similar questions
  but I can't find the answer so far.
  maybe someone here would be kind enough to give me a hint
 
  I have a retail application that stores the product images in a
 database.
  Each product can have many images and products are being uploaded all
 the
  time.
 
  Fetching images from the database every time results in a clunky page
  load so I want to cache the images to disk
  the first time an item is accessed my cache manager checks the disk
  cache to see if images for that item are available.
  If not it loads them onto the disk.
  this happens in the servlet that serves the item details up so the
  images are in the disk cache before the request is forwarded to the
  view (jsp)
  In the jsp I access the images from the disk cache.
 
  The problem is, the first time I access the item details the images
  are written to the cache which resides directly under the
  context root but they are not loaded in the view.
  If I restart tomcat the images disply fine so I know all the caching
  is working correctly.
 
  I can't restart tomcat everytime I upload a new product so how can I
  force tomcat to recognise the new images 'on the fly' so as to speak?
  The application is running as the ROOT application on the server and
  is the only application being served.
 
  An example image might be
  ../apache-tomcat-6.0.16/webapps/ROOT/imagecache/830_main.jpg
  (example)
 
  I'm quite happy that the imagecache is deleted everytime I redeploy
  the application because the application is starting to stabilise and
  once I have this last problem ironed out
  I will only be doing irregular maintenance. The faster loading of
  images is more than enough compensation.
 
  I can't use symbolic links to place the imagecache outside the
  application space because I develop on Windows and deploy to Linux
  (historical, nothing I 

Re: tomcat6.0.18 service unable to start

2009-06-10 Thread André Warnier

Steve Ochani wrote:
...


my process monitor log at  http://www.sendspace.com/file/t0tahr


Not an answer to the problem, but the link you provide requires a
signup, which many people will not want to do. So, basically, we can't



Not really, scroll down and click the link to download, ignore the ad about 
registration.


Yes, really. With FF 3.1 it never shows any download link.
YMMV, but that's the M I get.
With IE7, after a while, the content changes and it does indeed show a 
download link.

But also a message saying it blocked popups etc..
Not encouraging for people wanting to help anyway, most of them I guess 
won't be using IE anyway.


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



Re: Loading dynamically created content: An old chestnut but still a problem.

2009-06-10 Thread Tim Funk

Odd

Personally - I would do the following:

Make all calls to the servlet and the servlet does this:

1) Sanity check the incoming path
2) Check for the existence of the image (using 
ServletContext.getResource(path)

3) If not exists - load the image from the db and store to disk
4) forward to image via 
request.getRequestDispatcher(path).forward(request, response)


The above assumes the image cache directory is part of the webapp and 
visible to ServletContext.getResource


If the image cache directory lives outside the webapp - then I amazed 
that the default servlet was ever working. In which case - you can use a 
symlink.


If you are stuck on windows or all the above still doesn't work - then 
you can still do this:


0) In apache - you can map the image cache dir to some location - or 
have tomcat do that too in its own webapp

1) Sanity check the incoming path
2) Check for the existence of the image using a filesystem call
3) If not exists - load the image from the db and store to disk
4) redirect to the static image path


-Tim


Lyallex wrote:

Hi

I'll try to explain in as few words as possible.
  



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



Re: Tomcat maxThreads Issue

2009-06-10 Thread Tim Funk
If your not scared of the performance penalty (which these days isn't 
scary unless you really have high load) - try adding this to your apache 
config - it will end the connection between apache and tomcat after each 
request. This virtually eliminates the chance of a firewall dropping 
connections for you.


JkOptions +DisableReuse

YOu prob dont want this permanantly but its a good test

http://tomcat.apache.org/connectors-doc/reference/apache.html

-Tim


Jones, Keven wrote:

Thank you Tim

I am going to attempt to set the maxThreads on 8011 to 600 and hope it helps.

The config is 1 linux apache2 server with 4 linux tomcat servers and each 
tomcat server has 4 sepearte tomcat instances. So we have a total of 16 tomcat 
instances across 4 servers.

Yes, there is a firewall between the web sever and the app(tomcat)/db(mysql) 
server.

KJ

-Original Message-
From: Tim Funk [mailto:funk...@apache.org] 
Sent: Wednesday, June 10, 2009 1:02 PM

To: Tomcat Users List
Subject: Re: Tomcat maxThreads Issue

Looking at the history of the thread - here are some guesses 

You have a connector on port 81 (http) and a connector on 8011 (ajp) and 
commented out connector for 443.

The port 81 connector and commented out connector are set to 600 - which means 
absolutely nothing if apache is talking to tomcat via jk.

Set |maxThreads on the connector for using port 8011 and life should be better.

If there are mulitple apache servers in front of tomcat  - you need to ensure 
you have (#apaches * max number connections per apache) threads available on 
each tomcat. The thread history seems to indicate you only have one apache with 
100 workers max. So raising the maxThreads in tomcat from 200 to something 
higher is not needed.

Is there a firewall between apache and tomcat? If so - it could mean that your 
firewall is timing out the connection and then bad things happen.
|
http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html


-Tim

-
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



  



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



RE: Tomcat maxThreads Issue

2009-06-10 Thread Caldarale, Charles R
 From: Jones, Keven [mailto:keven.jo...@ncr.com]
 Subject: RE: Tomcat maxThreads Issue
 
 I am going to attempt to set the maxThreads on 8011 
 to 600 and hope it helps.

It will likely only postpone the problem.

 Yes, there is a firewall between the web sever and the
 app(tomcat)/db(mysql) server.

The question was whether or not there's a firewall between httpd and Tomcat, 
not Tomcat and the DB server.  If there is a firewall between httpd and Tomcat, 
it could be silently dropping the AJP connections, leaving Tomcat threads 
stranded on unusable ports.

There has been much discussion about this of late on this mailing list; I'll 
try to find some pointers for you.

Unless you're seeing OutOfMemoryErrors in your Tomcat logs, the heap sizing is 
very likely a red herring.

 - 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: Loading dynamically created content: An old chestnut but still a problem.

2009-06-10 Thread Hassan Schroeder
On Wed, Jun 10, 2009 at 10:10 AM, Lyallexlyal...@gmail.com wrote:

 When I upload a new product I store the image data and the text in the
 database. I did this to try and separate the data from the application
  with the intention of eventually having the data reside on a separate
 device optimised for serving data ... well that was my original
 thinking anyway.

which, BTW, still doesn't necessarily imply storing images in the DB,
but whatever floats your boat. :-)

 it appears the DefaultServlet will not load resources that have been
 written to disk after the server has been started.

? Works fine for me -- I frequently load new product images to sites
on my server, and no restart is required.

-- 
Hassan Schroeder  hassan.schroe...@gmail.com

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



Re: Tomcat maxThreads Issue

2009-06-10 Thread Jonathan Mast
Well I'm not sure how to check the current memory settings but I sure know
how to adjust them :)

Presuming that you downloaded Tomcat directly and installed manually:
open $TOMCAT/bin/catalina.sh

Add the following somewhere near the top (I place mine after all the
explanatory comments):
JAVA_OPTS= -Xmx1024m

This is tells java to allow a maximum of 1024 megabytes of memory to this
instance of tomcat.  Adjust appropriately.
Please note:
* the leading SPACE before the -Xmx.
* this is not a labeled parameter, therefore no = btwn the option and
value.




On Wed, Jun 10, 2009 at 1:12 PM, Jones, Keven keven.jo...@ncr.com wrote:

 Thank you Tim

 I am going to attempt to set the maxThreads on 8011 to 600 and hope it
 helps.

 The config is 1 linux apache2 server with 4 linux tomcat servers and each
 tomcat server has 4 sepearte tomcat instances. So we have a total of 16
 tomcat instances across 4 servers.

 Yes, there is a firewall between the web sever and the
 app(tomcat)/db(mysql) server.

 KJ

 -Original Message-
 From: Tim Funk [mailto:funk...@apache.org]
 Sent: Wednesday, June 10, 2009 1:02 PM
 To: Tomcat Users List
 Subject: Re: Tomcat maxThreads Issue

 Looking at the history of the thread - here are some guesses 

 You have a connector on port 81 (http) and a connector on 8011 (ajp) and
 commented out connector for 443.

 The port 81 connector and commented out connector are set to 600 - which
 means absolutely nothing if apache is talking to tomcat via jk.

 Set |maxThreads on the connector for using port 8011 and life should be
 better.

 If there are mulitple apache servers in front of tomcat  - you need to
 ensure you have (#apaches * max number connections per apache) threads
 available on each tomcat. The thread history seems to indicate you only have
 one apache with 100 workers max. So raising the maxThreads in tomcat from
 200 to something higher is not needed.

 Is there a firewall between apache and tomcat? If so - it could mean that
 your firewall is timing out the connection and then bad things happen.
 |
 http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html


 -Tim

 -
 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: Does user's network connection speed affect response time loggedby AccessLogValve (i.e. %D) ?

2009-06-10 Thread Caldarale, Charles R
 From: Tim Funk [mailto:funk...@apache.org]
 Subject: Re: Does user's network connection speed affect response
 time loggedby AccessLogValve (i.e. %D) ?
 
 AccessLogValve cannot log until the request is done. Done meaning
 that the Servlet is done writing its content.

There's also the issue that the servlet cannot complete until the client has 
finished sending all of its content for the request.  In the case of something 
large, such as a file upload, the timer could have started long before all the 
content was received.

 - 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.



RE: Tomcat maxThreads Issue

2009-06-10 Thread Jones, Keven
Cool,

Also, I'm examining my tomcat server.xml conf file for each instnace on each 
server. I am finding that
Tomcat1 AJP connector is 8011, Tomcat2 AJP 8012, Tomcat3 AJP 8013, and Tomcat4 
AJP 8014. So I will try and
Add a maxThreads 600 on each of these.

Thanks 

-Original Message-
From: Tim Funk [mailto:funk...@apache.org] 
Sent: Wednesday, June 10, 2009 1:33 PM
To: Tomcat Users List
Subject: Re: Tomcat maxThreads Issue

If your not scared of the performance penalty (which these days isn't scary 
unless you really have high load) - try adding this to your apache config - it 
will end the connection between apache and tomcat after each request. This 
virtually eliminates the chance of a firewall dropping connections for you.

JkOptions +DisableReuse

YOu prob dont want this permanantly but its a good test

http://tomcat.apache.org/connectors-doc/reference/apache.html

-Tim


Jones, Keven wrote:
 Thank you Tim

 I am going to attempt to set the maxThreads on 8011 to 600 and hope it helps.

 The config is 1 linux apache2 server with 4 linux tomcat servers and each 
 tomcat server has 4 sepearte tomcat instances. So we have a total of 16 
 tomcat instances across 4 servers.

 Yes, there is a firewall between the web sever and the app(tomcat)/db(mysql) 
 server.

 KJ

 -Original Message-
 From: Tim Funk [mailto:funk...@apache.org]
 Sent: Wednesday, June 10, 2009 1:02 PM
 To: Tomcat Users List
 Subject: Re: Tomcat maxThreads Issue

 Looking at the history of the thread - here are some guesses 

 You have a connector on port 81 (http) and a connector on 8011 (ajp) and 
 commented out connector for 443.

 The port 81 connector and commented out connector are set to 600 - which 
 means absolutely nothing if apache is talking to tomcat via jk.

 Set |maxThreads on the connector for using port 8011 and life should be 
 better.

 If there are mulitple apache servers in front of tomcat  - you need to ensure 
 you have (#apaches * max number connections per apache) threads available on 
 each tomcat. The thread history seems to indicate you only have one apache 
 with 100 workers max. So raising the maxThreads in tomcat from 200 to 
 something higher is not needed.

 Is there a firewall between apache and tomcat? If so - it could mean that 
 your firewall is timing out the connection and then bad things happen.
 |
 http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html


 -Tim

 -
 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



   


-
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: Tomcat maxThreads Issue

2009-06-10 Thread Caldarale, Charles R
 From: Jonathan Mast [mailto:jhmast.develo...@gmail.com]
 Subject: Re: Tomcat maxThreads Issue
 
 Add the following somewhere near the top (I place mine after all the
 explanatory comments):
 JAVA_OPTS= -Xmx1024m

Again, if there's no evidence of a heap issue (and none has been presented) *do 
not* change the heap settings - at best that can only muddy the water.  If you 
want to look at garbage collection activity, use -verbose:gc (which should work 
even on JRockit) to get information about how often a GC occurs.  Unless it's 
happening very frequently, leave the heap settings alone.

 - 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: Tomcat maxThreads Issue

2009-06-10 Thread Caldarale, Charles R
 From: Jones, Keven [mailto:keven.jo...@ncr.com]
 Subject: RE: Tomcat maxThreads Issue

 I see we have Engine set to Standalone,
 And I see the Service is catalina (?)

I would leave the name as Catalina (it's case sensitive), since that's what 
everyone expects (unless you have multiple Service elements - a very rare 
need).

 - 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: Tomcat maxThreads Issue

2009-06-10 Thread Caldarale, Charles R
 From: Caldarale, Charles R
 Subject: RE: Tomcat maxThreads Issue
 
 There has been much discussion about this of late on this mailing list;
 I'll try to find some pointers for you.

This is a useful reference:
http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html#Firewall%20Connection%20Dropping

The best (and unfortunately, biggest) discussion of this issue is here:
http://marc.info/?t=12422502151r=1w=2

The most useful messages in this 61-posting thread are Rainer's, should you 
want to browse through 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: Tomcat maxThreads Issue

2009-06-10 Thread Jones, Keven
Does the syntax of this look correct to everyone?
I have added maxThreads=400 and connectionTimeout=2(not sure if I need 
the connectionTimeout)

 Connector port=8011
enableLookups=false protocol=AJP/1.3 redirectPort=8443 
maxThreads=400 connectionTimeout=2/

Thanks everyone


-Original Message-
From: Tim Funk [mailto:funk...@apache.org] 
Sent: Wednesday, June 10, 2009 1:02 PM
To: Tomcat Users List
Subject: Re: Tomcat maxThreads Issue

Looking at the history of the thread - here are some guesses 

You have a connector on port 81 (http) and a connector on 8011 (ajp) and 
commented out connector for 443.

The port 81 connector and commented out connector are set to 600 - which means 
absolutely nothing if apache is talking to tomcat via jk.

Set |maxThreads on the connector for using port 8011 and life should be better.

If there are mulitple apache servers in front of tomcat  - you need to ensure 
you have (#apaches * max number connections per apache) threads available on 
each tomcat. The thread history seems to indicate you only have one apache with 
100 workers max. So raising the maxThreads in tomcat from 200 to something 
higher is not needed.

Is there a firewall between apache and tomcat? If so - it could mean that your 
firewall is timing out the connection and then bad things happen.
|
http://tomcat.apache.org/tomcat-6.0-doc/config/ajp.html


-Tim

-
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: Does user's network connection speed affect response time loggedby AccessLogValve (i.e. %D) ?

2009-06-10 Thread Pierre Goupil
Hello,

I'm sorry but... Does it mean that network connection speed effectively
affect the response time logged by the AccessLogValve ? Something is still
unclear for me, I'm afraid.

Regards,

Pierre


On Wed, Jun 10, 2009 at 7:40 PM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Tim Funk [mailto:funk...@apache.org]
  Subject: Re: Does user's network connection speed affect response
  time loggedby AccessLogValve (i.e. %D) ?
 
  AccessLogValve cannot log until the request is done. Done meaning
  that the Servlet is done writing its content.

 There's also the issue that the servlet cannot complete until the client
 has finished sending all of its content for the request.  In the case of
 something large, such as a file upload, the timer could have started long
 before all the content was received.

  - 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.




-- 
Sans amis était le grand maître des mondes,
Eprouvait manque, ce pour quoi il créa les esprits,
Miroirs bienveillants de sa béatitude.
Mais au vrai, il ne trouva aucun égal,
Du calice du royaume total des âmes
Ecume jusqu'à lui l'infinité.

(Schiller, l'amitié)


SV: Why do stacktraces from servlets print to stdout, when the other end up in the log4j -log file?

2009-06-10 Thread Imner, Andreas
My bad, I did not debug my servlet properly. If had done that earlier I would 
have seen that it was the extraction of the exception from the request object 
that failed.

When running the webapp in Weblogic as we did earlier, the following code 
worked as expected and the exception was properly fetched:

Object obj = request.getAttribute(javax.servlet.jsp.jspException); 

When the webapp is running in Tomcat (version 6.0.18, running on Windows server 
2003 as a service, standard package downloaded from Tomcat homepage, standard 
Tomcat log settings) the call resulted in obj being set to null.

When I changed the code to,

Object obj = request.getAttribute(javax.servlet.error.exception);

... The exception is properly fetched and everyting works as expected also in 
Tomcat

/Andreas

-Ursprungligt meddelande-
Från: Imner, Andreas [mailto:andreas.im...@kgk.se] 
Skickat: den 10 juni 2009 11:09
Till: Tomcat Users List
Ämne: RE: Why do stacktraces from servlets print to stdout, when the other end 
up in the log4j -log file?

Hi

The Servlet does not propegate the error. This perticular servlet is one we use 
for handling unhandled exceptions and displaying an unexpected-error page to 
the user.
_
From web.xml

servlet
servlet-nameexceptionHandler/servlet-name

servlet-classse.kgk.webshop.web.general.ExceptionHandlerServlet/servlet-class
init-param
param-nameerrorPageURL/param-name
param-valuegoto.do?forward=error/param-value
/init-param
load-on-startup3/load-on-startup
/servlet

servlet-mapping
servlet-nameexceptionHandler/servlet-name
url-pattern/error/url-pattern
/servlet-mapping

error-page
  exception-typejava.lang.Throwable/exception-type
  location/error/location
/error-page


The servlet code looks something like this 

private static final Log log = 
LogFactory.getLog(ExceptionHandlerServlet.class);

protected void doPost(final HttpServletRequest request, final 
HttpServletResponse response)
throws ServletException {
try {
Throwable throwable = null;

( Some code to extract the throwable, the requestURI etc... )

log.error(Exception while handling request:  + requestURI, 
throwable);

request.getRequestDispatcher(errorPageURL).forward(request, 
response);

} catch (final Throwable t) {
   t.printStackTrace();
}
}




If we run the webapp in Weblogic, both the Exception while handling... 
message and the stacktrace gets printed to the log file specified by log4j

If we run exactly the same webapp in Tomcat, the Exception while handling... 
message is printed to the log4j -logfile but the stacktrace gets printed to 
stdout.log!?! 
Note that this only applies to log calls from within this servlet. Then doing 
the exact same log4j-call from within one of our filter -classes, everything 
works as expected. 

I suspect something is different with the servlet load sequence or log settings 
when using Tomcat, but what?



-Ursprungligt meddelande-
Från: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Skickat: den 9 juni 2009 21:57
Till: Tomcat Users List
Ämne: Re: Why do stacktraces from servlets print to stdout, when the other end 
up in the log4j -log file?

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andreas,

On 6/9/2009 3:31 PM, Imner, Andreas wrote:
 My companys web application uses log4j 1.2.8 for logging and have
 just recently switched from Weblogic to Tomcat 6.0.18.
 
 Since the we switched to Tomcat, when we do some logging within a
 servlet
 
  private static final Log log =
 LogFactory.getLog(ExceptionHandlerServlet.class);
 log.error(some message, throwable);
 
 
 The some message -line is written to the file specified by log4j,
 but why does the stacktrace gets written to Tomcats stdout.log?

That depends on what else is going on in your servlet. If you let the
exception propagate (by re-throwing it or throwing a new exception) and
nobody else catches it, then Tomcat's request processing thread code
will catch it and log it to stdout.

 This is our log4j.properties file
 
 
 log4j.appender.A1=org.apache.log4j.RollingFileAppender
 log4j.appender.A1.MaxBackupIndex=20
 log4j.appender.A1.MaxFileSize=10MB
 
 log4j.appender.A1.layout=org.apache.log4j.PatternLayout
 
 log4j.appender.A1.layout.ConversionPattern=%d{ABSOLUTE} %-5p %X{ak} [%c{1}] 
 %m%n
 log4j.rootLogger=ERROR, A1
 
 log4j.category.se=INFO
 
 # All System.out.println is redirected to stdout logger, INFO level
 log4j.category.stdout=INFO
 
 # All System.err.println (includes Exception.printStackTrace() is redirected 
 to stderr logger, INFO level
 log4j.category.stderr=INFO
 

The code you provided does not show any use of the stdout category,
but it 

RE: Does user's network connection speed affect response time loggedby AccessLogValve (i.e. %D) ?

2009-06-10 Thread Caldarale, Charles R
 From: Pierre Goupil [mailto:goupilpie...@gmail.com]
 Subject: Re: Does user's network connection speed affect response
 time loggedby AccessLogValve (i.e. %D) ?
 
 Does it mean that network connection speed effectively
 affect the response time logged by the AccessLogValve ?

In a word yes, but only for large transfers.  If the servlet has to wait for 
more input from the client, that will count; if the output cannot be sent 
immediately due to congestion or the client not ACK'ing the transfers, that can 
also delay the servlet.  Whether or not such conditions could occur depend 
mostly on what and how much you're receiving and sending.

 - 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.



RE: Tomcat maxThreads Issue

2009-06-10 Thread Caldarale, Charles R
 From: Jones, Keven [mailto:keven.jo...@ncr.com]
 Subject: RE: Tomcat maxThreads Issue
 
  Connector port=8011
 enableLookups=false protocol=AJP/1.3 redirectPort=8443
 maxThreads=400 connectionTimeout=2/

The syntax is ok, but I'd have to look at the code to see if connectionTimeout 
applies to anything other than the first request coming through.  (AJP 
connections are intended to be persistent.)

 - 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: Tomcat maxThreads Issue

2009-06-10 Thread Chetan Chheda
What does your Apache access_log say at the time when tomcat threads are 
exhausted ? 

I had a very similar issue in my environment. The culprit turned out to be 
JkMount options. Apache was sending all requests, whether it is for static or 
dynamic content to tomcat. At the same time my tomcats locked up, I was seeing 
a lot of requests for static content(gifs in my case) in the apache access_log

Setting up mod_jk to only send *.jsp to tomcats fixed the issue for me. 





From: Jones, Keven keven.jo...@ncr.com
To: users@tomcat.apache.org users@tomcat.apache.org
Sent: Wednesday, June 10, 2009 11:11:11 AM
Subject: Tomcat maxThreads Issue

Hello,

I have Tomcat (can't figure out what version as the version.sh script is giving 
all kinds of errors) running on separate Linux servers. So an overview of my 
config is
1 web server, 4 app servers (tomcat), and 1 db server.

We were seeing an increase in the httpd processes on the web server to the 
point where I had to increase the MaxClients on the apache 2 server to 2048. I 
finally figured out that the normal number of httpd daemons on the web server 
(50-100) was spiking due to tomcat processes stalling or going completely down.

So I started looking at why tomcat was failing and I found this error message 
in the ACStarError.log :


SEVERE: All threads (200) are currently busy, waiting. Increase maxThreads 
(200) or check the servlet status.
So I checked the server.xml file and found the following:

    Connector port=81 protocol=HTTP/1.1
              server=-
              maxThreads=600 connectionTimeout=2
              redirectPort=443 /
!-- Awele 20070402 For SSL Requests, processed non-SSL,
due to Coyote SSL Accelerator --
!--
    Connector port=443 address=10.5.3.9 protocol=HTTP/1.1
              server=-
              secure=true
              maxThreads=600 connectionTimeout=2
                /
--
    !-- Define a SSL HTTP/1.1 Connector on port 8443
        This connector uses the JSSE configuration, when using APR, the
        connector should be using the OpenSSL style configuration
        described in the APR documentation --
    !--
    Connector port=8443 protocol=HTTP/1.1 SSLEnabled=true
              maxThreads=150 scheme=https secure=true
              clientAuth=false sslProtocol=TLS /
    --

So It looks like the maxThreads has already been increased to 600. The server 
has been rebooted and tomcat stopped/started multiple times. Again all servers 
are Red Hat 5.2. Is there an additional parameter that needs to be set in order 
for tomcat to actually increase the maxThreads ?
Thank You

Keven Jones


  

Consequences of Reusing Clustered JSESSIONID

2009-06-10 Thread Theparanoidone Theparanoidone

Greetings~

I would like to reuse the JSESSIONID route betweened clustered tomcats... and 
I'm wondering if there are negative consequences for doing so.

We have the following setup:
2 data centers...   (d1 / d2)
2 apache mod_proxy_balance(ad1, ad2)
4 tomcat servers  (td101, td102, td201, td202)  
--- sessions are replicated between both data centers (fortunately our 
application is light enough that this should be okay for our needs)

  d1   d2
| |
 ad1 ad2
/ \   /  \
td101  --   td102  -- -- td201  --   td202  



Our clients are stuck to a particular tomcat server and data center upon 
logging in; however, if we need to perform maintenance... we switch everyone 
over to an up data center while we do maintenance on the down center.

So, in normal operation... a client will always reconnect to td101. 
If we flip to maintenance mode... they'll be redirected to d2... HOWEVER our 
current...
While at d2... they will ping/pong in between td201 and td202...  (this is 
because apache a2 only has routes for td201 and td202... but not td101... 
therefore it doesn't know how to handle td101.

Our application still works... it's just messy flip flopping between 2 tomcat 
servers for every request.

I'm considering relabeling the routes as follows (td1, td2, td1, td2)

  d1   d2
| |
 ad1 ad2
/ \   /  \
   td1  --   td2-- --  td1  --   td2  


Is there any weird route collisions or problems in doing this?
Do routes really have to be unique if our application controls which physical 
data center a customer connects to?

Thanks!


  

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



What to upgrade?

2009-06-10 Thread Chetan Chheda
Our management has directed us to upgrade our JRE to 1.5 from 1.4.2 because 
they have heard that 1.5 has better memory management features. I am doing my 
due diligence to present a plan on what it will take to get us there. 

The question is how do I approach this ...

We have apache(2.0.59), Tomcat(5.0.30), and a few JVM based application 
processes. Tomcat and the application processes use the same JRE(1.4.2). 

- Is tomcat 5.0.30 supported with JRE 1.5? Is it as simple as updating the 
startup scripts with the new JRE path?
- Should I be upgrading tomcat too since our version is not even supported(as 
per ?
- What is the impact to the code? Is it all backward compatible and will work 
with the new JRE/tomcat version?
- Where can I find a comparison of enhancements/improvements between various 
tomcat versions? I saw the change log but its just too vast for me to digest...
- What is the impact to Apache/Mod_jk configurations?

Chetan


  

Re: What to upgrade?

2009-06-10 Thread Mark Thomas
Chetan Chheda wrote:
 Our management has directed us to upgrade our JRE to 1.5 from 1.4.2 because 
 they have heard that 1.5 has better memory management features. I am doing 
 my due diligence to present a plan on what it will take to get us there. 
 
 The question is how do I approach this ...
 
 We have apache(2.0.59), Tomcat(5.0.30), and a few JVM based application 
 processes. Tomcat and the application processes use the same JRE(1.4.2). 
 
 - Is tomcat 5.0.30 supported with JRE 1.5? Is it as simple as updating the 
 startup scripts with the new JRE path?
5.0.30 will work with 1.5 *but* the 5.0.x branch is very old, has not
been updated for a long time, is very unlikely to ever see another
release and almost certainly has some significant un-patched security
vulnerabilities.

 - Should I be upgrading tomcat too since our version is not even supported(as 
 per ?
Absolutely - see above.

 - What is the impact to the code? Is it all backward compatible and will work 
 with the new JRE/tomcat version?
You mat hit some issues with new keywords that were introduced. I
remember enum was an issue for Tomcat.

 - Where can I find a comparison of enhancements/improvements between various 
 tomcat versions? I saw the change log but its just too vast for me to 
 digest...
That is the best there is I am afraid.

5.0.x- 5.5.x was a re-factor for performance
5.5.x- 6.0.x was mainly a spec update

Generally, the later the version, the more bugs that have been fixed.

 - What is the impact to Apache/Mod_jk configurations?
On the httpd side, zero. For Tomcat you might need to tweak the
connector config a little.

Mark



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



Re: Tomcat hyperlink interpretation when including jsp file from another subdirectory

2009-06-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

To whom it may concern,

On 6/9/2009 5:10 PM, ledbettd wrote:
 Thanks for the help, Chris. The code in footer and header were just a list
 of HTML A links, not real JSP. I put the above code in for the first
 hyperlink in the header file and it worked from all directories. 

Excellent.

 So, we were hoping to migrate our code over to the new virtual setup without
 much editing. It appears that the context path will play more of a major
 role than it did on the default Tomcat installation where this was fine.

Using the context path in all your links will make re-location *much*
easier: just re-deploy to a different context path (say /foo/bar or even
ROOT) and everything works without any changes. It's definitely worth
migrating as you touch files. Even better: use a tag library like JSTL
(or, if you use Struts, their s:url tag) that does everything for you.
That way, your JSP code stays readable yet flexible.

 Actually, a weird think happened on the way to the ...
 I noticed that even though I only changed the first A link to the JSP
 format, the other links across the header suddenly were correct, even though
 they were still in the HTML A format. This was not an expected outcome and
 begs the question: Is there an easier way (read: work around with
 configuration files) to have the header HTML A links inside the JSP file be
 interpreted within the correct context from where ever inside this
 bcosite.com virtual host, without rewriting all the old code to proper JSP? 

The only thing I can think of is to use a base tag in your HTML
documents. This is an ugly hack if you ask me, and it might not solve
what I believe your original problem to be: that you were not using
fully-qualified URLs in the first place.

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

iEYEARECAAYFAkowFvgACgkQ9CaO5/Lv0PBO0ACgpSuFUBYfToCY+ANYm5PbN/ak
PDIAoKD0gA3zc7YkqGyL3uqLDGn7nfvF
=Coop
-END PGP SIGNATURE-

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



Re: swallowOutput and service threads

2009-06-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris,

On 6/9/2009 10:22 PM, Christopher Piggott wrote:
 I will definitely try that.  I also will consider using log4j's
 rotating file appender instead of the ConsoleAppender.  The reason I
 didn't do this in the first place is permissions: I don't normally
 have webapps that are able to write their own files.  I will have to
 think about this a little.

Yeah, log4j is /much/ more robust than what Tomcat provides out of the
box (through JULI). Note that you /can/ configure Tomcat to use log4j
as well, so you can kind of do both :)

I prefer log4j's rolling semantics, anyway (file is called foo.log until
it is rotated to foo-2009-06-10.log, rather than juli's behavior which
is to /always/ have the date in the file name ... that makes log
watching difficult).

There are also other options for log4j: your webapp doesn't necessarily
need to log to a file... you can log to syslog - even on another
machine: instant cluster log aggregation.

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

iEYEARECAAYFAkowGD8ACgkQ9CaO5/Lv0PDnRACfU5SBCh4A14XimktKpdSGRZbX
KRgAoJrvyNIggep7CqyN4DJOyNdMt2cF
=LhbX
-END PGP SIGNATURE-

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



Re: What to upgrade?

2009-06-10 Thread André Warnier

Chetan Chheda wrote:
...
Disclaimer : The following statements are to be taken in a banking 
perspective (past bonuses are no guarantee for future ones); each 
situation is slightly different; my own Tomcat applications are not very 
sophisticated; my servers are not highly loaded; YMMV.


Having done the same a couple of times, for me this was a relatively 
painless (and quick) upgrade, both for the JVM and for Tomcat (from 
Tomcat 4.1 to 5.5)(no point in stopping at 5.0).
I have Tomcat 5.5 running with a JVM 1.6 and do not remember having 
encountered any problems with that either, so you might as well skip the 
JVM 1.5 also.
I believe Tomcat 6 has quite a few more changes compared to 4.1, so you 
may not want to risk that in one step.


Save your old tomcat/conf files somewhere for future reference, then 
install the new JVM and the new Tomcat, with the standard new conf files 
for the new Tomcat. Make sure it runs with some example webapp.
Then /manually/ introduce the needed changes to the new configuration, 
one by one, on the base of your old conf files, and check after each 
change.
Do /not/ try to keep your old configs for the new Tomcat, or you will 
end up with a mess.


You might even be able to do this on the same server in parallel, as 
long as you change the ports of your Connector's.


As for mod_jk, apart from making sure that the right Apache jk worker 
connects to the right Tomcat, I don't think that there are any real 
config changes required.  The newer mod_jk have quite a few new options 
though, which you should probably at least have a look at.


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



Re: How to use a gzip javascript file in a webapp running under tomcat

2009-06-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Bala,

On 6/10/2009 8:37 AM, balachandra maddina wrote:
 I'm wondering if its possible to refer [to] a javascript file something like
 script ... src ='scriptfile.js.gz' in a html page where the script file is
 located in one of the tomcat webapps?

Sure, you can do that. It just won't do what you expect it to.

 if not how to send a gzip javascript file to browser? any help would be
 appreciated.

Try enabling gzip compression in the Connector.

http://tomcat.apache.org/tomcat-6.0-doc/config/http.html#Standard%20Implementation

Look for the compression attribute. You'll probably have to change the
compressablemimeType setting from the default to include text/css.

I don't think there's a way to trick Tomcat into using a pre-compressed
image of a file in this way.

Alternatively, you could probably do something like the following:
create a servlet that does nothing but serve a file off the disk (you
might even extend the DefaultServlet). Make sure that your servlet reads
your gzip'd CSS file and serves it without modification, except to add a
Content-Encoding header.

Remember to ensure that the client has Accept-Encoding: gzip set in
the request headers... otherwise you will be serving a file that the
browser claims it can't read.

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

iEYEARECAAYFAkowG2MACgkQ9CaO5/Lv0PC98ACgnQZ2/PKp5QgYsQJkTgPYGVep
vKgAniqftK7UQndCyoax6Fb+pR3C+vwl
=irZW
-END PGP SIGNATURE-

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



Re: What to upgrade?

2009-06-10 Thread Jonathan Mast
I just completed (last week actually) a migration from JDK 1.4.2/Tomcat 5.5
to JDK 1.6/Tomcat 6.

In terms of backward-compatibility, we had a problem with our TagLib
packages.  They would not compile under with whatever version of the Servlet
Spec accompanies JDK 1.6.  Those were the only compatibility issues we
encountered.


On Wed, Jun 10, 2009 at 4:33 PM, André Warnier a...@ice-sa.com wrote:

 Chetan Chheda wrote:
 ...
 Disclaimer : The following statements are to be taken in a banking
 perspective (past bonuses are no guarantee for future ones); each situation
 is slightly different; my own Tomcat applications are not very
 sophisticated; my servers are not highly loaded; YMMV.

 Having done the same a couple of times, for me this was a relatively
 painless (and quick) upgrade, both for the JVM and for Tomcat (from Tomcat
 4.1 to 5.5)(no point in stopping at 5.0).
 I have Tomcat 5.5 running with a JVM 1.6 and do not remember having
 encountered any problems with that either, so you might as well skip the JVM
 1.5 also.
 I believe Tomcat 6 has quite a few more changes compared to 4.1, so you may
 not want to risk that in one step.

 Save your old tomcat/conf files somewhere for future reference, then
 install the new JVM and the new Tomcat, with the standard new conf files for
 the new Tomcat. Make sure it runs with some example webapp.
 Then /manually/ introduce the needed changes to the new configuration, one
 by one, on the base of your old conf files, and check after each change.
 Do /not/ try to keep your old configs for the new Tomcat, or you will end
 up with a mess.

 You might even be able to do this on the same server in parallel, as long
 as you change the ports of your Connector's.

 As for mod_jk, apart from making sure that the right Apache jk worker
 connects to the right Tomcat, I don't think that there are any real config
 changes required.  The newer mod_jk have quite a few new options though,
 which you should probably at least have a look at.


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




RE: What to upgrade?

2009-06-10 Thread Caldarale, Charles R
 From: Chetan Chheda [mailto:chetan_chh...@yahoo.com]
 Subject: What to upgrade?
 
 Our management has directed us to upgrade our JRE to 1.5 from
 1.4.2 because they have heard that 1.5 has better memory
 management features.

I'll strongly reiterate what André mentioned: if you're moving up JVM levels, 
move to 1.6; going to 1.5 would be a waste of time these days.  Many, many 
things are improved in 1.6 over 1.5.

Contrary to André's suggestion, I would upgrade Tomcat to 6.0, bypassing 5.5.  
The configuration changes from 5.5 to 6.0 are miniscule, so you might as well 
use the active version of the product.

 - 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: What to upgrade?

2009-06-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 6/10/2009 4:33 PM, André Warnier wrote:
 Save your old tomcat/conf files somewhere for future reference, then
 install the new JVM and the new Tomcat, with the standard new conf files
 for the new Tomcat. Make sure it runs with some example webapp.
 Then /manually/ introduce the needed changes to the new configuration,
 one by one, on the base of your old conf files, and check after each
 change.

+1

Also, note that Tomcat 5.5 and higher really /really/ */really/* want
you to put your Context  elements into yourapp/META-INF/context.xml
instead of putting them into Tomcat's server.xml.

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

iEYEARECAAYFAkowHUcACgkQ9CaO5/Lv0PDyEgCeITM9GNPk8rQHNFtfRsxx8vwS
s3cAn3fBx+bijQIYPko/I3/UHam/EY6r
=p6DD
-END PGP SIGNATURE-

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



Re: Consequences of Reusing Clustered JSESSIONID

2009-06-10 Thread Filip Hanik - Dev Lists

this is because apache a2 only has routes for td201 and td202... but not 
td101... therefore it doesn't know how to handle td101.


why don't you setup all four routes for a1 and a2.
then use the mod_proxy_balancer lbset variable to set a preferred route, and 
problem will be solved

Filip



Theparanoidone Theparanoidone wrote:

Greetings~

I would like to reuse the JSESSIONID route betweened clustered tomcats... and 
I'm wondering if there are negative consequences for doing so.

We have the following setup:
2 data centers...   (d1 / d2)
2 apache mod_proxy_balance(ad1, ad2)
4 tomcat servers  (td101, td102, td201, td202)  
--- sessions are replicated between both data centers (fortunately our application is light enough that this should be okay for our needs)


  d1   d2
| |
 ad1 ad2
/ \   /  \
td101  --   td102  -- -- td201  --   td202  




Our clients are stuck to a particular tomcat server and data center upon logging in; however, if 
we need to perform maintenance... we switch everyone over to an up data center while we do 
maintenance on the down center.

So, in normal operation... a client will always reconnect to td101. 
If we flip to maintenance mode... they'll be redirected to d2... HOWEVER our current...

While at d2... they will ping/pong in between td201 and td202...  (this is 
because apache a2 only has routes for td201 and td202... but not td101... 
therefore it doesn't know how to handle td101.

Our application still works... it's just messy flip flopping between 2 tomcat 
servers for every request.

I'm considering relabeling the routes as follows (td1, td2, td1, td2)

  d1   d2
| |
 ad1 ad2
/ \   /  \
   td1  --   td2-- --  td1  --   td2  



Is there any weird route collisions or problems in doing this?
Do routes really have to be unique if our application controls which physical 
data center a customer connects to?

Thanks!


  


-
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: What to upgrade?

2009-06-10 Thread Chetan Chheda
We are going to regression test it in non - prod environments. I agree with 
going to the latest version, but our application is only supported on 1.4.2 So 
I am thinking 1.5 would be a smaller jump than 1.6. 

Chetan




From: Christopher Schultz ch...@christopherschultz.net
To: Tomcat Users List users@tomcat.apache.org
Sent: Wednesday, June 10, 2009 4:53:27 PM
Subject: Re: What to upgrade?

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 6/10/2009 4:33 PM, André Warnier wrote:
 Save your old tomcat/conf files somewhere for future reference, then
 install the new JVM and the new Tomcat, with the standard new conf files
 for the new Tomcat. Make sure it runs with some example webapp.
 Then /manually/ introduce the needed changes to the new configuration,
 one by one, on the base of your old conf files, and check after each
 change.

+1

Also, note that Tomcat 5.5 and higher really /really/ */really/* want
you to put your Context  elements into yourapp/META-INF/context.xml
instead of putting them into Tomcat's server.xml.

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

iEYEARECAAYFAkowHUcACgkQ9CaO5/Lv0PDyEgCeITM9GNPk8rQHNFtfRsxx8vwS
s3cAn3fBx+bijQIYPko/I3/UHam/EY6r
=p6DD
-END PGP SIGNATURE-

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


  

Re: Private JVM Heap Size

2009-06-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Peter,

On 6/10/2009 3:10 AM, Peter Crowther wrote:
 From: William Biggs [mailto:kc8...@gmail.com]
 I'm looking at a new web hosting they give Private JVM Heap
 Size what is the min jvm heap size would you go with ?
 
 It depends entirely on your application. Some apps can handle fairly
 high loads with under 100 Mbytes of heap;

Definitely. We have a lean and mean application that, until recently,
ran in a 64MiB heap just fine. We had to expand that heap once our user
load increased beyond what 64Mib could handle.

We don't have much in the way of caching in our app, so loads of memory
is not necessary.

If you can observe your existing application in production, take maybe a
week's worth of GC data (either enable verbose GC or write a
stupid-simply JSP that dumps heap info) and then graph it to see what
your memory needs actually look like. You should see that, for your
given load, a certain memory band looks like it will suffice. Shoot for
somewhere 10-20% /over/ that figure to give yourself some breathing room
and continue to watch your memory usage relative to your user load.

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

iEYEARECAAYFAkowI1QACgkQ9CaO5/Lv0PCcTwCfXmL9PVoUWWEA0sS8/DPmaMw/
gGEAoJrNgZg48Nx44yUDRvgDsMpvMbAo
=Tm4X
-END PGP SIGNATURE-

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



Re: Loading dynamically created content: An old chestnut but still a problem.

2009-06-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Lyallex,

On 6/10/2009 9:41 AM, Lyallex wrote:
 Fetching images from the database every time results in a clunky page
 load so I want to cache the images to disk
 the first time an item is accessed my cache manager checks the disk
 cache to see if images for that item are available.
 If not it loads them onto the disk.

I'm interested: what db are you using, what is your network topology,
and what kind of performance increase are you observing?

Also, what code are you using to serve the bytes of the locally-cached
files? DefaultServlet?

 I can't use symbolic links to place the imagecache outside the
 application space because I develop on Windows and deploy to Linux
 (historical, nothing I can do about it)

This shouldn't matter: you should be able to write files anywhere you
please. You don't have to be restricted to the deployment directory.
What about writing to C:\imagecache or ~/imagecache?

Also, on Windows, you might check out mklink.exe

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

iEYEARECAAYFAkowJeYACgkQ9CaO5/Lv0PASNwCfXxHdleZYBlVDr8ClI+seB/14
+qYAoKundWQ0c+HeYYD1J0xEVSGwhMX0
=9PcM
-END PGP SIGNATURE-

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



Re: Consequences of Reusing Clustered JSESSIONID

2009-06-10 Thread Theparanoidone Theparanoidone

Hi Filip~

That is an interesting possible solution (seems easy too).  I will give that a 
try.  Thank you for the quick response.  Cheers!




- Original Message 
From: Filip Hanik - Dev Lists devli...@hanik.com
To: Tomcat Users List users@tomcat.apache.org
Sent: Wednesday, June 10, 2009 1:57:26 PM
Subject: Re: Consequences of Reusing Clustered JSESSIONID

this is because apache a2 only has routes for td201 and td202... but not 
td101... therefore it doesn't know how to handle td101.

why don't you setup all four routes for a1 and a2.
then use the mod_proxy_balancer lbset variable to set a preferred route, and 
problem will be solved

Filip



Theparanoidone Theparanoidone wrote:
 Greetings~

 I would like to reuse the JSESSIONID route betweened clustered tomcats... and 
 I'm wondering if there are negative consequences for doing so.

 We have the following setup:
 2 data centers...   (d1 / d2)
 2 apache mod_proxy_balance(ad1, ad2)
 4 tomcat servers  (td101, td102, td201, td202)  
 --- sessions are replicated between both data centers (fortunately our 
 application is light enough that this should be okay for our needs)

   d1   d2
 | |
  ad1 ad2
 / \   /  \
 td101  --   td102  -- -- td201  --   td202  



 Our clients are stuck to a particular tomcat server and data center upon 
 logging in; however, if we need to perform maintenance... we switch everyone 
 over to an up data center while we do maintenance on the down center.

 So, in normal operation... a client will always reconnect to td101. 
 If we flip to maintenance mode... they'll be redirected to d2... HOWEVER our 
 current...
 While at d2... they will ping/pong in between td201 and td202...  (this is 
 because apache a2 only has routes for td201 and td202... but not td101... 
 therefore it doesn't know how to handle td101.

 Our application still works... it's just messy flip flopping between 2 tomcat 
 servers for every request.

 I'm considering relabeling the routes as follows (td1, td2, td1, td2)

   d1   d2
 | |
  ad1 ad2
 / \   /  \
td1  --   td2-- --  td1  --   td2  


 Is there any weird route collisions or problems in doing this?
 Do routes really have to be unique if our application controls which physical 
 data center a customer connects to?

 Thanks!


  

 -
 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


  

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



Re: Loading dynamically created content: An old chestnut but still a problem.

2009-06-10 Thread André Warnier

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Lyallex,

On 6/10/2009 9:41 AM, Lyallex wrote:

Fetching images from the database every time results in a clunky page
load so I want to cache the images to disk
the first time an item is accessed my cache manager checks the disk
cache to see if images for that item are available.
If not it loads them onto the disk.


I'm interested: what db are you using, what is your network topology,
and what kind of performance increase are you observing?

Also, what code are you using to serve the bytes of the locally-cached
files? DefaultServlet?


I can't use symbolic links to place the imagecache outside the
application space because I develop on Windows and deploy to Linux
(historical, nothing I can do about it)


This shouldn't matter: you should be able to write files anywhere you
please. You don't have to be restricted to the deployment directory.
What about writing to C:\imagecache or ~/imagecache?

And what about storing your images entirely outside of the db, as simple 
files, and only keeping a link in the db ?
That would allow *any* cache mechanism to work in a much simpler fashion 
(including the browser's), and would probably immensely unload your db 
software, which right now has to handle big blob data in each record.
It would also allow asynchronous mechanisms (like sendfile) to handle 
the sending of these images much more efficiently.

Not even considering the time you'd gain in db maintenance operations.

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



Re: What to upgrade?

2009-06-10 Thread Leon Rosenberg
actually no. 1.5 added many language features. 1.6 added
administration and management features (and override annotation for
interfaces).
The jump 1.4.2 - 1.5 will be exactly the same as 1.4.2 - 1.6.

Btw, to reply to your initial post, the memory management is really
really really better in 1.5 (say garbage collector), so your
management heard right things this time.
regards
Leon

On Wed, Jun 10, 2009 at 11:07 PM, Chetan Chhedachetan_chh...@yahoo.com wrote:
 We are going to regression test it in non - prod environments. I agree with 
 going to the latest version, but our application is only supported on 1.4.2 
 So I am thinking 1.5 would be a smaller jump than 1.6.

 Chetan



 
 From: Christopher Schultz ch...@christopherschultz.net
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Wednesday, June 10, 2009 4:53:27 PM
 Subject: Re: What to upgrade?

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 André,

 On 6/10/2009 4:33 PM, André Warnier wrote:
 Save your old tomcat/conf files somewhere for future reference, then
 install the new JVM and the new Tomcat, with the standard new conf files
 for the new Tomcat. Make sure it runs with some example webapp.
 Then /manually/ introduce the needed changes to the new configuration,
 one by one, on the base of your old conf files, and check after each
 change.

 +1

 Also, note that Tomcat 5.5 and higher really /really/ */really/* want
 you to put your Context  elements into yourapp/META-INF/context.xml
 instead of putting them into Tomcat's server.xml.

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

 iEYEARECAAYFAkowHUcACgkQ9CaO5/Lv0PDyEgCeITM9GNPk8rQHNFtfRsxx8vwS
 s3cAn3fBx+bijQIYPko/I3/UHam/EY6r
 =p6DD
 -END PGP SIGNATURE-

 -
 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: Loading dynamically created content: An old chestnut but still a problem.

2009-06-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Lyallex,

On 6/10/2009 1:10 PM, Lyallex wrote:
 img src=ImageProxy?%=WebConstants.IMAGE_ID%=%=p.calculateImageId()%...
 etc '/
 
 This gets the image from the database and displays it in the page.
 
 This is clunky and slow and the image is not cached by the browser

You might want to set some caching headers, etc. if you want the browser
to cache the image. You'll have the same problem with locally-cached
files if you don't do this (DefaultServlet, which it sounds like you're
using, probably sets these headers appropriately).

 Anyway, I'm currently looking at the serveResource() method in the
 DefaultServlet...

Multiple posts to this list seem to contradict Hassan's assertion that
this should work: the DefaultServlet appears to ignore files that are
created post deployment (or at least, post directory-read). This is
either due to the servlet itself or the (IIRC) JNDI context used by the
DefaultServlet to read the files.

I would recommend serving the bytes using your own servlet rather than
the DefaultServlet. That way, you free yourself from these apparent
directory-caching issues, plus you can (more) easily move your image
cache out of your deployment directory (if you care).

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

iEYEARECAAYFAkowMzYACgkQ9CaO5/Lv0PBFhACdFH4WalukRH68QqDgwStOM5sm
4hMAnApwfMGuF2xUuXGOw2Z/7o9WFy2X
=WUup
-END PGP SIGNATURE-

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



Re: Loading dynamically created content: An old chestnut but still a problem.

2009-06-10 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Lyallex,

On 6/10/2009 6:27 PM, Christopher Schultz wrote:
 I would recommend serving the bytes using your own servlet rather than
 the DefaultServlet. That way, you free yourself from these apparent
 directory-caching issues, plus you can (more) easily move your image
 cache out of your deployment directory (if you care).

Scratch that... after reading André's response, I realized that you
might not be able to (easily) use sendFile if you write the code
yourself. Use of sendFile (for connectors that support it) for static
content is strongly recommended for increased performance.

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

iEYEARECAAYFAkowNBQACgkQ9CaO5/Lv0PDzZgCgo1oF8LB4X79tXpBmCSwcu3b7
IGcAnAvktD70TcaCeLzZDax1+YCEVnxQ
=/nNl
-END PGP SIGNATURE-

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



Re: What to upgrade?

2009-06-10 Thread André Warnier

Let me add some non-technical and subjective advice.

I have kind of collected the impression over time here, that going from 
tomcat 5.5 to 6.x introduced at least some additional issues.
(This being said totally subjectively by someone who does not really 
know what he's talking about, but just goes by what he reads.)


Thus, while from a technical point of view, the jump from 4.2 to 6.0 may 
be less hassle in total than the sum of 2 consecutive jumps from 4.2 to 
5.5 and then 5.5 to 6.0, it nevertheless remains that

- management asked for 5.x, not 6.x.
- if anything bad happens going from 4.2 to 5.x, it will have been done 
according to explicit management wishes
- while if anything bad happens going from 4.2 to 6.x, it could be 
considered by some as having taken an unnecessary and unwarranted risk, 
beyond instructions
- not counting the fact that the later step from 5.5 to 6.x, whilst 
being comparatively easier, would nevertheless require the allocation of 
new time and manpower resources at some future date, which could be 
considered a Good Thing in the current depressionary climate


Have I qualified for a government or consultancy job yet ?




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



RE: What to upgrade?

2009-06-10 Thread Caldarale, Charles R
 From: André Warnier [mailto:a...@ice-sa.com]
 Subject: Re: What to upgrade?
 
 Have I qualified for a government or consultancy job yet ?

Only for the not quite gone Mr Brown's cabinet...

 - 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: What to upgrade?

2009-06-10 Thread André Warnier

Caldarale, Charles R wrote:

From: André Warnier [mailto:a...@ice-sa.com]
Subject: Re: What to upgrade?

Have I qualified for a government or consultancy job yet ?


Only for the not quite gone Mr Brown's cabinet...


I realise a posteriori that I should have qualified the previous advice.
To the OP thus, please amend my previous advice as follows :
if you happen to be US-based, and if management asks whether you can go 
directly from 4.2 to 6.0, the appropriate answer would be :

Yes, we can !


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



Re: What to upgrade?

2009-06-10 Thread David Kerber

Leon Rosenberg wrote:

actually no. 1.5 added many language features. 1.6 added
administration and management features (and override annotation for
interfaces).
  

And they both added big performance improvements over older ones.

D


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



Re: What to upgrade?

2009-06-10 Thread David Kerber

Chetan Chheda wrote:
We are going to regression test it in non - prod environments. I agree with going to the latest version, but our application is only supported on 1.4.2 So I am thinking 1.5 would be a smaller jump than 1.6. 
  
I doubt it.  If it will run on 1.5 (which it most likely will), it will 
run on 1.6.  The jump from 1.4 to 1.5 is much bigger than the one from 
1.5 to 1.6. 

I moved my app from TC 5.5.15 running under jvm 1.5.0_12 directly to TC 
6.0.17 or .18 (I don't recall which) under jvm 1.6.latest, and it ran 
absolutely unchanged except that it was much faster (could handle more 
concurrent requests).  Exactly zero code changes required in over 300 
classes. 

The initial jump from 1.4.something to 1.5 was quite painless as well, 
but I wanted some of the new code features in 1.5, so I never did 
extensive testing under of the 1.4 code until I had my 1.5 modifications 
done.


D



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



Re: Tomcat maxThreads Issue

2009-06-10 Thread Bill Barker

Caldarale, Charles R chuck.caldar...@unisys.com wrote in message 
news:0aae5ab84b013e45a7b61cb66943c17228fc438...@usea-exch7.na.uis.unisys.com...
 From: Jones, Keven [mailto:keven.jo...@ncr.com]
 Subject: RE: Tomcat maxThreads Issue

  Connector port=8011
 enableLookups=false protocol=AJP/1.3 redirectPort=8443
 maxThreads=400 connectionTimeout=2/

The syntax is ok, but I'd have to look at the code to see if 
connectionTimeout applies to anything other than the first request coming 
through.  (AJP connections are intended to be persistent.)


No, connectionTimeout applies to all requests.  Any time that the Connector 
thread doesn't hear from httpd within 20 seconds (with this configuration) 
it will hang up and return to the pool.  Note: this value also applies to 
reads from the request body.  But I think almost all connections can send 
the default 8Kb in 20 seconds.

The value for connectionTimeout looks low except for high-traffic sites 
(would go for something more like 5 minutes for a moderate traffic site). 
That would allow traffic spikes to die out without forcing unnecessary 
reconnections.  You may also want to configure cping/cpong on the Apache 
side to aid mod_jk to detect that the connection has timed out.

 - Chuck




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



Stable tomcat release

2009-06-10 Thread Mohit Anchlia
We are currently using tomcat 6. How do I determine the most recent
stable release of tomcat. I am looking at upgrading our tomcat with
most recent stable release.

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



Using tomcat as standalone

2009-06-10 Thread balachandra maddina
Hi There,

  Im wondering what are the performance implications of using tomcat as
standalone? many suggested to use the tomcat along with IIS. but im not sure
why is this required? could somebody help me on this please.

Thank you,
bala.


RE: Using tomcat as standalone

2009-06-10 Thread Caldarale, Charles R
 From: balachandra maddina [mailto:chandu2...@gmail.com]
 Subject: Using tomcat as standalone
 
 Im wondering what are the performance implications of using tomcat as
 standalone? many suggested to use the tomcat along with IIS. but im not
 sure why is this required?

Front-ending Tomcat with IIS would create a lot of extra overhead and 
administrative workload - don't do it unless you're already using IIS as your 
primary web server for the domain of interest.

Tomcat does very well at serving static content by itself these days (better 
than IIS).  If you're using SSL and have stringent performance requirements, 
consider installing the APR native library with Tomcat; this uses OpenSSL 
rather than the Java libraries and is noticeably faster.  APR may get you a 
performance improvement for non-encrypted requests as well, but you'd have to 
measure your webapps with it to be sure.

Use the latest Tomcat (6.0.20) and JVM (6u14) in server mode for the best 
performance starting point; use a 64-bit version of the JVM if you need the 
heap space and your platform supports 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 unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



RE: Stable tomcat release

2009-06-10 Thread Caldarale, Charles R
 From: Mohit Anchlia [mailto:mohitanch...@gmail.com]
 Subject: Stable tomcat release
 
 We are currently using tomcat 6. How do I determine the most recent
 stable release of tomcat. I am looking at upgrading our tomcat with
 most recent stable release.

Well, let's take a peek at the Tomcat home page.  Oh look, it says:

For the impatient, current Apache Tomcat production quality releases vs. 
Servlet/JSP specifications:

Servlet/JSP Spec  Apache Tomcat version
2.5/2.1   6.0.20

You might consider subscribing to the tomcat-announce mailing list:
http://tomcat.apache.org/lists.html#tomcat-announce

This will insure you see all of the pertinent release announcements and 
security bulletins.

 - 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: Loading dynamically created content: An old chestnut but still a problem.

2009-06-10 Thread Lyallex
Christopher

 Multiple posts to this list seem to contradict Hassan's assertion that
 this should work: the DefaultServlet appears to ignore files that are
 created post deployment (or at least, post directory-read).

This is exactly what is happening, the DefautServlet Ignores any file
that appears in the application space after the server is started
Others who have replied to my original post appear to have no problem
serving up images that have been uploaded after server startup ...

I appear to have multiple issues here. Rather that 'hijack' my own
thread, I'll start a new one for each issue then return here when I
know exactly what the problem is. I hope this doesn't upset too many
people.

Rgds
lyallex

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



Dynamic Resources: getRealPath() returns the 'wrong' path

2009-06-10 Thread Lyallex
Hi

apache-tomcat-6.0.16
jdk1.6.0_03

Dev box : Windows
Deployment box: Linux

I have my server installed at

C:\servers\tomcat\apache-tomcat-6.0.16\

My application is installed at

C:\servers\tomcat\apache-tomcat-6.0.16\webapps\ROOT

I have an  image cache available at

C:\servers\tomcat\apache-tomcat-6.0.16\webapps\ROOT\imagecache

In a servlet I do the following

String pathToImagecache = getServletContext().getRealPath(imagecache);
logger.log(Level.INFO, The path to the image cache is  + pathToImagecache);

The logging output gives the following

INFO: The path to the image cache is
C:\servers\tomcat\apache-tomcat-6.0.16\temp\1-ROOT\imagecache

I need to get hold of the imagecache directory to write images to it
but I have no idea what  this \temp\1-ROOT\ bit of the path all about
???
The only way I can get the correct path at the moment is to set up an
EV in context.xml then do a JNDI lookup in my site cooker and save the
value to my config server... I'd much rather use getRealPath as I
don't have to change the config when I deploy to live.

I'm confused, any help much appreciated

lyallex

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