Re: Caching of static content

2009-06-11 Thread jraanamo



Christopher Schultz-2 wrote:
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 
 
 Why assume non-ROOT deployment? It's just as easy to use
 ServletContext.getContextPath() than it is to arbitrarily chop
 characters out of a URI.
 
 
 1) This is just a mock Filter to reproduce the behaviour. I guess I should
 have mentioned this but I though I that the code was a clear statement of
 this - at least the createFile -method if nothing else.
 
 
 What is this include parameter? Is that something else for testing?
 Why not set up better tests from outside (that use includes) rather than
 trying to rig them this way?
 
 2) See section 1. above and my initial test uri's, e.g.
 /somenewdirectory/?forward=1 - this was to easily test if forwarding and
 including behaves differently.
 
 
 This is going to be a problem. You should store your files somewhere
 other than the webapp directory or things are going to be a real headache.
 
 3) Like said - a demo.
 
 
 That doesn't seem to capture the server's response or are you just
 trying to see if your technique will work before you implement everything?
 
 4) Yes! Or else I've written an Filter that really does not do anything
 smart - would not be the first time though. 
 
 
 It appears that you are trying to capture content, write a file into the
 webapps directory, and then have the DefaultServlet serve that content
 for you. That's not going to work because of two things:
 
 5) Fairly close to my initial problem description: 
 
 I was trying to create a Filter that generates the some content as files
 (if
 required) into the file system and lets the default servlet handle the
 rest.
 
 
 1. Webapp deployment sometimes doesn't allow you write to the webapps
(or other deployment) directory
 
 6) Now this is a good point but I don't know how this is restricted else
 than by the file system. I usually only work with Tomcat - maybe there are
 other restrictions with other servlet containers - do you know?
 
 
 2. The DefaultServlet does its own caching of directory information
(which I find irritating, honestly) so that newly-created files
are not always (or ever?) able to be served by it. You will probably
have to do your own interception of the request and serve the bytes
yourself. You have already seen that disabling caching makes this
work.
 
 7) Yes, I sort of figured this out which is why I posted the question in
 the first place - instead of starting to read through the DefaultServlet
 code (which I should have done). And my badly formulated question: 
 
  how to force TC to check if file exists in real time?
 
 should have stated how to disable DefaultServlets internal caching
 
 And the reason why I did not want to write the content into the response
 stream in the first place was - if you noticed - the content was JSP
 files.  I really wanted the DefaultServlet to handle the file processing
 and keep the Filter non intrusive of what ever else was in the webapp
 processing chain (e.g. other Filters like Sitemesh etc).
 
 
 Finally, you are messing with the URI by changing / to index.jsp and
 other foolish things like that. If you need to make-up a name for the
 file, make up something that is used solely for the filename, instead of
 re-writing the URI that you use for request dispatching.
 
 8) I thought we agreed there was no name calling!? Playing around with
 URI's can be a lots of fun - especially if you think of those three small
 letters: S.E.O.
 
 9) To sum it up. I only wanted to know how to get around the internal
 caching of dynamic content what comes to DefaultServlet. And as Lyallex
 asked me, my work-around was to generated the files outside the servlet
 container and have Tomcat just serve them. Much cleaner solution but also
 not so flexible what comes to more personalized content.
 
 
 Making those changes will surely help.
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.9 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iEYEARECAAYFAkolXksACgkQ9CaO5/Lv0PBSKgCgimJQlCRi6eab/xsEfVE/3GrC
 OQMAn2wBeSJzFWdJEL0nw+oG/IyZsO5J
 =M+P4
 -END PGP SIGNATURE-
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Caching-of-static-content-tp23614901p23975925.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



AW: URL Auth Apache 2.2.11 + Tomcat 6.0.16

2009-06-11 Thread Alexander Diedler
Hi,
This task has been fixed. The Java class was very static and we re-design
the auth method.
Thanks for your help.

-Ursprüngliche Nachricht-
Von: Rainer Jung [mailto:rainer.j...@kippdata.de] 
Gesendet: Dienstag, 9. Juni 2009 11:05
An: Tomcat Users List
Betreff: Re: URL Auth Apache 2.2.11 + Tomcat 6.0.16

On 08.06.2009 21:49, Alexander Diedler wrote:
 Hi,
 
 Since we modify our server to use mod_jk to serve sites there is an
 error with a Tomcat Action, that requires a HTML Auth.
 
 If we open the URL http://www.bla.de/?action=Import in a Browser, there
 is a Auth-Dialog to fill in Username and Passwort. This Username and
 Password seems to be hard coded in the action.
 
 If a scheduled Task try to excecute the Task there is a 401 Error
 
 java -cp D:\wwwroot\Java_shop\WEB-INF\classes
 com.j2dot.app.fv.ImportStandalone
 
 It is possible to add parameters in the cmd function?

You need to find out, what kind of http client your cmd function uses.
Many http clients support Basci authentication with username and
password, but you would need to either configure your http client or
somehow present the credentials to it. How this is done depends on the
client you or your developers have chosen. Ask the question to the
people who wrote com.j2dot.app.fv.ImportStandalone.

Alternatively you could allow access to the URL from e.g. special client
IPs without adding the need for username and password. This would help,
in case you import client runs on few systems, which are assumed to be
secure.

Regards,

Rainer

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



smime.p7s
Description: S/MIME cryptographic signature


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

2009-06-11 Thread Lyallex
2009/6/10 Jonathan Mast jhmast.develo...@gmail.com:
 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.

Great, any idea how ?
Others here seem to think that the DefaultServlet will not serve
content that is uploaded after the server starts and this is the
behaviour I'm seeing

I'd be really interested to know how it's done

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

Nope, Tomcat runs standalone on port 80 and serves all content

thanks

lyallex

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



Tomcat 6.0.18 access files case-insensitive

2009-06-11 Thread Alexander Diedler
Hello,

We have an Application based on IIS 6.0 and Tomcat 6.0.18. In this
Application will be opened a PDF (href=start.PDF). In this PDF are many
links to other documents, that will be opened in the browser. (KapA.PDF,
KapB.PDF). Now the distributor deliver updatefiles with changing extensions
or names.  The link is KapA.PDF in the overview, but the file is called
KapA.pdf on filesystem and Tomcat said 404 because PDF not equal pdf.
Also it can be kapb.pdf in Overview and filesystem KAPB.PDF

Is there are any option to disable case-sensitive on Tomcat or it is a
base-feature of Java architecture?

 

Greetings

Alexander

 

 



smime.p7s
Description: S/MIME cryptographic signature


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

2009-06-11 Thread balachandra maddina
Hi chris,

 Thx for the reply. just after posting the question i tried the same
steps and the files are getting gzip.

Thank you,
bala.

On 6/11/09, Christopher Schultz ch...@christopherschultz.net wrote:
 -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



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



Re: Using tomcat as standalone

2009-06-11 Thread balachandra maddina
Hi Chuck,

  Thx for the detailed info. i'll keep a note of these details during
deployment.

Thank you,
bala.

On 6/11/09, Caldarale, Charles R chuck.caldar...@unisys.com wrote:
 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



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



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

2009-06-11 Thread Mark Thomas
Lyallex wrote:
 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

This is a side effect of using the anti-locking attributes on your context.

Mark



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



Realm and Datasource configuration in Context

2009-06-11 Thread Guillaume M
I'm sorry I'm a bit lost with all the information I had found on realm
configuration problems. Thanks in advance for any help.

I had read it could come from the version so I had tried on two different ones:

On my Vista version, I have the error the name jdbc isn't bound to
the context.
I had tried  to use the datasource and mysql from a JSP page, it work
just fine when the security is off... So I guess my realm is wrong
somewhere... I had added the useNaming=true, the
localDataSource=true and the autoReconnect=true as adviced in
several threads though I still have the same troubles.

On my XP version, it seems better but when I use the right
login/password I have a HTTP 403 error message. I had only read it
could come from a wrong role-name so I had copied them directly from
mySQL and I still have the same problem... This version
reacts as expected with a false password.

Version 1 :

Windows Vista SP1
Tomcat 6.0.20
MySQL 5.1.35

To correct white page problems I had to use:
netsh int ip reset
netsh winsock reset
It might explain where my problems come from...

Here parts of the the main files used for security:

context.xml

code
?xml version=1.0 encoding=ISO-8859-1?

Context docBase=${app.name} path=/CQC privileged=true
antiResourceLocking=false antiJARLocking=false debug=1
reloadable=true useNaming=true
Resource   name=jdbc/authen
auth=Container
type=javax.sql.DataSource
username=guillaume
password=PASSWORD

url=jdbc:mysql://192.168.1.44:3306/securite_cqc?autoReconnect=true
driverClassName=com.mysql.jdbc.Driver
maxIdle=6000
maxWait=1000
maxActive=2
validationQuery=Select 1
removeAbandonned=true
removeAbandonnedTimeout=100
logAbandonned=true /

Realm  className=org.apache.catalina.realm.DataSourceRealm
dataSourceName=jdbc/authen
userTable=users
userNameCol=user_name
userCredCol=user_password
userRoleTable=user_roles
roleNameCol=role_name
localDataSource=true
autoReconnect=true
debug=99
digest=md5 /
/Context

/code

mySQL tables

code
mysql select * from users;
+---+--+
| user_name | user_password|
+---+--+
| bruno | md5password  |
| essai | md5password  |
| franck| md5password  |
| guillaume | md5password  |
| julien| md5password  |
| laurent   | md5password  |
| noel  | md5password  |
| tomcat| md5password  |
| virginie  | md5password  |
+---+--+
9 rows in set (0.00 sec)

mysql select * from user_roles;
+---++
| user_name | role_name  |
+---++
| bruno | utilisateur|
| essai | utilisateur|
| franck| utilisateur|
| guillaume | administrateur |
| julien| utilisateur|
| laurent   | administrateur |
| noel  | utilisateur|
| tomcat| utilisateur|
| virginie  | utilisateur|
+---++
9 rows in set (0.00 sec)

/code

web.xml

code
?xml version=1.0 encoding=ISO-8859-1?
web-app xmlns=http://java.sun.com/xml/ns/j2ee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd;
version=2.4

security-constraint
display-nameSecurite sous Tomcat/display-name
web-resource-collection
web-resource-nameRessources 
protegees/web-resource-name
url-pattern/Documentation/*/url-pattern
url-pattern/Download/*/url-pattern
url-pattern/FichierTest/*/url-pattern
url-pattern/META-INF/*/url-pattern
url-pattern/Statistiques/*/url-pattern
url-pattern/Upload/*/url-pattern
url-pattern/WEB-INF/*/url-pattern
url-pattern*.jsp/url-pattern
http-methodGET/http-method
http-methodPOST/http-method
/web-resource-collection

auth-constraint

Re: Stable tomcat release

2009-06-11 Thread André Warnier

Mohit Anchlia wrote:

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.


Mohit, come on !
You've asked the same question on the Apache site, and been told the 
same thing you'll be told here.  Are you too lazy to even go look at the 
home pages of Apache/Tomcat ?

Here is something else you may want to read :
http://slash7.com/pages/vampires

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



Re: Tomcat 6.0.18 access files case-insensitive

2009-06-11 Thread André Warnier

Alexander Diedler wrote:

Hello,

We have an Application based on IIS 6.0 and Tomcat 6.0.18. In this
Application will be opened a PDF (href=start.PDF). In this PDF are many
links to other documents, that will be opened in the browser. (KapA.PDF,
KapB.PDF). Now the distributor deliver updatefiles with changing extensions
or names.  The link is KapA.PDF in the overview, but the file is called
KapA.pdf on filesystem and Tomcat said 404 because PDF not equal pdf.
Also it can be kapb.pdf in Overview and filesystem KAPB.PDF

Is there are any option to disable case-sensitive on Tomcat or it is a
base-feature of Java architecture?

It's not a base feature of either Java or Tomcat, it's a base feature 
of the OS.  Windows filesystems are (relatively, see below) 
case-insensitive, Unix/Linux are absolutely case-sensitive.  Since Java 
and Java applications are supposed to run on both, they have to choose. 
 By default, Tomcat acts case-sensitive.
You can disable that, but I would be very careful if I was you, because 
you may trigger a whole bunch of other problems, for instance with 
access security.
The real problem here is the inconsistency of the original documents. 
You should tell your supplier to be consistent.  Or else, you should 
filter the documents when you receive them, and replace the links by 
consistent ones.  There exists PDF-handling softare that allows you to 
do that kind of thing.
Or else, you should implement a servlet filter which takes care of these 
links in particular, and make sure that when /you/ write documents to 
your filesystem, you always write them in a consistent way.
Even under Windows, you can /force/ filenames to be all lowercase on 
disk.  Windows creates and stores filenames in the upper/lower case that 
you specify.  It is just at retrieval time that Windows acts in a 
case-insensitive fashion.



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



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

2009-06-11 Thread Lyallex
2009/6/11 Mark Thomas ma...@apache.org:
 Lyallex wrote:
 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

 This is a side effect of using the anti-locking attributes on your context.

Er, OK ... thanks.


 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



Apache with multiple instance of Jboss on same server

2009-06-11 Thread nilesh p

Hi,

We have Apache Web server which is to be linked to 2 jboss instances on the
same server.
We have made the entries in workers.properties file but what changes need to
be done in Jboss so that both instances are picked up by Apache load
balancer?
I tried changing Connector port=8009 to 8007 for the second instance but
it doesnt seem to work.

Can anyone please help me out with this?

Regards,
Nilesh
-- 
View this message in context: 
http://www.nabble.com/Apache-with-multiple-instance-of-Jboss-on-same-server-tp23979550p23979550.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: Loading dynamically created content: An old chestnut but still a problem.

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

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

 Great, any idea how ?
 Others here seem to think that the DefaultServlet will not serve
 content that is uploaded after the server starts and this is the
 behaviour I'm seeing

I don't know who these others are, but I just downloaded a fresh
copy of 6.0.20, untarred and started it in its default configuration
(using $CATALINA_HOME/bin/catalina.sh run) and confirmed that
the ROOT webapp welcome page appeared in my browser.

Then I copied a random example.gif image to the ROOT directory
and entered http://localhost:8080/example.gif in my address bar.
And there it is in my browser.

So I think the question is more what changes have you made to
break the normal behavior?  :-)

For completeness, this is on a Mac/OS X (10.5.6) running the Mac
HotSpot(TM) 64-Bit Server VM (build 1.6.0_07-b06-57, mixed mode)

FWIW,
-- 
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 6.0.18 access files case-insensitive

2009-06-11 Thread Tim Funk
See |caseSensitive| here 
http://tomcat.apache.org/tomcat-6.0-doc/config/context.html


But doing so makes your installation VERY insecure in a windows 
environment. (Since ACL's can be bypassed since most ACL rules are case 
sensitive)


I performance is of no concern - you could go crazy and force all URL's 
to lower case (using a filter to 30X redirects) then your ACL rules can 
be simplified. But even that idea might have some flaws in it.


-Tim

Alexander Diedler wrote:


Hello,

We have an Application based on IIS 6.0 and Tomcat 6.0.18. In this 
Application will be opened a PDF (href=start.PDF). In this PDF are 
many links to other documents, that will be opened in the browser. 
(KapA.PDF, KapB.PDF). Now the distributor deliver updatefiles with 
changing extensions or names. The link is KapA.PDF in the overview, 
but the file is called KapA.pdf on filesystem and Tomcat said 404 
because “PDF” not equal “pdf”. Also it can be kapb.pdf in Overview and 
filesystem KAPB.PDF


Is there are any option to disable case-sensitive on Tomcat or it is a 
“base-feature” of Java architecture?


Greetings

Alexander




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



mod_jk does not recognize extension

2009-06-11 Thread Tsirkin Evgeny
Hi list!
I have mod_jk 1.2.26 configured and working fine.
However i want to set a special reply_timeout for a special url ,
i am getting strange errors in log and the rule is ignored .
Once i add this line:
 /dataj_mid/controller/finance/*=dataj_mid;reply_timeout=12
(see the full config below)
I am getting in jk log this:
jk_handler::mod_jk.c (2372): Could not find a worker for worker
name=dataj_mid;reply_timeout=12
And i am getting error 500 from apache on those urls.
Please help!
Evgeny


My worker.properties :
### template - applyed to all the others
worker.list=dataj,dataj_dev,dataj_mid,test,jkstatus
worker.template.type=ajp13
worker.template.host=localhost
worker.template.port=8009
### THE configuration parameter - timeout
worker.template.reply_timeout=12


## workers using ajp3
worker.test.reference=worker.template
worker.dataj.reference=worker.template
worker.dataj_dev.reference=worker.template
worker.dataj_mid.reference=worker.template
### this status worker will be mounted only throught ssl and from my machine
worker.jkstatus.type=status
worker.jkstatus.read_only=True


uriworkers.properties:
/dataj_dev=dataj_dev
/dataj_dev/controller/finance/*=dataj_dev
/dataj_dev/*=dataj_dev; reply_timeout=12

# /dataj_mid/controller/finance/*=dataj_mid;reply_timeout=12
/dataj_mid=dataj_mid
/dataj_mid/*=dataj_mid

/dataj=dataj
/dataj/*=dataj
###test for java env.
/jtests=test
/jtests/*=test

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



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

2009-06-11 Thread Caldarale, Charles R
 From: Lyallex [mailto:lyal...@gmail.com]
 Subject: Dynamic Resources: getRealPath() returns the 'wrong' path
 
 INFO: The path to the image cache is
 C:\servers\tomcat\apache-tomcat-6.0.16\temp\1-ROOT\imagecache

ServletContext.getRealPath() is one of the leftovers from the early days that 
probably should have been deprecated.  The container is under no obligation to 
provide access to the underlying file system (if there is one), other than to a 
spec-defined temporary work area.

To access resources contained within the webapp's name space, you likely should 
be using getResourceAsStream(), either the ClassLoader or the ServletContext 
version, as appropriate.

Writing to the webapp's deployment location is a bad idea - you again have no 
guarantee that it's allowed, and you're at the whims of the container and 
execution environment controlling the actual location.  Much better to write 
your files outside of Tomcat's directory space, using a path defined by system 
property, environment variable, or webapp property.

 - 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: Realm and Datasource configuration in Context

2009-06-11 Thread Caldarale, Charles R
 From: Guillaume M [mailto:geama...@gmail.com]
 Subject: Realm and Datasource configuration in Context
 
 context.xml

Let's get this sorted first.  Where is your context.xml file located?  It 
should be in your webapp's META-INF directory.

 Context docBase=${app.name} path=/CQC privileged=true

You must not use the docBase or path attributes in a Context element, unless 
the element is declared in server.xml, which you should never do on any recent 
version of Tomcat.

Answer the above question, fix your Context element, try again, and let us 
know what happens.

 - 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-11 Thread Caldarale, Charles R
 From: Hassan Schroeder [mailto:hassan.schroe...@gmail.com]
 Subject: Re: Loading dynamically created content: An old chestnut but
 still a problem.
 
 Then I copied a random example.gif image to the ROOT directory
 and entered http://localhost:8080/example.gif in my address bar.
 And there it is in my browser.

Just to confirm that there's no long-term caching, I extended the above by 
starting Tomcat, loaded the home page in Firefox, replaced tomcat.gif by one of 
Bill the Cat with the name tomcat.gif, refreshed the page with F5, and got the 
revised, much uglier image in the upper left corner.

 - 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: Dynamic Resources: getRealPath() returns the 'wrong' path

2009-06-11 Thread Lyallex
2009/6/11 Caldarale, Charles R chuck.caldar...@unisys.com:

 Writing to the webapp's deployment location is a bad idea - you again have no 
 guarantee that it's allowed, and you're at the whims of the container and 
 execution environment controlling the actual location.  Much better to write 
 your files outside of Tomcat's directory space, using a path defined by 
 system property, environment variable, or webapp property.

  - Chuck

Yep, I tried this. I set up the following in context.xml

Environment name=imagecache value=C:/blackhole/magecache
   type=java.lang.String override=false/

When the app starts I look up the value for  the imagecache path

imageCache = (String)ctx.lookup(java:comp/env/imagecache);

then store it in my config server.

When I want to write a file I get the path from the config server,
create a java.io.File and write the data. If I look in the blackhole
there are the files (images) I know it works b'cos I can open them in
an image editor.

Works perfectly ... except I just cannot get he DefaultServlet to
serve any images that are written to any directory anywhere on the
filesystem after the server has started ... apologies for letting this
leak into this thread but I though I might need to use some Servlet
spec type API to write files so that the DefaultServlet could 'see'
them ... hence the use of getRealPath  grasping at straws ? You
bet.

Anyway, thanks for taking the time to reply

lyallex

-
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-11 Thread Lyallex
2009/6/11 Caldarale, Charles R chuck.caldar...@unisys.com:
 From: Hassan Schroeder [mailto:hassan.schroe...@gmail.com]
 Subject: Re: Loading dynamically created content: An old chestnut but
 still a problem.

 Then I copied a random example.gif image to the ROOT directory
 and entered http://localhost:8080/example.gif in my address bar.
 And there it is in my browser.

 Just to confirm that there's no long-term caching, I extended the above by 
 starting Tomcat, loaded the home page in Firefox, replaced tomcat.gif by one 
 of Bill the Cat with the name tomcat.gif, refreshed the page with F5, and got 
 the revised, much uglier image in the upper left corner.

  - Chuck

OK, all very nice ... I just tried this. The server was running and my
application was up and working.
I copied an image into the ROOT directory then tried to access it like
so http://localhost/main.jpg and got a 404 not found.

I stopped and restarted the server (very important this) and tried the
same request again and the image loaded.

I'm not imagining this. It is a fact. On my setup (tomcat 6.0.16.
jdk1.6.0_03, Windows XP SP 2) I cannot load images that have been
written to disk after the server starts ... sorry if this offends you
in some way, it's driving ME nuts especially as you all seem to have
no trouble with this. I'm almost tempted to load the app onto the live
server and see if it works there. .. no, that way lies madness.

lyallex

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



Re: Realm and Datasource configuration in Context

2009-06-11 Thread Guillaume M
My context.xml file is in my webapp's META-INF directory and my
web.xml is in my webapp's WEB-INF directory. There isn't any change in
the results after those corrections.

This webapp worked fine enough for some years on my laptop, saddly it
had broken down recently and I don't remember the exact configuration
it had. I had to reinstall everything from the webapp I saved on USB
key.

Thank you for your help.

Guillaume.

2009/6/11, Caldarale, Charles R chuck.caldar...@unisys.com:
 From: Guillaume M [mailto:geama...@gmail.com]
 Subject: Realm and Datasource configuration in Context

 context.xml

 Let's get this sorted first.  Where is your context.xml file located?  It
 should be in your webapp's META-INF directory.

 Context docBase=${app.name} path=/CQC privileged=true

 You must not use the docBase or path attributes in a Context element,
 unless the element is declared in server.xml, which you should never do on
 any recent version of Tomcat.

 Answer the above question, fix your Context element, try again, and let us
 know what happens.

  - 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: Dynamic Resources: getRealPath() returns the 'wrong' path

2009-06-11 Thread Caldarale, Charles R
 From: Lyallex [mailto:lyal...@gmail.com]
 Subject: Re: Dynamic Resources: getRealPath() returns the 'wrong' path
 
 Works perfectly ... except I just cannot get he DefaultServlet to
 serve any images that are written to any directory anywhere on the
 filesystem after the server has started ...

Try this: create a conf/Catalina/[host]/imagecache.xml file containing a 
Context element with a docBase attribute that points to the cache file 
(C:/blackhole/magecache).  Construct your image URLs like this:
http://domain.com/imagecache/[imageName].jpg (or whatever for the name and 
type).

This should let the DefaultServlet run under this secondary webapp and access 
the files you place there.

 - 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: Dynamic Resources: getRealPath() returns the 'wrong' path

2009-06-11 Thread Mark Thomas
Lyallex wrote:
 2009/6/11 Caldarale, Charles R chuck.caldar...@unisys.com:
 
 Writing to the webapp's deployment location is a bad idea - you again have 
 no guarantee that it's allowed, and you're at the whims of the container and 
 execution environment controlling the actual location.  Much better to write 
 your files outside of Tomcat's directory space, using a path defined by 
 system property, environment variable, or webapp property.

  - Chuck
 
 Yep, I tried this. I set up the following in context.xml
 
 Environment name=imagecache value=C:/blackhole/magecache
type=java.lang.String override=false/
 
 When the app starts I look up the value for  the imagecache path
 
 imageCache = (String)ctx.lookup(java:comp/env/imagecache);
 
 then store it in my config server.
 
 When I want to write a file I get the path from the config server,
 create a java.io.File and write the data. If I look in the blackhole
 there are the files (images) I know it works b'cos I can open them in
 an image editor.
 
 Works perfectly ... except I just cannot get he DefaultServlet to
 serve any images that are written to any directory anywhere on the
 filesystem after the server has started ... apologies for letting this
 leak into this thread but I though I might need to use some Servlet
 spec type API to write files so that the DefaultServlet could 'see'
 them ... hence the use of getRealPath  grasping at straws ? You
 bet.

If you use getRealPath and write them to the path it returns - ie the
one with n-ROOT in it - then the DefaultServlet should serve them.
You'll need to write them to the 'proper' ROOT context as well or you'll
lose them on reload.

Alternatively, you could fix whatever problem caused you to use
anti-resource/jar locking in the first place.

Mark



-
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-11 Thread Caldarale, Charles R
 From: Lyallex [mailto:lyal...@gmail.com]
 Subject: Re: Loading dynamically created content: An old chestnut but
 still a problem.
 
 I'm not imagining this. It is a fact. On my setup (tomcat 6.0.16.
 jdk1.6.0_03, Windows XP SP 2) I cannot load images that have been
 written to disk after the server starts ...

Both Hassan and I were using a stock Tomcat 6.0.20 (mine was on Vista 64).  Try 
it with a 6.0.20 clean installation, and then compare configs between your 
6.0.16 and 6.0.20 versions to see what you've changed that is preventing the 
normal behavior.

 - 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-11 Thread Mark Thomas
Lyallex wrote:
 2009/6/11 Caldarale, Charles R chuck.caldar...@unisys.com:
 From: Hassan Schroeder [mailto:hassan.schroe...@gmail.com]
 Subject: Re: Loading dynamically created content: An old chestnut but
 still a problem.

 Then I copied a random example.gif image to the ROOT directory
 and entered http://localhost:8080/example.gif in my address bar.
 And there it is in my browser.
 Just to confirm that there's no long-term caching, I extended the above by 
 starting Tomcat, loaded the home page in Firefox, replaced tomcat.gif by one 
 of Bill the Cat with the name tomcat.gif, refreshed the page with F5, and 
 got the revised, much uglier image in the upper left corner.

  - Chuck
 
 OK, all very nice ... I just tried this. The server was running and my
 application was up and working.
 I copied an image into the ROOT directory then tried to access it like
 so http://localhost/main.jpg and got a 404 not found.
 
 I stopped and restarted the server (very important this) and tried the
 same request again and the image loaded.
 
 I'm not imagining this. It is a fact. On my setup (tomcat 6.0.16.
 jdk1.6.0_03, Windows XP SP 2) I cannot load images that have been
 written to disk after the server starts ... sorry if this offends you
 in some way, it's driving ME nuts especially as you all seem to have
 no trouble with this. I'm almost tempted to load the app onto the live
 server and see if it works there. .. no, that way lies madness.

This all all a expected side-effect of using the anti resource locking
features.

Mark



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



Re: Apache with multiple instance of Jboss on same server

2009-06-11 Thread André Warnier

nilesh p wrote:

Hi,

We have Apache Web server which is to be linked to 2 jboss instances on the
same server.
We have made the entries in workers.properties file but what changes need to
be done in Jboss so that both instances are picked up by Apache load
balancer?
I tried changing Connector port=8009 to 8007 for the second instance but
it doesnt seem to work.

Can anyone please help me out with this?

And you are cross-posting (see Apache users), and since this concerns 
JBoss you might be better off cross-posting to that list.


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



Re: Realm and Datasource configuration in Context

2009-06-11 Thread Guillaume M
I had tried again with the realm off and I can use the database
through the datasource in my vista version but on my XP version I have
the message jdbc not bound to this context.

2009/6/11, Guillaume M geama...@gmail.com:
 My context.xml file is in my webapp's META-INF directory and my
 web.xml is in my webapp's WEB-INF directory. There isn't any change in
 the results after those corrections.

 This webapp worked fine enough for some years on my laptop, saddly it
 had broken down recently and I don't remember the exact configuration
 it had. I had to reinstall everything from the webapp I saved on USB
 key.

 Thank you for your help.

 Guillaume.

 2009/6/11, Caldarale, Charles R chuck.caldar...@unisys.com:
 From: Guillaume M [mailto:geama...@gmail.com]
 Subject: Realm and Datasource configuration in Context

 context.xml

 Let's get this sorted first.  Where is your context.xml file located?  It
 should be in your webapp's META-INF directory.

 Context docBase=${app.name} path=/CQC privileged=true

 You must not use the docBase or path attributes in a Context element,
 unless the element is declared in server.xml, which you should never do
 on
 any recent version of Tomcat.

 Answer the above question, fix your Context element, try again, and let
 us
 know what happens.

  - 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: Understanding GC Logs

2009-06-11 Thread CrystalCracker

Upon more profiling, I figured that I have lots of apache.axis objects that
are not garbage collected.

The way I am making SOAP calls is through axis1.4 generated stubs. Eg.

MyDAO {
protected MyPortType getAPIConnection() throws Exception {
MyPort port;
try {
MyServiceLocator service = new MyServiceLocator();
port = service.getMy(“http://someendpoint.com”);
} catch (Exception e) {
throw new MyException(“Exception occured”);
}
return port;
}
}

public class AccountDAOImpl extends MyDAO implements AccountDAO {
public AccountTO fetchAccount(User user) throws MyException {
AccountTO account;
try {
MyPort port = fetchAPIConnection();
account = port.fetchAccount(user);
} catch (Exception e) {
   throw new MyException(“Exception occured”)
}
return account;
}
}

Shouldn't the 'port' object get collected once ?
-- 
View this message in context: 
http://www.nabble.com/Understanding-GC-Logs-tp23862354p23984169.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: Loading dynamically created content: An old chestnut but still a problem.

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

Mark,

On 6/11/2009 9:36 AM, Mark Thomas wrote:
 This all all a expected side-effect of using the anti resource locking
 features.

Oh, good: some /real/ information as to the cause. I suspect that Hassan
and Chuck are nto using anti-resource-locking while Lyallex is.

I've never had this problem myself because I don't try to generate
static content dynamically :)

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

iEYEARECAAYFAkoxKw0ACgkQ9CaO5/Lv0PCqigCeLDj4JIz/5Q/3RcCTQg6hiJQ5
Y7EAoLwc3qisk1loM3+zq2AdfX6vD3Lm
=WmdG
-END PGP SIGNATURE-

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



Re: Understanding GC Logs

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

CrystalCracker,

On 6/11/2009 12:01 PM, CrystalCracker wrote:
 Upon more profiling, I figured that I have lots of apache.axis objects that
 are not garbage collected.

Does the MyPortType class have a 'close' method or something like that
that must be called before the object can be released?

If that's the case, you should add some 'finally' blocks to your code...

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

iEYEARECAAYFAkoxLDYACgkQ9CaO5/Lv0PB5RgCdELjQYeIanhx2iXVT2bmjJHTo
zwMAoKTMFsWcjEMnOqdVH4eI+4AYwY7Q
=isNU
-END PGP SIGNATURE-

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



mod_jk, missing uri map

2009-06-11 Thread Diego Figueroa
Hi,

I'm having issues using mod_jk 1.2.28 with Tomcat 6.0.18 and Apache 2.2. 
Whenever I call one of the mount points defined on my apache2.conf file I 
get the same message in the log file (below). I am including what I 
believe are the relevant portions of my config files. Thanks!

I call the URL:

https://localhost/ceo/servlet/ceo

My mod_jk.log shows:

[Thu Jun 11 11:34:58 2009] [10331:3075028768] [debug] 
jk_child_init::mod_jk.c (3068): Initialized mod_jk/1.2.28
[Thu Jun 11 11:35:07 2009] [10075:3075028768] [debug] 
jk_translate::mod_jk.c (3419): missing uri map for 
localhost:/ceo/servlet/ceo
[Thu Jun 11 11:35:07 2009] [10075:3075028768] [debug] 
jk_map_to_storage::mod_jk.c (3579): missing uri map for 
localhost:/ceo/servlet/ceo

My apache2.conf has:

--- apache2.conf ---
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
JkWorkersFile /etc/apache2/workers.properties
JkLogFile /var/log/apache2/mod_jk.log
JkLogLevel debug
JkShmFile /var/log/apache2/jk.shm
JkLogStampFormat [%a %b %d %H:%M:%S %Y] 
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat %w %V %T
JkMount /ceo/* ajp13
--- apache2.conf ---

My worker.properties file:

--- workers.properties ---
workers.tomcat_home=/home/dfiguero/testbed/apache-tomcat-6.0.18
workers.java_home=/usr/lib/jvm/java-6-sun
ps=/

worker.list=ajp13,jkstatus

# defaults
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
worker.ajp13.socket_keepalive=true
worker.ajp13.connect_timeout=6

# status
worker.jkstatus.type=status
--- workers.properties ---

Finally my server.xml file has (shared among several instances):

--- server.xml ---
?xml version='1.0' encoding='utf-8'?
Server port=${shutdown.port} shutdown=SHUTDOWN

  Listener className=org.apache.catalina.core.AprLifecycleListener 
SSLEngine=on /
  Listener className=org.apache.catalina.core.JasperListener /
  Listener className=org.apache.catalina.mbeans.ServerLifecycleListener 
/
  Listener 
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener /


  GlobalNamingResources
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=${catalina.base}/../shared/conf/tomcat-users.xml 
/
  /GlobalNamingResources

  Service name=Catalina
 
Connector port=${http.port} protocol=HTTP/1.1 
   connectionTimeout=6 enableLookups=true
   redirectPort=8443 /

Connector port=8009 protocol=AJP/1.3 redirectPort=8443 
enableLookups=true /

Engine name=Catalina defaultHost=localhost

  Realm className=org.apache.catalina.realm.UserDatabaseRealm 
resourceName=UserDatabase/

  Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
  /Host
/Engine
  /Service
/Server
--- server.xml ---

Re: Apache with multiple instance of Jboss on same server

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

Nilesh,

On 6/11/2009 7:30 AM, nilesh p wrote:
 We have Apache Web server which is to be linked to 2 jboss instances on the
 same server.
 We have made the entries in workers.properties file but what changes need to
 be done in Jboss so that both instances are picked up by Apache load
 balancer?

Please post your workers.properties file, and the Context elements
from each of your JBoss instances.

 I tried changing Connector port=8009 to 8007 for the second instance but
 it doesnt seem to work.

What *does* happen?

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

iEYEARECAAYFAkoxLJAACgkQ9CaO5/Lv0PAGowCgweJjWOaLtdu6p0Rxrc97ijKd
xAoAn1SnXShfa8m+PuAAG/C202iGXFM5
=aBHd
-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-11 Thread Caldarale, Charles R
 From: Christopher Schultz [mailto:ch...@christopherschultz.net]
 Subject: Re: Loading dynamically created content: An old chestnut but
 stilla problem.
 
 I suspect that Hassan and Chuck are nto using anti-resource-locking
 while Lyallex is.

Correct; as stated, both Hassan and I are using stock Tomcat 6.0.20 downloads.

If the external webapp approach I suggested is used, the antiResourceLocking 
attribute should be set to false for that Context.

 - 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: Realm and Datasource configuration in Context

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

Guillaume,

On 6/11/2009 5:48 AM, Guillaume M wrote:
 On my Vista version, I have the error the name jdbc isn't bound to
 the context.

Sounds like your JNDI name is not correct.

   Resource   name=jdbc/authen

This is correct.

   maxIdle=6000
   maxWait=1000
   maxActive=2

This is a LOT of connections. Are you sure you need 2 database
connections? Are you sure MySQL will allow that many to connect?

   validationQuery=Select 1

Try: /* PING */ SELECT 1 -- you'll get better performance.

   removeAbandonnedTimeout=100

1000 minutes? That's an awfully long time to consider a connection
abandoned. Do you have ridiculously-long-running queries? If not,
consider dropping this value to something more reasonable like 5 minutes.

   dataSourceName=jdbc/authen

This is also correct.

   localDataSource=true

Excellent: you have read the documentation!

   autoReconnect=true

I don't believe this has any effect.

 GRAVE: Exception performing authentication
 javax.naming.NameNotFoundException: Le Nom jdbc n'est pas lié à ce Contexte
   at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
   at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
   at 
 org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:403)
   at 
 org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java:284)

Okay, so the DataSourceRealm is failing to pick-up the DataSource.

 INFO: Starting Coyote AJP/1.3 on ajp-8009
 11 juin 2009 08:16:13 org.apache.catalina.startup.Catalina start
 INFO: Server startup in 1125 ms
 /code

Is there anything in catalina.out after these lines? How about after the
error (other than the exception itself)?

Where do you have your mysql-connector.jar file located? In order for
Tomcat to create this DataSource for you, you need to have it located in
$CATALINA_BASE/lib. It won't work if you have it in your webapp's
WEB-INF/lib directory.

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

iEYEARECAAYFAkoxLjcACgkQ9CaO5/Lv0PBqWQCfUuYk0KL4sUMFUcx5vRN5h1pE
B20AoMBmj1xJYzhMJoocAK87IdqMS0aL
=Ze9m
-END PGP SIGNATURE-

-
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-11 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 6/11/2009 6:11 AM, André Warnier wrote:
 Here is something else you may want to read :
 http://slash7.com/pages/vampires

Brilliant!

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

iEYEARECAAYFAkoxLzYACgkQ9CaO5/Lv0PAAPQCfUar1hVHfPOR0arU98rLXXivO
C7QAoLfVz6l3gsV+iWR+oHdP/ndyJnwS
=WiUC
-END PGP SIGNATURE-

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



RE: Apache with multiple instance of Jboss on same server

2009-06-11 Thread Caldarale, Charles R
 From: Christopher Schultz [mailto:ch...@christopherschultz.net]
 Subject: Re: Apache with multiple instance of Jboss on same server
 
 Please post your workers.properties file, and the Context elements
 from each of your JBoss instances.

Why would the Context elements be of interest?  Wouldn't the Tomcat 
server.xml files be of more interest?  (They're located in 
server/[serverConfigName]/deploy/jboss-web.deployer, on recent versions of 
JBoss).

Regardless, this really should be taken to the JBoss mailing list, since 
configuration of the embedded Tomcat is done quite differently than for a 
standalone Tomcat.

 - Chuck


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



Re: mod_jk does not recognize extension

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

Evgeny,

On 6/11/2009 8:26 AM, Tsirkin Evgeny wrote:
 Once i add this line:
  /dataj_mid/controller/finance/*=dataj_mid;reply_timeout=12
 (see the full config below)

[snip]

 I am getting in jk log this:
 jk_handler::mod_jk.c (2372): Could not find a worker for worker
 name=dataj_mid;reply_timeout=12

[snip]

 /dataj_dev/*=dataj_dev; reply_timeout=12

Extra space between dataj_dev; and reply_timeout. Consider removing this.

 # /dataj_mid/controller/finance/*=dataj_mid;reply_timeout=12

Clearly commented-out.

Try fixing those two issues and trying again.

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

iEYEARECAAYFAkoxMEgACgkQ9CaO5/Lv0PCnRwCghV9bS+JghnIs1Ost3ALYlkT2
NFUAnAnJsn+6RqKnWwUM7i3f/T9PyJYz
=1gU/
-END PGP SIGNATURE-

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



Re: Apache with multiple instance of Jboss on same server

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

Chuck,

On 6/11/2009 12:25 PM, Caldarale, Charles R wrote:
 From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
 Subject: Re: Apache with multiple instance of Jboss on same server
 
 Please post your workers.properties file, and the Context
 elements from each of your JBoss instances.
 
 Why would the Context elements be of interest?

Sorry, I meant Connector. My hands were driving, not my brain.

 Regardless, this really should be taken to the JBoss mailing list,
 since configuration of the embedded Tomcat is done quite differently
 than for a standalone Tomcat.

Good point. It's frustrating to know that Tomcat is used as the web
server for certain EJB containers but they completely change the
configuration techniques... users come to this list and ignorami such as
myself give them bad advice. :(

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

iEYEARECAAYFAkoxMK8ACgkQ9CaO5/Lv0PCjywCfd7klaT15VLDsbHJ9PxMJn06l
gfEAn21BBUqY+0mekkWUnNqj/zQ6UMxm
=iM4p
-END PGP SIGNATURE-

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



RE: Understanding GC Logs

2009-06-11 Thread Caldarale, Charles R
 From: CrystalCracker [mailto:sudarshan.acha...@gmail.com]
 Subject: Re: Understanding GC Logs
 
 Shouldn't the 'port' object get collected once ?

Don't confuse a reference to an object with the object itself.  The port 
variable may go out of scope, but that has nothing to do with the underlying 
object, which will persist as long as anything has a reference to it.

You'll need to use a heap profiler to find out who is hanging on to references 
to your objects.

 - 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: mod_jk, missing uri map

2009-06-11 Thread André Warnier

Hi.

Good points for providing all relevant information.

By any chance, are you using VirtualHost's ?
(Unlikely with HTTPS, but nevertheless)
If yes, make sure to look up the JkMountCopy directive.
JkMount is not automatically inherited by VirtualHosts, from the main 
configuration.


A couple more things below

Diego Figueroa wrote:

Hi,

I'm having issues using mod_jk 1.2.28 with Tomcat 6.0.18 and Apache 2.2. 
Whenever I call one of the mount points defined on my apache2.conf file I 
get the same message in the log file (below). I am including what I 
believe are the relevant portions of my config files. Thanks!


I call the URL:

https://localhost/ceo/servlet/ceo

My mod_jk.log shows:

[Thu Jun 11 11:34:58 2009] [10331:3075028768] [debug] 
jk_child_init::mod_jk.c (3068): Initialized mod_jk/1.2.28
[Thu Jun 11 11:35:07 2009] [10075:3075028768] [debug] 
jk_translate::mod_jk.c (3419): missing uri map for 
localhost:/ceo/servlet/ceo
[Thu Jun 11 11:35:07 2009] [10075:3075028768] [debug] 
jk_map_to_storage::mod_jk.c (3579): missing uri map for 
localhost:/ceo/servlet/ceo


My apache2.conf has:

--- apache2.conf ---
LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
JkWorkersFile /etc/apache2/workers.properties
JkLogFile /var/log/apache2/mod_jk.log
JkLogLevel debug
JkShmFile /var/log/apache2/jk.shm
JkLogStampFormat [%a %b %d %H:%M:%S %Y] 
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat %w %V %T
JkMount /ceo/* ajp13


The above all looks ok to me.
Just in case : maybe you also want to add a
JkMount /ceo ajp 13
(only if /ceo has to be proxied to Tomcat also.)



--- apache2.conf ---

My worker.properties file:

--- workers.properties ---
workers.tomcat_home=/home/dfiguero/testbed/apache-tomcat-6.0.18
workers.java_home=/usr/lib/jvm/java-6-sun


I believe the preceding 2 lines are obsolete, no longer used by mod_jk 
since a long time.

But that's not the cause of your problem.


ps=/

worker.list=ajp13,jkstatus

# defaults
worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
worker.ajp13.lbfactor=1
worker.ajp13.socket_keepalive=true
worker.ajp13.connect_timeout=6

# status
worker.jkstatus.type=status
--- workers.properties ---

Finally my server.xml file has (shared among several instances):

--- server.xml ---
?xml version='1.0' encoding='utf-8'?
Server port=${shutdown.port} shutdown=SHUTDOWN

  Listener className=org.apache.catalina.core.AprLifecycleListener 
SSLEngine=on /

  Listener className=org.apache.catalina.core.JasperListener /
  Listener className=org.apache.catalina.mbeans.ServerLifecycleListener 
/
  Listener 
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener /



  GlobalNamingResources
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=${catalina.base}/../shared/conf/tomcat-users.xml 
/

  /GlobalNamingResources

  Service name=Catalina
 
Connector port=${http.port} protocol=HTTP/1.1 
   connectionTimeout=6 enableLookups=true

   redirectPort=8443 /

Connector port=8009 protocol=AJP/1.3 redirectPort=8443 
enableLookups=true /



I guess this is the only instance which has an AJP connector then ?



Engine name=Catalina defaultHost=localhost

  Realm className=org.apache.catalina.realm.UserDatabaseRealm 
resourceName=UserDatabase/


  Host name=localhost  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
  /Host
/Engine
  /Service
/Server
--- server.xml ---


Basically, everything /looks/ ok.
But the logfile does indicate that mod_jk is called to examine the URL, 
but does not find a JkMount that matches the /ceo/servlet/ceo URL.

So either it is the VirtualHost thing, or else I don't know.

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



Re: Tomcat 6.0.18 access files case-insensitive

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

André,

On 6/11/2009 6:32 AM, André Warnier wrote:
 It's not a base feature of either Java or Tomcat, it's a base feature
 of the OS.  Windows filesystems are (relatively, see below)
 case-insensitive, Unix/Linux are absolutely case-sensitive.  Since Java
 and Java applications are supposed to run on both, they have to choose.
  By default, Tomcat acts case-sensitive.

And furthermore, URLs themselves are case-sensitive (see HTTP/1.1
section 3.2.3).

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

iEYEARECAAYFAkoxOscACgkQ9CaO5/Lv0PBuPACeKpsGx2B+jqIdxNTDTvZDWs3d
jvMAn3HjwDaZgatfhBHHagdiawl71r2W
=1I5s
-END PGP SIGNATURE-

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



Classloader Issues

2009-06-11 Thread Jon Pearson
I am encountering an odd problem with Tomcat (6.0.18). When the Java
security manager is enabled, I get a ClassNotFoundException when I try
to load the Postgres database driver using Class.forName() and a URL
classloader pointed at a jar; its parent classloader is the Webapp
classloader.

But, when the Java security manager is disabled, everything works
smoothly and no ClassNotFoundException is thrown.

I've stepped through the code (using Eclipse's debugger) and not found
anything that stands out, and I've set a general breakpoint on all
SecurityExceptions, caught or uncaught. None are thrown.

Has anyone else encountered a problem like this? Is there a way for the
Java security manager to block a class from loading without a
SecurityException being thrown?

Jonathan P. Pearson - Software Engineer
-- 
SIXNET - Solutions for Your Industrial Networking Challenges
331 Ushers Road, Ballston Lake, NY 12019
Tel: 1.518.877.5173, Fax: 1.518.877.8346
www.sixnet.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-11 Thread Jones, Keven
Update,

I finally got my vendor on the line. He is telling me that this entry in my 
server.xml:

connector port=81 protocol=HTTP/1.1
Server-
maxThreads=600 connectionTimeout=2
redirectpPort=443 /

Is the reason I'm seeing this in my catalina.out. He is stating that If I put 
an address (the same address
Of the linux server that the tomcat instance is running on) that that message 
will go away and the maxThreads will actually move to 600.

So it should look like  where 10.10.10.10 is the internal IP of the tomcat app 
server

connector port=81 protocol=HTTP/1.1
Server10.10.10.10
maxThreads=600 connectionTimeout=2
redirectpPort=443 /

Anyone agree?
-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Wednesday, June 10, 2009 3:25 PM
To: Tomcat Users List
Subject: RE: Tomcat maxThreads Issue

 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


-
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-11 Thread Caldarale, Charles R
 From: Jones, Keven [mailto:keven.jo...@ncr.com]
 Subject: RE: Tomcat maxThreads Issue
 
 He is stating that If I put an address (the same address
 Of the linux server that the tomcat instance is running on)
 that that message will go away and the maxThreads will 
 actually move to 600.
 
 Anyone agree?

Nope - your vendor is sadly mistaken or confused (or you misinterpreted what he 
said).  The address (not server) attribute in a Connector will limit the 
listen to just that IP address, whereas not including an address attribute 
results in listening on all IP addresses configured for the TCP/IP stack, 
including 10.10.10.10.  The maxThreads attribute applies either way.

Your vendor is also confused, because that's not the Connector typically used 
between Tomcat and httpd; it's normally the AJP one, if you're using mod_jk or 
mod_proxy_ajp.

 - 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



chunked encoding

2009-06-11 Thread Anthony J. Biacco
I'm running apache 2.2.11-mod_jk 1.2.27-tomcat 6.0.18. I'm attempting
to gzip javascript output from apache (static files), and tomcat
(servlets with javascript content types). I'm using mod_deflate in
apache to do this.
Here's my problem. When the request is to a servlet (static apache files
and JSPs through mod_jk are fine) in the form of a GET, instead of
sending a Content-Length response header, I get a Transfer-Encoding:
chunked header
I'd like to know:
1) What are the causes of either Tomcat (or Apache is it?) enabling
chunking on the connection?
2) How do I get a Content-Length reponse header instead? Do I need to
downgrade the client to HTTP/1.0 or is there another way?

FYI, the reason I'm trying to do this is that I use a CDN, and they
won't cache my data without the presence of a Content-Length response
header, so my servlet data isn't getting cached at the CDN.

-Tony
---
Manager, IT Operations
Format Dynamics, Inc.
303-573-1800x27
abia...@formatdynamics.com
http://www.formatdynamics.com



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



Re: mod_jk, missing uri map

2009-06-11 Thread Diego Figueroa
Hi André,

Thanks for your input. I added JkMountCopy On to both the default and 
SSL VirtualHosts and it started working.

Diego.





André Warnier a...@ice-sa.com 
2009/06/11 01:03 PM
Please respond to
Tomcat Users List users@tomcat.apache.org


To
Tomcat Users List users@tomcat.apache.org
cc

Subject
Re: mod_jk, missing uri map






Hi.

Good points for providing all relevant information.

By any chance, are you using VirtualHost's ?
(Unlikely with HTTPS, but nevertheless)
If yes, make sure to look up the JkMountCopy directive.
JkMount is not automatically inherited by VirtualHosts, from the main 
configuration.

A couple more things below

Diego Figueroa wrote:
 Hi,
 
 I'm having issues using mod_jk 1.2.28 with Tomcat 6.0.18 and Apache 2.2. 

 Whenever I call one of the mount points defined on my apache2.conf file 
I 
 get the same message in the log file (below). I am including what I 
 believe are the relevant portions of my config files. Thanks!
 
 I call the URL:
 
 https://localhost/ceo/servlet/ceo
 
 My mod_jk.log shows:
 
 [Thu Jun 11 11:34:58 2009] [10331:3075028768] [debug] 
 jk_child_init::mod_jk.c (3068): Initialized mod_jk/1.2.28
 [Thu Jun 11 11:35:07 2009] [10075:3075028768] [debug] 
 jk_translate::mod_jk.c (3419): missing uri map for 
 localhost:/ceo/servlet/ceo
 [Thu Jun 11 11:35:07 2009] [10075:3075028768] [debug] 
 jk_map_to_storage::mod_jk.c (3579): missing uri map for 
 localhost:/ceo/servlet/ceo
 
 My apache2.conf has:
 
 --- apache2.conf ---
 LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
 JkWorkersFile /etc/apache2/workers.properties
 JkLogFile /var/log/apache2/mod_jk.log
 JkLogLevel debug
 JkShmFile /var/log/apache2/jk.shm
 JkLogStampFormat [%a %b %d %H:%M:%S %Y] 
 JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
 JkRequestLogFormat %w %V %T
 JkMount /ceo/* ajp13

The above all looks ok to me.
Just in case : maybe you also want to add a
JkMount /ceo ajp 13
(only if /ceo has to be proxied to Tomcat also.)


 --- apache2.conf ---
 
 My worker.properties file:
 
 --- workers.properties ---
 workers.tomcat_home=/home/dfiguero/testbed/apache-tomcat-6.0.18
 workers.java_home=/usr/lib/jvm/java-6-sun

I believe the preceding 2 lines are obsolete, no longer used by mod_jk 
since a long time.
But that's not the cause of your problem.

 ps=/
 
 worker.list=ajp13,jkstatus
 
 # defaults
 worker.ajp13.port=8009
 worker.ajp13.host=localhost
 worker.ajp13.type=ajp13
 worker.ajp13.lbfactor=1
 worker.ajp13.socket_keepalive=true
 worker.ajp13.connect_timeout=6
 
 # status
 worker.jkstatus.type=status
 --- workers.properties ---
 
 Finally my server.xml file has (shared among several instances):
 
 --- server.xml ---
 ?xml version='1.0' encoding='utf-8'?
 Server port=${shutdown.port} shutdown=SHUTDOWN
 
   Listener className=org.apache.catalina.core.AprLifecycleListener 
 SSLEngine=on /
   Listener className=org.apache.catalina.core.JasperListener /
   Listener 
className=org.apache.catalina.mbeans.ServerLifecycleListener 
 /
   Listener 
 className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener 
/
 
 
   GlobalNamingResources
 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=${catalina.base}/../shared/conf/tomcat-users.xml 
 /
   /GlobalNamingResources
 
   Service name=Catalina
 
 Connector port=${http.port} protocol=HTTP/1.1 
connectionTimeout=6 enableLookups=true
redirectPort=8443 /
 
 Connector port=8009 protocol=AJP/1.3 redirectPort=8443 
 enableLookups=true /
 
I guess this is the only instance which has an AJP connector then ?


 Engine name=Catalina defaultHost=localhost
 
   Realm className=org.apache.catalina.realm.UserDatabaseRealm 
 resourceName=UserDatabase/
 
   Host name=localhost  appBase=webapps
 unpackWARs=true autoDeploy=true
 xmlValidation=false xmlNamespaceAware=false
   /Host
 /Engine
   /Service
 /Server
 --- server.xml ---

Basically, everything /looks/ ok.
But the logfile does indicate that mod_jk is called to examine the URL, 
but does not find a JkMount that matches the /ceo/servlet/ceo URL.
So either it is the VirtualHost thing, or else I don't know.

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




Re: Realm and Datasource configuration in Context

2009-06-11 Thread Guillaume M
Hi Chris,

Yes there is a lot of connections which can be very slow. I had been
asked to do a complex sorting program on a web server. I wouldn't have
use a web server especially knowing we can have above 100 sorts in a
row but it's easier to update...

I had used all I knew about Java to make it fast enough meaning
prepared statements and threads because it lasted several days, and
now I'm down to some hours for usual databases... I have to clean
MySQL about once every five months to avoid overloading...

There isn't any other line in the log files.

And I had put the mysql in the $CATALINA_BASE/lib directory.

Thank you for your time,

Guillaume.

2009/6/11, Christopher Schultz ch...@christopherschultz.net:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Guillaume,

 On 6/11/2009 5:48 AM, Guillaume M wrote:
 On my Vista version, I have the error the name jdbc isn't bound to
 the context.

 Sounds like your JNDI name is not correct.

  Resource   name=jdbc/authen

 This is correct.

  maxIdle=6000
  maxWait=1000
  maxActive=2

 This is a LOT of connections. Are you sure you need 2 database
 connections? Are you sure MySQL will allow that many to connect?

  validationQuery=Select 1

 Try: /* PING */ SELECT 1 -- you'll get better performance.

  removeAbandonnedTimeout=100

 1000 minutes? That's an awfully long time to consider a connection
 abandoned. Do you have ridiculously-long-running queries? If not,
 consider dropping this value to something more reasonable like 5 minutes.

  dataSourceName=jdbc/authen

 This is also correct.

  localDataSource=true

 Excellent: you have read the documentation!

  autoReconnect=true

 I don't believe this has any effect.

 GRAVE: Exception performing authentication
 javax.naming.NameNotFoundException: Le Nom jdbc n'est pas lié à ce
 Contexte
  at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
  at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
  at
 org.apache.catalina.realm.DataSourceRealm.open(DataSourceRealm.java:403)
  at
 org.apache.catalina.realm.DataSourceRealm.authenticate(DataSourceRealm.java:284)

 Okay, so the DataSourceRealm is failing to pick-up the DataSource.

 INFO: Starting Coyote AJP/1.3 on ajp-8009
 11 juin 2009 08:16:13 org.apache.catalina.startup.Catalina start
 INFO: Server startup in 1125 ms
 /code

 Is there anything in catalina.out after these lines? How about after the
 error (other than the exception itself)?

 Where do you have your mysql-connector.jar file located? In order for
 Tomcat to create this DataSource for you, you need to have it located in
 $CATALINA_BASE/lib. It won't work if you have it in your webapp's
 WEB-INF/lib directory.

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

 iEYEARECAAYFAkoxLjcACgkQ9CaO5/Lv0PBqWQCfUuYk0KL4sUMFUcx5vRN5h1pE
 B20AoMBmj1xJYzhMJoocAK87IdqMS0aL
 =Ze9m
 -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: Classloader Issues

2009-06-11 Thread Martin Gainty

inside TC you have to grant the container access to Jar 
assuming your class is located in commons-daemon.jar in 
$CATALINA_HOME/conf/catalina.policy

// These permissions apply to the daemon code
grant codeBase file:${catalina.home}/bin/commons-daemon.jar {
permission java.security.AllPermission;
};

HTH!
Martin Gainty 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




 Subject: Classloader Issues
 Date: Thu, 11 Jun 2009 13:13:32 -0400
 From: jon.pear...@sixnet.com
 To: users@tomcat.apache.org
 
 I am encountering an odd problem with Tomcat (6.0.18). When the Java
 security manager is enabled, I get a ClassNotFoundException when I try
 to load the Postgres database driver using Class.forName() and a URL
 classloader pointed at a jar; its parent classloader is the Webapp
 classloader.
 
 But, when the Java security manager is disabled, everything works
 smoothly and no ClassNotFoundException is thrown.
 
 I've stepped through the code (using Eclipse's debugger) and not found
 anything that stands out, and I've set a general breakpoint on all
 SecurityExceptions, caught or uncaught. None are thrown.
 
 Has anyone else encountered a problem like this? Is there a way for the
 Java security manager to block a class from loading without a
 SecurityException being thrown?
 
 Jonathan P. Pearson - Software Engineer
 -- 
 SIXNET - Solutions for Your Industrial Networking Challenges
 331 Ushers Road, Ballston Lake, NY 12019
 Tel: 1.518.877.5173, Fax: 1.518.877.8346
 www.sixnet.com
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

_
Insert movie times and more without leaving Hotmail®. 
http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGLM_WL_HM_Tutorial_QuickAdd_062009

RE: Realm and Datasource configuration in Context

2009-06-11 Thread Caldarale, Charles R
 From: Guillaume M [mailto:geama...@gmail.com]
 Subject: Re: Realm and Datasource configuration in Context
 
 And I had put the mysql in the $CATALINA_BASE/lib directory.

Is the MySQL jar in *only* Tomcat's lib directory?  If it's also in your 
webapp's WEB-INF/lib, that can cause classloader conflicts and possibly the 
symptom you're seeing.

 - 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: Classloader Issues

2009-06-11 Thread Jon Pearson
That blurb was already in the catalina.policy file.

 -Original Message-
 From: Martin Gainty [mailto:mgai...@hotmail.com] 
 Sent: Thursday, June 11, 2009 2:39 PM
 To: Tomcat Users List
 Subject: RE: Classloader Issues
 
 
 inside TC you have to grant the container access to Jar 
 assuming your class is located in commons-daemon.jar in 
 $CATALINA_HOME/conf/catalina.policy
 
 // These permissions apply to the daemon code
 grant codeBase file:${catalina.home}/bin/commons-daemon.jar {
 permission java.security.AllPermission;
 };
 
 HTH!
 Martin Gainty 
 __ 
 Verzicht und Vertraulichkeitanmerkung/Note de déni et de 
 confidentialité
  
 Diese Nachricht ist vertraulich. Sollten Sie nicht der 
 vorgesehene Empfaenger sein, so bitten wir hoeflich um eine 
 Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer 
 Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
 Austausch von Informationen und entfaltet keine rechtliche 
 Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von 
 E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
 Ce message est confidentiel et peut être privilégié. Si vous 
 n'êtes pas le destinataire prévu, nous te demandons avec 
 bonté que pour satisfaire informez l'expéditeur. N'importe 
 quelle diffusion non autorisée ou la copie de ceci est 
 interdite. Ce message sert à l'information seulement et 
 n'aura pas n'importe quel effet légalement obligatoire. Étant 
 donné que les email peuvent facilement être sujets à la 
 manipulation, nous ne pouvons accepter aucune responsabilité 
 pour le contenu fourni.
 
 
 
 
  Subject: Classloader Issues
  Date: Thu, 11 Jun 2009 13:13:32 -0400
  From: jon.pear...@sixnet.com
  To: users@tomcat.apache.org
  
  I am encountering an odd problem with Tomcat (6.0.18). When the Java
  security manager is enabled, I get a ClassNotFoundException 
 when I try
  to load the Postgres database driver using Class.forName() and a URL
  classloader pointed at a jar; its parent classloader is the Webapp
  classloader.
  
  But, when the Java security manager is disabled, everything works
  smoothly and no ClassNotFoundException is thrown.
  
  I've stepped through the code (using Eclipse's debugger) 
 and not found
  anything that stands out, and I've set a general breakpoint on all
  SecurityExceptions, caught or uncaught. None are thrown.
  
  Has anyone else encountered a problem like this? Is there a 
 way for the
  Java security manager to block a class from loading without a
  SecurityException being thrown?
  
  Jonathan P. Pearson - Software Engineer
  -- 
  SIXNET - Solutions for Your Industrial Networking Challenges
  331 Ushers Road, Ballston Lake, NY 12019
  Tel: 1.518.877.5173, Fax: 1.518.877.8346
  www.sixnet.com
  
  
 -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
  
 
 _
 Insert movie times and more without leaving Hotmail®. 
 http://windowslive.com/Tutorial/Hotmail/QuickAdd?ocid=TXT_TAGL
 M_WL_HM_Tutorial_QuickAdd_062009
 

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



RE: Classloader Issues

2009-06-11 Thread Jon Pearson
Stack trace:

 java.lang.Exception: Unable to start: Cannot load database driver:
Cannot load PostgreSQL JDBC driver: org.postgresql.Driver

com.sixnetio.BVB.Web.DB.connect(DB.java:72)
com.sixnetio.BVB.Web.DB.getDB(DB.java:94)
com.sixnetio.BVB.Web.LoginAction.execute(LoginAction.java:45)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
java.lang.reflect.Method.invoke(Unknown Source)
 
com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActi
onInvocation.java:440)
 
com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(Default
ActionInvocation.java:279)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:242)
 
com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doInterce
pt(DefaultWorkflowInterceptor.java:163)
 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Me
thodFilterInterceptor.java:87)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:236)
 
com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(Vali
dationInterceptor.java:249)
 
org.apache.struts2.interceptor.validation.AnnotationValidationIntercepto
r.doIntercept(AnnotationValidationInterceptor.java:68)
 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Me
thodFilterInterceptor.java:87)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:236)
 
com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept
(ConversionErrorInterceptor.java:122)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:236)
 
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(Pa
rametersInterceptor.java:195)
 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Me
thodFilterInterceptor.java:87)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:236)
 
com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(Pa
rametersInterceptor.java:195)
 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Me
thodFilterInterceptor.java:87)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:236)
 
com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercep
t(StaticParametersInterceptor.java:148)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:236)
 
org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInt
erceptor.java:93)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:236)
 
org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploa
dInterceptor.java:235)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:236)
 
com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(Mod
elDrivenInterceptor.java:89)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:236)
 
com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.interce
pt(ScopedModelDrivenInterceptor.java:128)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:236)
 
org.apache.struts2.interceptor.ProfilingActivationInterceptor.intercept(
ProfilingActivationInterceptor.java:104)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:236)
 
org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(
DebuggingInterceptor.java:267)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:236)
 
com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(Chaini
ngInterceptor.java:126)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:236)
 
com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(Prepa
reInterceptor.java:138)
 
com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(Me
thodFilterInterceptor.java:87)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:236)
 
com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterc
eptor.java:148)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:236)
 
org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(Servle
tConfigInterceptor.java:164)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:236)
 
com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInte
rceptor.java:128)
 
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvo
cation.java:236)
 
com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercep
t(ExceptionMappingInterceptor.java:176)
 

RE: Classloader Issues

2009-06-11 Thread Caldarale, Charles R
 From: Jon Pearson [mailto:jon.pear...@sixnet.com]
 Subject: RE: Classloader Issues
 
 That blurb was already in the catalina.policy file.

I think Martin was just using that as an example; you likely need to grant some 
permission(s) to your own classloader code.

Again, posting the stack trace and the location of the MySQL jar would help to 
diagnose your problem.

 - 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: chunked encoding

2009-06-11 Thread Markus Schönhaber
Anthony J. Biacco:

 Here's my problem. When the request is to a servlet (static apache files
 and JSPs through mod_jk are fine) in the form of a GET, instead of
 sending a Content-Length response header, I get a Transfer-Encoding:
 chunked header
 I'd like to know:
 1) What are the causes of either Tomcat (or Apache is it?) enabling
 chunking on the connection?

Tomcat, probably, since you're talking about a servlet-created response.
And it's not chunking the connection but transferring the response body
chunked.

If at the time the response headers are sent the size of the response
body is already known (for example, if it's just the contents of a
file), it's easy to send a Content-Length response header.
OTOH, how big the output of a servlet will be is generally not known
before the servlet has finished. If you want to send a Content-Length
header anyway, I see two (well, really only one) alternatives:
1. Cache the complete servlet output and count the bytes - which isn't
very practical.[1]
2. Don't send a Content-Length header.
Alternative 2. creates another problem:
With HTTP/1.0 a client can quite reliably determine when the entire
response body is transferred, even if no content-length header is sent:
when the server closes the underlying TCP connection.
With HTTP/1.1 this isn't the case any more since the TCP connection may
be left open to be used to transfer additional requests/responses
(keep-alive). To enable the client to determine when the entire response
was transmitted, you'll have to transfer it chunked.

 2) How do I get a Content-Length reponse header instead? Do I need to
 downgrade the client to HTTP/1.0 or is there another way?

What's the point in caching dynamically created responses?

 FYI, the reason I'm trying to do this is that I use a CDN, and they
 won't cache my data without the presence of a Content-Length response
 header, so my servlet data isn't getting cached at the CDN.

What's a CDN?

[1] Tomcat will, by default, cache some output of servlets. IIRC the
default buffer size is 8k. So, if your servlet creates output of no more
then 8k, a Content-Length header will be sent. Otherwise chunked
encoding will be used.
This might be the reason why you see Content-Length headers from your
JSPs - their output is probably small enough.
-- 
Regards
  mks

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



RE: Classloader Issues

2009-06-11 Thread Jon Pearson
My last message included the stack trace. The Postgresql jar is in the
WEB-INF/lib directory of my webapp
(/var/lib/tomcat6/webapps/BVWeb/WEB-INF/lib/postgresql-8.3-604.jdbc4.jar
on Linux,
C:\Projects\Java\Eclipse\.metadata\.plugins\org.eclipse.wst.server.core\
tmp1\webapps\BVWeb\WEB-INF\lib\postgresql-8.3-604.jdbc4.jar on Windows).

Also, here is the relevant section of my catalina.policy file for
Windows:

grant codeBase file:${catalina.base}/webapps/BVWeb/- {
permission java.util.PropertyPermission *, read;

permission java.io.FilePermission ${user.home}/Application
Data/BlueVueBatch/-, read;
permission java.io.FilePermission C:/Documents and Settings/All
Users/Application Data/BlueVueBatch/-, read;
permission java.io.FilePermission ${bvb.databases}/-, read;
permission java.io.FilePermission
${catalina.base}/work/Catalina/localhost/BVWeb/-, write;
permission java.io.FilePermission template/-, read;

permission java.lang.reflect.ReflectPermission
suppressAccessChecks;
permission java.lang.RuntimePermission getenv.APPDATA;
permission java.lang.RuntimePermission getenv.ALLUSERSPROFILE;
permission java.lang.RuntimePermission getenv.USERNAME;
permission java.lang.RuntimePermission getClassLoader;
permission java.net.SocketPermission *, connect,resolve;
permission java.lang.RuntimePermission accessDeclaredMembers;
permission ognl.OgnlInvokePermission *;
};


And for Linux:

// These permissions are granted to the BlueVueBatch Web UI application

grant codeBase file:${catalina.base}/webapps/BVWeb/- {
permission java.io.FilePermission ${user.home}/.bvb/-,
read;
permission java.io.FilePermission /etc/BlueVueBatch/-,
read;
permission java.io.FilePermission
${catalina.base}/work/Catalina/localhost/BlueVueWeb/-, write;
permission java.io.FilePermission template/-,
read;

permission java.lang.reflect.ReflectPermission
suppressAccessChecks;

permission java.lang.RuntimePermission getClassLoader;
permission java.lang.RuntimePermission accessDeclaredMembers;

permission java.net.SocketPermission *, connect,resolve;

permission java.util.PropertyPermission *, read;

permission ognl.OgnlInvokePermission *;

// For logging
permission java.io.FilePermission /var/log/tomcat6/*,
read,write,delete;
};

// Allow the Database plugins to load properly
grant codeBase file:/etc/BlueVueBatch/BVBDatabases/- {
permission java.lang.RuntimePermission getClassLoader;
};


 

 -Original Message-
 From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
 Sent: Thursday, June 11, 2009 3:20 PM
 To: Tomcat Users List
 Subject: RE: Classloader Issues
 
  From: Jon Pearson [mailto:jon.pear...@sixnet.com]
  Subject: RE: Classloader Issues
  
  That blurb was already in the catalina.policy file.
 
 I think Martin was just using that as an example; you likely 
 need to grant some permission(s) to your own classloader code.
 
 Again, posting the stack trace and the location of the MySQL 
 jar would help to diagnose your problem.
 
  - 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 6.0.18 access files case-insensitive

2009-06-11 Thread André Warnier

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 6/11/2009 6:32 AM, André Warnier wrote:

It's not a base feature of either Java or Tomcat, it's a base feature
of the OS.  Windows filesystems are (relatively, see below)
case-insensitive, Unix/Linux are absolutely case-sensitive.  Since Java
and Java applications are supposed to run on both, they have to choose.
 By default, Tomcat acts case-sensitive.


And furthermore, URLs themselves are case-sensitive (see HTTP/1.1
section 3.2.3).


Nitpicking :
Well, yes.  But in this case it is the mapping of a URL to an object on 
the filesystem which matters.  If the filesystem is case-insensitive, it 
doesn't matter whether the URL is /ABC.PDF or /abc.pdf, does it ?

Or am I forgetting something ?


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



Re: Tomcat 6.0.18 access files case-insensitive

2009-06-11 Thread Markus Schönhaber
André Warnier:

 the filesystem which matters.  If the filesystem is case-insensitive, it 
 doesn't matter whether the URL is /ABC.PDF or /abc.pdf, does it ?

No. Try
http://localhost:8080/tomcat.gif
and
http://localhost:8080/tomcaT.gif
with a default Tomcat install.

-- 
Regards
  mks

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



RE: Classloader Issues (SOLVED)

2009-06-11 Thread Jon Pearson
Apparently there was some kind of silent failure going on behind the
scenes. It seems that the dynamically loaded JAR needed filesystem read
access to the JAR in WEB-INF/lib, and that both the webapp and the other
JAR needed to have java.net.SocketPermission for connect and resolve
against the database server.

Not sure why this manifested itself as a ClassNotFoundException instead
of a SecurityException telling me that I can't read the PostgreSQL
Driver JAR...

Thanks for your help, everyone!

 -Original Message-
 From: Jon Pearson 
 Sent: Thursday, June 11, 2009 1:14 PM
 To: Tomcat Users List
 Subject: Classloader Issues
 
 I am encountering an odd problem with Tomcat (6.0.18). When the Java
 security manager is enabled, I get a ClassNotFoundException when I try
 to load the Postgres database driver using Class.forName() and a URL
 classloader pointed at a jar; its parent classloader is the Webapp
 classloader.
 
 But, when the Java security manager is disabled, everything works
 smoothly and no ClassNotFoundException is thrown.
 
 I've stepped through the code (using Eclipse's debugger) and not found
 anything that stands out, and I've set a general breakpoint on all
 SecurityExceptions, caught or uncaught. None are thrown.
 
 Has anyone else encountered a problem like this? Is there a 
 way for the
 Java security manager to block a class from loading without a
 SecurityException being thrown?
 
 Jonathan P. Pearson - Software Engineer
 -- 
 SIXNET - Solutions for Your Industrial Networking Challenges
 331 Ushers Road, Ballston Lake, NY 12019
 Tel: 1.518.877.5173, Fax: 1.518.877.8346
 www.sixnet.com
 
 -
 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: chunked encoding

2009-06-11 Thread Anthony J. Biacco
 
  Here's my problem. When the request is to a servlet (static apache
 files
  and JSPs through mod_jk are fine) in the form of a GET, instead of
  sending a Content-Length response header, I get a Transfer-Encoding:
  chunked header
  I'd like to know:
  1) What are the causes of either Tomcat (or Apache is it?) enabling
  chunking on the connection?
 
 Tomcat, probably, since you're talking about a servlet-created
 response.
 And it's not chunking the connection but transferring the response body
 chunked.
 

The only thing that makes me question this, is that if I query the servlet 
directly on port 8080 instead of through mod_jk/ajp, it doesn't get chunked. 
Well, I don’t get a transfer-encoding header I should say.
But I don’t get a content length through there either.

 If at the time the response headers are sent the size of the response
 body is already known (for example, if it's just the contents of a
 file), it's easy to send a Content-Length response header.
 OTOH, how big the output of a servlet will be is generally not known
 before the servlet has finished. If you want to send a Content-Length
 header anyway, I see two (well, really only one) alternatives:
 1. Cache the complete servlet output and count the bytes - which isn't
 very practical.[1]

agreed

 2. Don't send a Content-Length header.
 Alternative 2. creates another problem:
 With HTTP/1.0 a client can quite reliably determine when the entire
 response body is transferred, even if no content-length header is sent:
 when the server closes the underlying TCP connection.
 With HTTP/1.1 this isn't the case any more since the TCP connection may
 be left open to be used to transfer additional requests/responses
 (keep-alive). To enable the client to determine when the entire
 response
 was transmitted, you'll have to transfer it chunked.
 

Well, to accomplish #2 I wouldn't have to do anything, since this is my problem 
:-)
I don’t do keep-alives on apache, FWIW. I have is specifically turned off.

  2) How do I get a Content-Length reponse header instead? Do I need to
  downgrade the client to HTTP/1.0 or is there another way?
 
 What's the point in caching dynamically created responses?
 

While they are dynamically created (from database and other sources), the 
content doesn't change on every request, so internally we set the cache-control 
to something like 300 seconds, or whatever we deem appropriate based on how 
constant the content stays. And the same goes for our CDN, which is a Content 
Delivery Network (limelight, akamai, etc..). With requests in the millions per 
day, we're talking a substantial bandwidth and load savings if we can cache 
this content at the CDN. But according to the CDN, without a content-length 
header, the caching won't happen.
I wonder if I downgrade the connection to http 1.0 if it applies to every hop? 
The way the CDN works is that, a request is made to it by the client, if it has 
it in its cache, it serves it to the client, if not, it requests the file from 
the origin server (my web server), I'm assuming by some proxy mechanism. So if 
I downgrade to 1.0, will that apply to the connection from the client to the 
CDN, the CDN to me, or both?

  FYI, the reason I'm trying to do this is that I use a CDN, and they
  won't cache my data without the presence of a Content-Length response
  header, so my servlet data isn't getting cached at the CDN.
 
 What's a CDN?
 
 [1] Tomcat will, by default, cache some output of servlets. IIRC the
 default buffer size is 8k. So, if your servlet creates output of no
 more
 then 8k, a Content-Length header will be sent. Otherwise chunked
 encoding will be used.
 This might be the reason why you see Content-Length headers from your
 JSPs - their output is probably small enough.

I tested with a 8K jsp and did get it chunked.
Do you happen to know the parameter for changing the buffer size? Perhaps I can 
increase it to a number representing the largest length of my servlet content. 
Which isn't too big, maybe 20K.

Thanx,

-Tony



RE: chunked encoding

2009-06-11 Thread Anthony J. Biacco
 I tested with a 8K jsp and did get it chunked.
 Do you happen to know the parameter for changing the buffer size?
 Perhaps I can increase it to a number representing the largest length
 of my servlet content. Which isn't too big, maybe 20K.

NM on this, I found bufferSize for the AJP connector. I'll test it out.

-Tony



RE: chunked encoding

2009-06-11 Thread Anthony J. Biacco
No dice. I tried a bufferSize of 16384 and an 11K response still got chunked. 
Even tried using packetSize and max_packet_size (mod_jk).

-Tony
---
Manager, IT Operations
Format Dynamics, Inc.
303-573-1800x27
abia...@formatdynamics.com
http://www.formatdynamics.com


 -Original Message-
 From: Anthony J. Biacco
 Sent: Thursday, June 11, 2009 2:31 PM
 To: 'Tomcat Users List'
 Subject: RE: chunked encoding
 
  I tested with a 8K jsp and did get it chunked.
  Do you happen to know the parameter for changing the buffer size?
  Perhaps I can increase it to a number representing the largest length
  of my servlet content. Which isn't too big, maybe 20K.
 
 NM on this, I found bufferSize for the AJP connector. I'll test it out.
 
 -Tony



Re: chunked encoding

2009-06-11 Thread Markus Schönhaber
Anthony J. Biacco:

 The only thing that makes me question this, is that if I query the
 servlet directly on port 8080 instead of through mod_jk/ajp, it
 doesn't get chunked. Well, I don’t get a transfer-encoding header I
 should say. But I don’t get a content length through there either.

And which HTTP version is used?

 But according to the CDN, without a content-length
 header, the caching won't happen. I wonder if I downgrade the
 connection to http 1.0 if it applies to every hop? The way the CDN
 works is that, a request is made to it by the client, if it has it in
 its cache, it serves it to the client, if not, it requests the file
 from the origin server (my web server), I'm assuming by some proxy
 mechanism. So if I downgrade to 1.0, will that apply to the
 connection from the client to the CDN, the CDN to me, or both?

I don't know. But you could use a network sniffer and check.

 I tested with a 8K jsp and did get it chunked. Do you happen to know
 the parameter for changing the buffer size? Perhaps I can increase it
 to a number representing the largest length of my servlet content.
 Which isn't too big, maybe 20K.

You could try
javax.servlet.ServletResponse#setBufferSize
http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletResponse.html#setBufferSize%28int%29

There may be even a configuration parameter to change Tomcat's default
buffer size globally. But I don't know if there really is one and if so,
which (and I'm too lazy too check atm).

-- 
Regards
  mks

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



Re: Tomcat 6.0.18 access files case-insensitive

2009-06-11 Thread Markus Schönhaber
Markus Schönhaber:

 André Warnier:
 
 the filesystem which matters.  If the filesystem is case-insensitive, it 
 doesn't matter whether the URL is /ABC.PDF or /abc.pdf, does it ?
 
 No. Try

Hm, re-reading the way you asked the question, this should be Yes, it
does matter instead of No. ;-)

-- 
Regards
  mks

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



Re: Tomcat 6.0.18 access files case-insensitive

2009-06-11 Thread André Warnier

Markus Schönhaber wrote:

André Warnier:

the filesystem which matters.  If the filesystem is case-insensitive, it 
doesn't matter whether the URL is /ABC.PDF or /abc.pdf, does it ?


No. Try
http://localhost:8080/tomcat.gif
and
http://localhost:8080/tomcaT.gif
with a default Tomcat install.


Sorry, I was only reasoning this platonically.
And apparently I was wrong, at least on my Windows Tomcat 5.5.
The second access above gives a 404.
So what's the deal again ?

Under Windows, one can create a file named tomcat.gif OR tomcaT.gif, 
and the filesystem will effectively record the filename with the 
capitalisation as given when creating the file.


Suppose I have created it as tomcat.gif.
With a text editor (or whatever) I can open this file by specifying (in 
the File..open dialog), a name typed in as tomcaT.gif (I just tried).

Thus at that level it is case-insensitive.
I can also not create another file in the same directory, named 
tomcaT.gif.  If I try, I get a message saying that a file with the 
same name already exists (meaning the tomcat.gif).  Thus at that level 
also it is case-insensitive.


However, via Tomcat (like the above link), if I specify a URL of 
tomcaT.gif, I get a 404.
So apparently Tomcat does not just use the standard Windows file..open 
function, it runs additional checks.

Good.
Because if it did not, then I could request /myapp/web-inf/anything and 
get it, bypassing the /WEB-INF/ protection.



In the Tomcat on-line documentation, both for 5.5. and 6.0, for the 
Context element, I find the following explanation for the attribute 
caseSensitive :


If the value of this flag is true, all case sensitivity checks will be 
disabled. If not specified, the default value of the flag is true.


NOTE: This flag MUST NOT be set to false on the Windows platform (or any 
other OS which does not have a case sensitive filesystem), as it will 
disable case sensitivity checks, allowing JSP source code disclosure, 
among other security problems.


I personally find this paragraph rather obscure, since the first and 
third phrase seem to contradict eachother.
In the 1st one it says that, if set to true, all case sensitivity checks 
will be disabled. (true - disabled)
In the third, it says that setting it to false will disable case 
sensitivity checks. (false - disabled)


So both true and false disable case-sensitivity checks.
M..  in the quantum realm maybe, but in Tomcat ?

Should the first phrase not read
If the value of this flag is true, all case sensitivity checks will be 
*enabled*.


?

I also wonder what the purpose of this attribute really is, in fact.
Should this not always be left to case sensitive = true ?
- under Windows or any case-insensitive filesystem, it should be left to 
true. Ok, understandable.
- but under a case-sensitive filesystem, what would be a good reason to 
set it to false ?




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



RE: chunked encoding

2009-06-11 Thread Martin Gainty

mks is correct

you can set MaxPostSize to a value  =2097152 for HttpConnector in 
$TOMCAT_HOME/conf/server.xml
http://spdn.ifas.ufl.edu/docs/config/http.html

and yes your connector will need to support HTTP 1.1 support for 
chunked-encoding
http://spdn.ifas.ufl.edu/docs/config/http.html#Connector%20Comparison

Mit freundlichen Grüßen
Martin 
__ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
 
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




 Date: Thu, 11 Jun 2009 22:58:02 +0200
 From: tomcat-us...@list-post.mks-mail.de
 To: users@tomcat.apache.org
 Subject: Re: chunked encoding
 
 Anthony J. Biacco:
 
  The only thing that makes me question this, is that if I query the
  servlet directly on port 8080 instead of through mod_jk/ajp, it
  doesn't get chunked. Well, I don’t get a transfer-encoding header I
  should say. But I don’t get a content length through there either.
 
 And which HTTP version is used?
 
  But according to the CDN, without a content-length
  header, the caching won't happen. I wonder if I downgrade the
  connection to http 1.0 if it applies to every hop? The way the CDN
  works is that, a request is made to it by the client, if it has it in
  its cache, it serves it to the client, if not, it requests the file
  from the origin server (my web server), I'm assuming by some proxy
  mechanism. So if I downgrade to 1.0, will that apply to the
  connection from the client to the CDN, the CDN to me, or both?
 
 I don't know. But you could use a network sniffer and check.
 
  I tested with a 8K jsp and did get it chunked. Do you happen to know
  the parameter for changing the buffer size? Perhaps I can increase it
  to a number representing the largest length of my servlet content.
  Which isn't too big, maybe 20K.
 
 You could try
 javax.servlet.ServletResponse#setBufferSize
 http://java.sun.com/javaee/5/docs/api/javax/servlet/ServletResponse.html#setBufferSize%28int%29
 
 There may be even a configuration parameter to change Tomcat's default
 buffer size globally. But I don't know if there really is one and if so,
 which (and I'm too lazy too check atm).
 
 -- 
 Regards
   mks
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

_
Lauren found her dream laptop. Find the PC that’s right for you.
http://www.microsoft.com/windows/choosepc/?ocid=ftp_val_wl_290

RE: Tomcat 6.0.18 access files case-insensitive

2009-06-11 Thread Caldarale, Charles R
 From: André Warnier [mailto:a...@ice-sa.com]
 Subject: Re: Tomcat 6.0.18 access files case-insensitive
 
 So apparently Tomcat does not just use the standard Windows 
 file..open function, it runs additional checks.

Tomcat doesn't use Windows anything, it uses the JRE methods.  Underlying those 
are calls to Windows APIs.  Once the File object is created, by default it does 
check that the requested name exactly matches the found name.

 I personally find this paragraph rather obscure

It's not obscure, it's wrong; the first sentence is backwards, as you noticed.

 Should the first phrase not read
 If the value of this flag is true, all case sensitivity checks will be
 *enabled*.

Agreed.

 I also wonder what the purpose of this attribute really is, in fact.
 Should this not always be left to case sensitive = true ?

Unless you're begging for trouble, or have a really, really sloppy programming 
staff.

 - but under a case-sensitive filesystem, what would be a good reason to
 set it to false ?

Extremely lazy users, or non-browser clients that were badly and inconsistently 
programmed.

 - 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-11 Thread Rainer Jung
On 10.06.2009 21:25, Caldarale, Charles R wrote:
 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.)

Haven't read through all of the thread yet, but yes, connectionTimeout
on the AJP connector also closes the connection if the time between two
requests on an existing connections is longer than connectionTimeout.

2 (20 seconds) is relatively short though. Setting it to something
like 30 should be short enough.

Regards,

Rainer

-
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-11 Thread Rainer Jung
On 10.06.2009 18:26, Jones, Keven wrote:
 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:

The dump during times where everything is fine doesn't reveal much. You
(unfortunately) need to do this, when the problem occurs. If you manage
to catch such an event, do 3 thread dumps, each a few seconds apart from
the next. That way one can also decide, whether a situation is static or
only short term.

Regards,

Rainer

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



Re: chunked encoding

2009-06-11 Thread André Warnier

Anthony J. Biacco wrote:

No dice. I tried a bufferSize of 16384 and an 11K response still got chunked. 
Even tried using packetSize and max_packet_size (mod_jk).


I think we need Rainer here.

In the meantime, just as an intellectual exercise, let's take the 
problem from the other end.


A client gets a page (directly or not) from your site.
In that page, is a link to a javascript.
I understand that this link points to the CDN instead of your site.

The client thus requests this javascript from the CDN.

The CDN looks in their cache if they have it.
If they do, they serve it.
If not, they issue a request to your site for it, and your site delivers 
it to the CDN.  The CDN anyway delivers it to the client.
If the response of your site to the CDN is not chunked, they cache it, 
otherwise they don't.


Presumably, you know when a request for such a javascript comes from the 
CDN (as opposed to from a client directly), and you know exactly what 
such a request looks like (I mean, there is pattern to these URLs).


Since you are mentioning mod_jk, I also presume that the CDN sends its 
request to an Apache httpd front-end on your site, which in turn proxies 
it to Tomcat via mod_jk.
And it seems to be AJP/mod_jk which (sometimes) chunks the content prior 
to returning it to Apache.


It seems to me that in such a case, one should be able to do something 
at your Apache httpd front-end level, to de-chunk this response and 
re-create a content-length header, prior to returning it to the CDN.
(As per your earlier message, we're not talking about megabyte 
responses, we're talking about 20 Kb or so).


Maybe Apache httpd could even cache it, which I guess may ensure that it 
is returned non-chunked to the CDN.



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



RE: chunked encoding

2009-06-11 Thread Caldarale, Charles R
 From: Martin Gainty [mailto:mgai...@hotmail.com]
 Subject: RE: chunked encoding
 
 you can set MaxPostSize to a value  =2097152 for HttpConnector in
 $TOMCAT_HOME/conf/server.xml

Which has absolutely nothing to do with the issue under discussion.

maxPostSize is for processing of POST requests, the topic here is chunked 
*output*.

 - 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 6.0.18 access files case-insensitive

2009-06-11 Thread André Warnier

Caldarale, Charles R wrote:

From: André Warnier [mailto:a...@ice-sa.com]



I also wonder what the purpose of this attribute really is, in fact.
Should this not always be left to case sensitive = true ?


Unless you're begging for trouble, or have a really, really sloppy programming 
staff.


- but under a case-sensitive filesystem, what would be a good reason to
set it to false ?


Extremely lazy users, or non-browser clients that were badly and inconsistently 
programmed.


Well, just follow me for a minute.

Suppose we do have a case-sensitive filesystem, and we set this 
attribute to false.
The URL is case-sensitive anyway. Or rather, let's say that it is 
treated as is.


Now suppose there exists a file in the (case-sensitive) filesystem 
called ABC.HTML.

And suppose the client asks for /abc.html.

Now if the attribute is false, does that mean that Tomcat will try all 
possible case variations between abc.html and ABC.HTML before it 
gives up ?


And otherwise, what's the point ?


-
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-11 Thread Rainer Jung
On 10.06.2009 22:57, Filip Hanik - Dev Lists wrote:
 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

Although this will work, it will need more connections and thus threads,
because the routes use different connection pools.

You could also rewrite the jvmRoute in the session id:

http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html#Bind%20session%20after%20crash%20to%20failover%20node

Regards,

Rainer

 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



RE: Tomcat maxThreads Issue

2009-06-11 Thread Jones, Keven
This is a thread dump during a problem. I will take your advice and execute 3 
whan the next event happens. Thank you for your help!

-Original Message-
From: Rainer Jung rainer.j...@kippdata.de
Sent: Thursday, June 11, 2009 6:08 PM
To: Tomcat Users List users@tomcat.apache.org
Subject: Re: Tomcat maxThreads Issue


On 10.06.2009 18:26, Jones, Keven wrote:
 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:

The dump during times where everything is fine doesn't reveal much. You
(unfortunately) need to do this, when the problem occurs. If you manage
to catch such an event, do 3 thread dumps, each a few seconds apart from
the next. That way one can also decide, whether a situation is static or
only short term.

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



Periodic slow response to initial call to HttpServletRequest.getParameter()

2009-06-11 Thread Brian Harper
I've been trying to locate the source of an issue we've encountered
periodically, and am hoping to find some enlightenment here. The issue
is that we're seeing periodic slow responses - in some cases as long as
30-40 seconds for servlet requests that normally come in well under a
second. In troubleshooting the problem, I've traced the source to the
first time that our servlet makes a call to getParameter on the
HttpServletRequest. Our servlet often handles very large - as much as
1MB or so - post requests, with a great deal of JSON form data being
passed up from the client. Even so, it doesn't seem like parsing the
request should take anywhere this long. 

Some background:
- We're using Tomcat 5.5.26 fronted by Apache 2.0 using the mod_jk
connector.
- We have multiple Tomcat instances in our cluster, but the slow
responses occur on each of them with roughly the same frequency.
- Requests are via SSL, with the SSL handshake handled by a load
balancer.
- The slow requests are all POST requests
- Requests are all handled by a single servlet

Questions:
1. When is my servlet instantiated by Tomcat and its doPost method
called? Does this happen before the entire body of the request has been
received? In which case perhaps the delays are simply due to slow client
connections?
2. What is Tomcat doing when the first call to getParameter is made?
What kind of parsing does it have to do to respond?
3. Any ideas why we'd see such long response times on occasion, but not
consistently? If it had something to do with the Apache or mod_jk
config, I'd have expected that the request wouldn't have been hanging on
the getParameter call, it would have been hung up before my servlet was
ever invoked.

Any help would be greatly appreciated. 

Thanks,
Brian Harper


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



Re: mod_jk does not recognize extension

2009-06-11 Thread Rainer Jung
On 11.06.2009 14:26, Tsirkin Evgeny wrote:
 Hi list!
 I have mod_jk 1.2.26 configured and working fine.
 However i want to set a special reply_timeout for a special url ,
 i am getting strange errors in log and the rule is ignored .
 Once i add this line:
  /dataj_mid/controller/finance/*=dataj_mid;reply_timeout=12
 (see the full config below)
 I am getting in jk log this:
 jk_handler::mod_jk.c (2372): Could not find a worker for worker
 name=dataj_mid;reply_timeout=12
 And i am getting error 500 from apache on those urls.

Sorry, but this time an update will help :)

Mount extensions have been added in version 1.2.27. Update to the recent
1.2.28 and it should work.

 My worker.properties :
 ### template - applyed to all the others
 worker.list=dataj,dataj_dev,dataj_mid,test,jkstatus
 worker.template.type=ajp13
 worker.template.host=localhost
 worker.template.port=8009
 ### THE configuration parameter - timeout
 worker.template.reply_timeout=12
 
 
 ## workers using ajp3
 worker.test.reference=worker.template
 worker.dataj.reference=worker.template
 worker.dataj_dev.reference=worker.template
 worker.dataj_mid.reference=worker.template
 ### this status worker will be mounted only throught ssl and from my machine
 worker.jkstatus.type=status
 worker.jkstatus.read_only=True
 
 
 uriworkers.properties:
 /dataj_dev=dataj_dev
 /dataj_dev/controller/finance/*=dataj_dev
 /dataj_dev/*=dataj_dev; reply_timeout=12
 
 # /dataj_mid/controller/finance/*=dataj_mid;reply_timeout=12
 /dataj_mid=dataj_mid
 /dataj_mid/*=dataj_mid
 
 /dataj=dataj
 /dataj/*=dataj
 ###test for java env.
 /jtests=test
 /jtests/*=test

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



RE: Tomcat 6.0.18 access files case-insensitive

2009-06-11 Thread Caldarale, Charles R
 From: André Warnier [mailto:a...@ice-sa.com]
 Subject: Re: Tomcat 6.0.18 access files case-insensitive
 
 Now if the attribute is false, does that mean that Tomcat will try all
 possible case variations between abc.html and ABC.HTML before it
 gives up ?

I just looked at the code in FileDirContext.java (and related classes), and it 
does not seem to.  It wouldn't have to try all variations; it could simply use 
the String.equalsIgnoreCase() method on each entry in the directory of 
interest, or force everything to one case or another when it builds its 
internal lookup table - but I couldn't find anything like that going on.

 And otherwise, what's the point ?

You got me.

 - 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-11 Thread Rainer Jung
On 12.06.2009 00:13, Jones, Keven wrote:
 This is a thread dump during a problem. I will take your advice and
 execute 3 whan the next event happens. Thank you for your help!

Then your problem doesn't last long enough. The presented dump doesn't
contain stacks for 200 connector threads of one connector, so the
problem (exhausted connector thread pool) was already over.

Regards,

Rainer

 -Original Message- From: Rainer Jung
 rainer.j...@kippdata.de Sent: Thursday, June 11, 2009 6:08 PM To:
 Tomcat Users List users@tomcat.apache.org Subject: Re: Tomcat
 maxThreads Issue
 
 
 On 10.06.2009 18:26, Jones, Keven wrote:
 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:
 
 The dump during times where everything is fine doesn't reveal much.
 You (unfortunately) need to do this, when the problem occurs. If you
 manage to catch such an event, do 3 thread dumps, each a few seconds
 apart from the next. That way one can also decide, whether a
 situation is static or only short term.
 
 Regards,
 
 Rainer

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



Re: Periodic slow response to initial call to HttpServletRequest.getParameter()

2009-06-11 Thread Mark Thomas
Brian Harper wrote:
 Questions:
 1. When is my servlet instantiated by Tomcat and its doPost method
 called?
Once the headers have been received and Tomcat can map the request.

 Does this happen before the entire body of the request has been
 received?
Yes.

 In which case perhaps the delays are simply due to slow client
 connections?
Maybe.

 2. What is Tomcat doing when the first call to getParameter is made?
 What kind of parsing does it have to do to respond?
It has to read all of the POST body and parse it.

 3. Any ideas why we'd see such long response times on occasion, but not
 consistently?
Slow clients is one option. Clients that specify an invalid content
length could be another. Tomcat might be hanging around waiting for the
extra data that never arrives. Eventually a time-out kicks in. I'd need
to check the source to see exactly how this is handled. I can't remember
if Tomcat abandons the request, ignores the missing data or does
something else.

Mark



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



Re: Periodic slow response to initial call to HttpServletRequest.getParameter()

2009-06-11 Thread Rainer Jung
On 12.06.2009 00:22, Brian Harper wrote:
 I've been trying to locate the source of an issue we've encountered
 periodically, and am hoping to find some enlightenment here. The issue
 is that we're seeing periodic slow responses - in some cases as long as
 30-40 seconds for servlet requests that normally come in well under a
 second. In troubleshooting the problem, I've traced the source to the
 first time that our servlet makes a call to getParameter on the
 HttpServletRequest. Our servlet often handles very large - as much as
 1MB or so - post requests, with a great deal of JSON form data being
 passed up from the client. Even so, it doesn't seem like parsing the
 request should take anywhere this long. 
 
 Some background:
 - We're using Tomcat 5.5.26 fronted by Apache 2.0 using the mod_jk
 connector.
 - We have multiple Tomcat instances in our cluster, but the slow
 responses occur on each of them with roughly the same frequency.
 - Requests are via SSL, with the SSL handshake handled by a load
 balancer.
 - The slow requests are all POST requests
 - Requests are all handled by a single servlet
 
 Questions:
 1. When is my servlet instantiated by Tomcat and its doPost method
 called? Does this happen before the entire body of the request has been
 received? In which case perhaps the delays are simply due to slow client
 connections?
 2. What is Tomcat doing when the first call to getParameter is made?
 What kind of parsing does it have to do to respond?
 3. Any ideas why we'd see such long response times on occasion, but not
 consistently? If it had something to do with the Apache or mod_jk
 config, I'd have expected that the request wouldn't have been hanging on
 the getParameter call, it would have been hung up before my servlet was
 ever invoked.
 
 Any help would be greatly appreciated. 

If you can reproduce on a test system, or your site is low traffic, you
could set JkLogLevel to debug. Thsi will log all packets forwarded
betwenn httpd and Tomcat, so you might get an idea, whether the pause
happens inside Tomcat/your webapp or maybe between client and httpd.
Beware that JkLogLevel debug will produce huge amounts of output.

Regards,

Rainer

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



Re: Tomcat 6.0.18 access files case-insensitive

2009-06-11 Thread Mark Thomas
Caldarale, Charles R wrote:
 From: André Warnier [mailto:a...@ice-sa.com]
 Should the first phrase not read
 If the value of this flag is true, all case sensitivity checks will be
 *enabled*.
 
 Agreed.

Fixed for 4.1.x, 5.5.x, 6.0.x  trunk. Will be in the next releases of each.

All this time and no-one noticed...

Mark


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



Tomcat restart and jar

2009-06-11 Thread Nowhere

Hi all,
I have a very stuoid question, but I'm bored by it...so I thought to ask
help to you.
I'm modifing many times a jar in a webapp in tomcat and I need to restart
tomcat every change I do. Can't I avoid restarting and having tomcat seeing
changing?
Hoping in any hint, I restart tomcat a lot of times :( and it takes much
time...
Greetings.
-- 
View this message in context: 
http://www.nabble.com/Tomcat-restart-and-jar-tp23990248p23990248.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: chunked encoding

2009-06-11 Thread Anthony J. Biacco
 
 The client thus requests this javascript from the CDN.
 
 The CDN looks in their cache if they have it.
 If they do, they serve it.
 If not, they issue a request to your site for it, and your site
 delivers
 it to the CDN.  The CDN anyway delivers it to the client.
 If the response of your site to the CDN is not chunked, they cache it,
 otherwise they don't.
 

And has the a content-length header, but essentially, yes, all true.

 Presumably, you know when a request for such a javascript comes from
 the
 CDN (as opposed to from a client directly), and you know exactly what
 such a request looks like (I mean, there is pattern to these URLs).
 

True

 Since you are mentioning mod_jk, I also presume that the CDN sends its
 request to an Apache httpd front-end on your site, which in turn
 proxies
 it to Tomcat via mod_jk.
 And it seems to be AJP/mod_jk which (sometimes) chunks the content
 prior
 to returning it to Apache.

True, obviously we're assuming AJP/mod_jk is doing the chunking, which Rainer 
could confirm or disconfirm.

 
 It seems to me that in such a case, one should be able to do something
 at your Apache httpd front-end level, to de-chunk this response and
 re-create a content-length header, prior to returning it to the CDN.
 (As per your earlier message, we're not talking about megabyte
 responses, we're talking about 20 Kb or so).
 

That'd be ideal, yes. I haven't found any such parameters in Apache so far 
though.
Hence the idea about downgrading to http 1.0. But that doesn't get me the 
content length header still (which in itself is strange), though I could 
(although I'm sure to get yelled at for) fake the content-length header with 
something in apache like: Header add Content-length 5
Where 5 is some number larger than my largest possible response. Again, 
probably not the greatest idea.

 Maybe Apache httpd could even cache it, which I guess may ensure that
 it
 is returned non-chunked to the CDN.

I in fact, do use mod_mem_cache to cache this data (in production). For the 
purposes of testing, I have it turned off in dev.

-Tony

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



RE: Tomcat 6.0.18 access files case-insensitive

2009-06-11 Thread Caldarale, Charles R
 From: André Warnier [mailto:a...@ice-sa.com]
 Subject: Re: Tomcat 6.0.18 access files case-insensitive
 
 Since the filesystem is case-sensitive, it may well have both
 abc.html and ABC.HTML in the same directory. So which one
 would it pick to keep ?

Presumably the first or last one encountered.  A clever algorithm could keep 
them all (via a case-insensitive hash) and then try for an exact match; if that 
failed, pick one.  Would seem like a lot of work for little benefit.

 So, back to the Tomcat developers.  What /is/ the point of the
 caseSensitive attribute in the Context element ?

Inquiring minds want to know...

 - 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 restart and jar

2009-06-11 Thread Caldarale, Charles R
 From: Nowhere [mailto:spina.r...@gmail.com]
 Subject: Tomcat restart and jar
 
 I have a very stuoid question, but I'm bored by it...

We'll assume something has been lost in translation here...

 Can't I avoid restarting and having tomcat seeing changing?

Create a WatchedResource element inside the Context element of your webapp; 
the value should be the path to the .jar you're constantly updating, relative 
to the base of the webapp.  For example:

Context ...
  WatchedResourceWEB-INF/lib/myClasses.jar/WatchedResource
/Context

- 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: chunked encoding

2009-06-11 Thread André Warnier

Anthony J. Biacco wrote:



That'd be ideal, yes. I haven't found any such parameters in Apache so far 
though.


I wasn't necessarily thinking about an existing parameter or module.
More of a custom add-on, which would make the request to Tomcat, buffer 
the response, and return it in one chunk with a proper content-length 
header to the CDN caller.
It would be something quite easy to prototype with mod_perl and test the 
concept.
That would of course only be worth the effort if fixing this would 
require a major effort at the Tomcat or AJP/mod_jk level (which it might 
well be).




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



Re: chunked encoding

2009-06-11 Thread André Warnier

Maybe something else worth trying..

I think you mentioned earlier that this did not happen when you accessed 
the link directly via the Tomcat HTTP connector.


Since at the Apache level, you can recognise those calls, why don't you 
try to proxy those calls specifically via mod_proxy_http, to the (or 
a) Tomcat HTTP connector ?

(and let other calls still go though mod_jk).

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



Re: Tomcat 6.0.18 access files case-insensitive

2009-06-11 Thread André Warnier

Caldarale, Charles R wrote:


Presumably the first or last one encountered. ...


Or it could just pick a random file in the directory, whether it matches 
 something or not.  After all, you were saying that this would only 
affect lazy clients or bad programmers.



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



RE: chunked encoding

2009-06-11 Thread Anthony J. Biacco
It turned out I just wasn't using a response big enough. Once I did something 
like 10k I then got a chunked header from tomcat.

-Tony
---
Manager, IT Operations
Format Dynamics, Inc.
303-573-1800x27
abia...@formatdynamics.com
http://www.formatdynamics.com


 -Original Message-
 From: André Warnier [mailto:a...@ice-sa.com]
 Sent: Thursday, June 11, 2009 5:20 PM
 To: Tomcat Users List
 Subject: Re: chunked encoding
 
 Maybe something else worth trying..
 
 I think you mentioned earlier that this did not happen when you
 accessed
 the link directly via the Tomcat HTTP connector.
 
 Since at the Apache level, you can recognise those calls, why don't you
 try to proxy those calls specifically via mod_proxy_http, to the (or
 a) Tomcat HTTP connector ?
 (and let other calls still go though mod_jk).
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



Disable AXIS services list?

2009-06-11 Thread John Oliver
I Googled for this, and found a reference to setting
disableServiceList to true, but that didn't work.  Tomcat is 6.0.18
running under W2K3 Server if that makes a difference.

Thanks.

-- 
***
* John Oliver http://www.john-oliver.net/ *
* *
***

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



Re: chunked encoding

2009-06-11 Thread Tim Funk

http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html

3.6.1
All HTTP/1.1 applications MUST be able to receive and decode the 
chunked transfer-coding, and MUST ignore chunk-extension extensions 
they do not understand.


So you have to jump through big hoops to not use chunked encoding

[IIRC - This thread had to do with a CDN not caching due to chunked 
encoding. A good CDN should be able to cache content if you pass the 
appropriate cache friendly headers. (Like Etag, expires, etc) And handle 
the chunked encoding for you.]


-Tim

Anthony J. Biacco wrote:

No dice. I tried a bufferSize of 16384 and an 11K response still got chunked. 
Even tried using packetSize and max_packet_size (mod_jk).

-Tony
---
Manager, IT Operations
Format Dynamics, Inc.
303-573-1800x27
abia...@formatdynamics.com
http://www.formatdynamics.com


  

-Original Message-
From: Anthony J. Biacco
Sent: Thursday, June 11, 2009 2:31 PM
To: 'Tomcat Users List'
Subject: RE: chunked encoding



I tested with a 8K jsp and did get it chunked.
Do you happen to know the parameter for changing the buffer size?
Perhaps I can increase it to a number representing the largest length
of my servlet content. Which isn't too big, maybe 20K.
  

NM on this, I found bufferSize for the AJP connector. I'll test it out.

-Tony



  



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



Re: Tomcat 6.0.18 access files case-insensitive

2009-06-11 Thread Tim Funk
Its there for convenience (and been there forever) - but it is a 
great big security whole if we ignore case (Try asking for 
/web-INF/wEb.xml - or even more evil  /web-INF/wEb.xm%6c)



-Tim

André Warnier wrote:

Even that wouldn't work.
Since the filesystem is case-sensitive, it may well have both 
abc.html and ABC.HTML in the same directory. So which one would it 
pick to keep ?


So, back to the Tomcat developers.  What /is/ the point of the 
caseSensitive attribute in the Context element ?



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



Re: chunked encoding

2009-06-11 Thread André Warnier

Anthony J. Biacco wrote:

It turned out I just wasn't using a response big enough. Once I did something 
like 10k I then got a chunked header from tomcat.


Ok, so it isn't mod_jk/AJP specifically, it's deeper.
It was a bit to be expected, since the server has no real way to know 
when your servlet is going to stop sending more bytes..

Well, that leaves the Apache module solution.

Maybe your idea of making this be a HTTP 1.0 request, or say set 
whatever internal flag Tomcat would itself set if it had been an HTTP 
1.0 request.  Perhaps a servlet filter is soon enough, or if not, a Valve.
Provided that would do the trick, it is also something you could do at 
the Apache level, before proxying to Tomcat.
I am wondering about possible side-effects though.  The chunked encoding 
is probably not the only difference between 1.0 and 1.1. For example, if 
your Tomcat has Virtual Hosts, it may be an issue.


Now, maybe another stupid question : do you /have/ to generate these 
javascripts with Tomcat ? Couldn't your front-end generate them by itself ?




-
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-11 Thread Filip Hanik - Dev Lists

Rainer Jung wrote:

On 10.06.2009 22:57, Filip Hanik - Dev Lists wrote:
  

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



Although this will work, it will need more connections

more connections true, but they timeout if idle

 and thus threads,
  
not really, since idle connections will be in a polling state if you are 
using APR or NIO.
And if using BIO, then you set a timeout, and the threads will be 
released after the timeout.



because the routes use different connection pools.

You could also rewrite the jvmRoute in the session id:

http://tomcat.apache.org/tomcat-6.0-doc/cluster-howto.html#Bind%20session%20after%20crash%20to%20failover%20node
  
sounds like a mod_jk feature, they are using proxy_balancer, is it 
available there?

Regards,

Rainer

  

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: Tomcat 6.0.18 access files case-insensitive

2009-06-11 Thread André Warnier

Tim Funk wrote:
Its there for convenience (and been there forever) - but it is a 
great big security whole if we ignore case (Try asking for 
/web-INF/wEb.xml - or even more evil  /web-INF/wEb.xm%6c)


Ok.  My point (at the end) was : there does not seem to be a real 
useful use for /ever/ setting this to false.

Under Windows, you should'nt.
And under any OS which has a case-sensitive filesystem, it does not seem 
to achieve anything useful basically.

So why even keep it, and have it documented ?
Just set it to true internally and be done with it.


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



Re: Periodic slow response to initial call to HttpServletRequest.getParameter()

2009-06-11 Thread Bill Barker

Mark Thomas ma...@apache.org wrote in message 
news:4a31874f.8040...@apache.org...
 Brian Harper wrote:
 Questions:
 1. When is my servlet instantiated by Tomcat and its doPost method
 called?
 Once the headers have been received and Tomcat can map the request.


But it is instantiated only for the first request, unless it specifies 
load-on-startup, then it is instantiated when the webapp is loaded.

 Does this happen before the entire body of the request has been
 received?
 Yes.

 In which case perhaps the delays are simply due to slow client
 connections?
 Maybe.

 2. What is Tomcat doing when the first call to getParameter is made?
 What kind of parsing does it have to do to respond?
 It has to read all of the POST body and parse it.

 3. Any ideas why we'd see such long response times on occasion, but not
 consistently?
 Slow clients is one option. Clients that specify an invalid content
 length could be another. Tomcat might be hanging around waiting for the
 extra data that never arrives. Eventually a time-out kicks in. I'd need
 to check the source to see exactly how this is handled. I can't remember
 if Tomcat abandons the request, ignores the missing data or does
 something else.


Using AJP, the handling of the content-length is done by httpd.  Unless it 
is so slow that the connectionTimeout kicks in, Tomcat won't timeout on 
reading the body (but httpd probably will).  But, this isn't a 
content-length issue (I looked at the code), since what would happen then is 
that no POST parameters would be available.  Also, the AJP/1.3 protocol 
tells mod_jk/mod_proxy_ajp to send the (by default) first 8Kb of the body to 
Tomcat without Tomcat asking.  So, unless the body is really big, the gap is 
probably between the client and httpd.

But to do more than guess, the OP would need to follow Rainer's suggestion, 
and provide DEBUG level logs.
 Mark 




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



Re: chunked encoding

2009-06-11 Thread Bill Barker

André Warnier a...@ice-sa.com wrote in message 
news:4a317d8d.3060...@ice-sa.com...
 Anthony J. Biacco wrote:
 No dice. I tried a bufferSize of 16384 and an 11K response still got 
 chunked. Even tried using packetSize and max_packet_size (mod_jk).

 I think we need Rainer here.


No, the various AJP Connectors don't auto-set the content-length header 
(unlike the HTTP/1.1 Connectors).  They just pass on (or not) the value set 
by the Servlet. 




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