The request was rejected because its size (102811565) exceeds the configured maximum (52428800)

2010-08-25 Thread Razvan Poenaru
type Exception report
message
description The server encountered an internal error () that prevented it from 
fulfilling this request.
exception
java.lang.IllegalStateException: 
org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException:
 the request was rejected because its size (102811565) exceeds the configured 
maximum (52428800)
org.apache.catalina.connector.Request.parseParts(Request.java:2567)
org.apache.catalina.connector.Request.parseParameters(Request.java:2775)
org.apache.catalina.connector.Request.getParameter(Request.java:1097)

org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:365)

org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:161)
root cause
org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException:
 the request was rejected because its size (102811565) exceeds the configured 
maximum (52428800)

org.apache.tomcat.util.http.fileupload.FileUploadBase$FileItemIteratorImpl.init(FileUploadBase.java:801)

org.apache.tomcat.util.http.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:284)

org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:304)

org.apache.tomcat.util.http.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:129)
org.apache.catalina.connector.Request.parseParts(Request.java:2540)
org.apache.catalina.connector.Request.parseParameters(Request.java:2775)
org.apache.catalina.connector.Request.getParameter(Request.java:1097)

org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:365)

org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:161)
note The full stack trace of the root cause is available in the Apache 
Tomcat/7.0.2 logs.


Regards,

Razvan  Poenaru | Sr.Programmer/Analyst | Space Missions - MDA
(905) 790 2800 x4626|razvan.poen...@mdacorporation.com|www.mdacorporation.com
Canada - 9445 Airport Road, Brampton, ON - L6S 4J3



Re: The request was rejected because its size (102811565) exceeds the configured maximum (52428800)

2010-08-25 Thread Wesley Acheson
I'm pretty sure this is the wrong mailing list.

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

maxPostSize 

The maximum size in bytes of the POST which will be handled by the
container FORM URL parameter parsing. The limit can be disabled by
setting this attribute to a value less than or equal to 0. If not
specified, this attribute is set to 2097152 (2 megabytes).

On Wed, Aug 25, 2010 at 3:05 PM, Razvan Poenaru
razvan.poen...@mdacorporation.com wrote:
 type Exception report
 message
 description The server encountered an internal error () that prevented it 
 from fulfilling this request.
 exception
 java.lang.IllegalStateException: 
 org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException:
  the request was rejected because its size (102811565) exceeds the configured 
 maximum (52428800)
        org.apache.catalina.connector.Request.parseParts(Request.java:2567)
        
 org.apache.catalina.connector.Request.parseParameters(Request.java:2775)
        org.apache.catalina.connector.Request.getParameter(Request.java:1097)
        
 org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:365)
        
 org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:161)
 root cause
 org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException:
  the request was rejected because its size (102811565) exceeds the configured 
 maximum (52428800)
        
 org.apache.tomcat.util.http.fileupload.FileUploadBase$FileItemIteratorImpl.init(FileUploadBase.java:801)
        
 org.apache.tomcat.util.http.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:284)
        
 org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:304)
        
 org.apache.tomcat.util.http.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:129)
        org.apache.catalina.connector.Request.parseParts(Request.java:2540)
        
 org.apache.catalina.connector.Request.parseParameters(Request.java:2775)
        org.apache.catalina.connector.Request.getParameter(Request.java:1097)
        
 org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:365)
        
 org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:161)
 note The full stack trace of the root cause is available in the Apache 
 Tomcat/7.0.2 logs.


 Regards,

 Razvan  Poenaru | Sr.Programmer/Analyst | Space Missions - MDA
 (905) 790 2800 x4626|razvan.poen...@mdacorporation.com|www.mdacorporation.com
 Canada - 9445 Airport Road, Brampton, ON - L6S 4J3



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



Re: failed FORM authentication redirects to /j_security_check

2010-08-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Shaun,

On 8/23/2010 4:56 AM, Shaun Senecal wrote:
 I'm using FORM authentication, and everything seems to be working
 (logins are accepted, etc), except when there was an error the URL
 changes in the users browser to point to j_security_check.

This is expected.

 The
 contents of the redirect to j_security_check contains login.html, so
 the user is able to login as expected, but my error=true query
 string is not passed along.

How are you checking? If you are forwarding to a .html page, you
probably don't have any dynamic content in there, and therefore have no
options for checking for things like request parameters.

 Is there something obvious I am doing
 wrong here?  I got it working under Jetty as a sanity test, but I need
 to get it working in Tomcat too...

It's possible that Jetty performs a redirect (to login.html?error=true)
during a failed login and Tomcat performs a forward, which is entirely
server-side. The result is that the client never sees the error=true
and therefore only server-side components will be able to see it.

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

iEYEARECAAYFAkx1F/oACgkQ9CaO5/Lv0PBinQCfYr3S/2sEresGix7Qcd/waAow
ltYAoIMMm/C9xFuMS5ixJ8jlsm1ensim
=cFJK
-END PGP SIGNATURE-

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



Re: Session problem

2010-08-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hisham,

On 8/24/2010 10:30 PM, Hisham wrote:
 Jason, you're right in that the tabs i was referring to were tabs
 within my application.  I will verify tomorrow whether the domain is
 different, but i seriously doubt it.

I have a few other things you could check out:

1. Are you using cookies? If you don't properly encode all the URLs in
your webapp, you could be losing session information when cookies are
/not/ being used. It sounds like you are using cookies, though, given
your statement about using Firebug to read the headers en route.

2. Even if your session id is okay, are you dumping the value of the
test attribute for the session? Even though you aren't removing it,
that attribute might have been damaged by something else.

3. You could write another filter that wraps your HttpSession when
requested by the webapp and reports all modifications to it (that is,
calls to setAttribute/removeAttribute/setValue/removeValue).

4. Any reason not to use the container-managed login and session
management? Tomcat can take care of all this logic for you...

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

iEYEARECAAYFAkx1GxQACgkQ9CaO5/Lv0PBChACfSn30308mX8fTcYDPFGnOHYYZ
JlMAoIZ/d8ZpiJRwc+94pbwfDZAiaQWT
=EiKI
-END PGP SIGNATURE-

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



Re: The request was rejected because its size (102811565) exceeds the configured maximum (52428800)

2010-08-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

http://catb.org/esr/faqs/smart-questions.html

On 8/25/2010 9:05 AM, Razvan Poenaru wrote:
 type Exception report
 message
 description The server encountered an internal error () that prevented it 
 from fulfilling this request.
 exception
 java.lang.IllegalStateException: 
 org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException:
  the request was rejected because its size (102811565) exceeds the configured 
 maximum (52428800)
 org.apache.catalina.connector.Request.parseParts(Request.java:2567)
 
 org.apache.catalina.connector.Request.parseParameters(Request.java:2775)
 org.apache.catalina.connector.Request.getParameter(Request.java:1097)
 
 org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:365)
 
 org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:161)
 root cause
 org.apache.tomcat.util.http.fileupload.FileUploadBase$SizeLimitExceededException:
  the request was rejected because its size (102811565) exceeds the configured 
 maximum (52428800)
 
 org.apache.tomcat.util.http.fileupload.FileUploadBase$FileItemIteratorImpl.init(FileUploadBase.java:801)
 
 org.apache.tomcat.util.http.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:284)
 
 org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:304)
 
 org.apache.tomcat.util.http.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:129)
 org.apache.catalina.connector.Request.parseParts(Request.java:2540)
 
 org.apache.catalina.connector.Request.parseParameters(Request.java:2775)
 org.apache.catalina.connector.Request.getParameter(Request.java:1097)
 
 org.apache.catalina.connector.RequestFacade.getParameter(RequestFacade.java:365)
 
 org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:161)
 note The full stack trace of the root cause is available in the Apache 
 Tomcat/7.0.2 logs.
 
 
 Regards,
 
 Razvan  Poenaru | Sr.Programmer/Analyst | Space Missions - MDA
 (905) 790 2800 x4626|razvan.poen...@mdacorporation.com|www.mdacorporation.com
 Canada - 9445 Airport Road, Brampton, ON - L6S 4J3
 
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkx1G0UACgkQ9CaO5/Lv0PCWrQCeJsZPgazEFjq/bhwEsdjFzhS5
9bUAn0H4ZLxFnOItZFEbufSt41ibKuxe
=Cf9V
-END PGP SIGNATURE-

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



Re: Deploying a war to the root URL path

2010-08-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jeffrey,

On 8/23/2010 12:56 PM, Jeffrey Janner wrote:
 Also, I'm surprised no one offered the obvious tuckey redirector
 solution, which usually gets brought up a lot on this list.
 You can always deploy your jira.war as normal, but also create a
 ROOT.war that contains the tuckey redirector configured to redirect ALL
 requests to insert /jira after the hostname of every request.  This
 will add a little overhead, but probably only on the initial
 http://hostname request.

Since the OP is using Apache httpd with AJP (didn't specifiy mod_jk or
mod_proxy_ajp), he could also rewrite the URLs on the fly in the httpd
world and still deploy to /jira in Tomcat.

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

iEYEARECAAYFAkx1HAAACgkQ9CaO5/Lv0PAgwgCgo75dx3C155bAzZqwiMPKV1PR
quMAnjXR7bpVofvBl0xSX+SRd1Aax14m
=9+6f
-END PGP SIGNATURE-

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



Re: Session problem

2010-08-25 Thread Stephen Caine
Jason,

I was referring to an issue where a user opens several tabbed references to the 
same window.  If the session value is changed in one window, the value will 
change in subsequent references in the other tabbed window(s).  Actually, this 
is significant problem, but if this is not what was being asked, then ignore my 
comment.

Stephen

On Aug 24, 2010, at 8:06 PM, Jason Britton wrote:

 Stephen - your statement doesn't really make sense in context to the
 problem he described or how I replied.  From Hisham's first post I
 believe he's describing tabs within the context of a single web page
 interface, when he clicks on any of the three tabs a request is made
 (asynchronous or otherwise), request passes through a servlet filter
 that checks for existence of session attribute etc..  I was suggesting
 he check that he hadn't, for some unknown reason, hardcoded a
 different domain for the Messages link, if that were the case that
 domain (eg. localhost instead of dev2) would not have the same session
 as the other links and the session attribute value he was looking for
 might not be there, which would fit with what he's describing.
 
 Jason
 
 
 On Tue, Aug 24, 2010 at 3:37 PM, Stephen Caine step...@commongrnd.com wrote:
 Jason,
 
 As each window shares the same session, a change to the session value in one 
 window will effect the session value in the others.
 
 Stephen Caine
 
 On Aug 24, 2010, at 5:21 PM, Jason Britton wrote:
 
 I would make sure that the link for your Messages tab is going to the same
 domain as that your session was established under and is hitting the same
 domain as your Home and Admin links.  This doesn't seem to have anything
 to do with Tomcat though.
 
 
 On Tue, Aug 24, 2010 at 1:53 PM, Hisham mohis...@gmail.com wrote:
 
 Hello all,
 
 I have a problem that is driving me crazy.  I don't even know if its a
 Tomcat issue but maybe someone out there can help me out.
 
 I have a webapp that I first developed locally.  I tested this on my
 local environment (windows) and had no issues.  I then deployed the
 same app to our QA environment (linux).  There i am seeing something
 strange.  There are three main tabs, Home, Messages and Admin.
 I can go between home and admin, no probs.  But once i click on
 Messages, somehow the session on the server gets messed up.  The way i
 check whether session is valid is not is that I have a filter that
 will check if a certain attribute is present in the session or not.
 If its not, i assume the session is invalid and forward to login page.
 As soon as i click on the Messages link, i cannot do anything else;
 anywhere else i click it takes me to the login page.  I put print
 statements in my filter and verified that it is not able to find the
 attribute in the session.  Which is strange because the session id is
 the same (i have verified by printing it out, and also seeing what is
 sent in the actual request headers via firebug).  I am not removing
 the attribute from the session in any place; and in any case it works
 fine locally as i said before.
 
 Does any one have any clue as to what could be happening?  I can post
 code if needed, but i don't know where to begin :)
 
 -
 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



Best practices for deployment on cluster environment

2010-08-25 Thread Fernando Morgenstern
Hi,

I have a Tomcat cluster environment with 4 servers. I was wondering that is the 
best way to deploy an application on 4 servers at the same time.

At a first moment, i thought about having a script that would copy war files to 
all servers using rsync. Basically i upload the war file to the first server 
and them use this script to copy to other tomcat servers.

Could you share your experience with this kind of environment? Is this the best 
way to deal with deployment?

Thank you,

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



Corrupt files in 6.0.29 distribution?

2010-08-25 Thread Clifton, Matthew R (AS)
Hello,

Just performed a download on the 6.0.29 version of the software, and
after performing a Sophos Anti-virus scan found the following four files
to be corrupt: dso-dlfcn.o, locks.o, replace.o, signals.o.  These files
were found within the commons-daemon-native.tar.gz for the
apache-tomcat-6.0.29.tar.gz download.  The same files seem to be coming
up corrupt for different types of download for 6.0.29, and versions
earlier then 6.0.29...since the files don't appear in the beta for 7,
this isn't an issue for that version.  Wondering if this is a known
issue, how necessary these files are, etc.

Thanks for the assistance
Matt


Re: Session problem

2010-08-25 Thread Hisham
Chris, thanks for your reply!

 1. Are you using cookies? If you don't properly encode all the URLs in
 your webapp, you could be losing session information when cookies are
 /not/ being used. It sounds like you are using cookies, though, given
 your statement about using Firebug to read the headers en route.

I'm not using any cookies.  Also i want to stress the fact that the
app works fine in my local environment.

 2. Even if your session id is okay, are you dumping the value of the
 test attribute for the session? Even though you aren't removing it,
 that attribute might have been damaged by something else.

I've looked everywhere, and unless i missed something i don't think
this is the issue.

 3. You could write another filter that wraps your HttpSession when
 requested by the webapp and reports all modifications to it (that is,
 calls to setAttribute/removeAttribute/setValue/removeValue).

How would I go about doing this?  Is there a particular filter that
listens to attributes being changed?

 4. Any reason not to use the container-managed login and session
 management? Tomcat can take care of all this logic for you...

Will eventually move to this, you're right.  I am using Spring so will
use Spring security/Acegi.

-h



On Wed, Aug 25, 2010 at 9:31 AM, Christopher Schultz
ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hisham,

 On 8/24/2010 10:30 PM, Hisham wrote:
 Jason, you're right in that the tabs i was referring to were tabs
 within my application.  I will verify tomorrow whether the domain is
 different, but i seriously doubt it.

 I have a few other things you could check out:

 1. Are you using cookies? If you don't properly encode all the URLs in
 your webapp, you could be losing session information when cookies are
 /not/ being used. It sounds like you are using cookies, though, given
 your statement about using Firebug to read the headers en route.

 2. Even if your session id is okay, are you dumping the value of the
 test attribute for the session? Even though you aren't removing it,
 that attribute might have been damaged by something else.

 3. You could write another filter that wraps your HttpSession when
 requested by the webapp and reports all modifications to it (that is,
 calls to setAttribute/removeAttribute/setValue/removeValue).

 4. Any reason not to use the container-managed login and session
 management? Tomcat can take care of all this logic for you...

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

 iEYEARECAAYFAkx1GxQACgkQ9CaO5/Lv0PBChACfSn30308mX8fTcYDPFGnOHYYZ
 JlMAoIZ/d8ZpiJRwc+94pbwfDZAiaQWT
 =EiKI
 -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: Session problem

2010-08-25 Thread Hisham
Btw, Jason, I have verified that the domain is the same.

-h



On Wed, Aug 25, 2010 at 9:55 AM, Hisham mohis...@gmail.com wrote:
 Chris, thanks for your reply!

 1. Are you using cookies? If you don't properly encode all the URLs in
 your webapp, you could be losing session information when cookies are
 /not/ being used. It sounds like you are using cookies, though, given
 your statement about using Firebug to read the headers en route.

 I'm not using any cookies.  Also i want to stress the fact that the
 app works fine in my local environment.

 2. Even if your session id is okay, are you dumping the value of the
 test attribute for the session? Even though you aren't removing it,
 that attribute might have been damaged by something else.

 I've looked everywhere, and unless i missed something i don't think
 this is the issue.

 3. You could write another filter that wraps your HttpSession when
 requested by the webapp and reports all modifications to it (that is,
 calls to setAttribute/removeAttribute/setValue/removeValue).

 How would I go about doing this?  Is there a particular filter that
 listens to attributes being changed?

 4. Any reason not to use the container-managed login and session
 management? Tomcat can take care of all this logic for you...

 Will eventually move to this, you're right.  I am using Spring so will
 use Spring security/Acegi.

 -h



 On Wed, Aug 25, 2010 at 9:31 AM, Christopher Schultz
 ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hisham,

 On 8/24/2010 10:30 PM, Hisham wrote:
 Jason, you're right in that the tabs i was referring to were tabs
 within my application.  I will verify tomorrow whether the domain is
 different, but i seriously doubt it.

 I have a few other things you could check out:

 1. Are you using cookies? If you don't properly encode all the URLs in
 your webapp, you could be losing session information when cookies are
 /not/ being used. It sounds like you are using cookies, though, given
 your statement about using Firebug to read the headers en route.

 2. Even if your session id is okay, are you dumping the value of the
 test attribute for the session? Even though you aren't removing it,
 that attribute might have been damaged by something else.

 3. You could write another filter that wraps your HttpSession when
 requested by the webapp and reports all modifications to it (that is,
 calls to setAttribute/removeAttribute/setValue/removeValue).

 4. Any reason not to use the container-managed login and session
 management? Tomcat can take care of all this logic for you...

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

 iEYEARECAAYFAkx1GxQACgkQ9CaO5/Lv0PBChACfSn30308mX8fTcYDPFGnOHYYZ
 JlMAoIZ/d8ZpiJRwc+94pbwfDZAiaQWT
 =EiKI
 -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: Session problem

2010-08-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hisham,

On 8/25/2010 9:55 AM, Hisham wrote:
 1. Are you using cookies? If you don't properly encode all the URLs in
 your webapp, you could be losing session information when cookies are
 /not/ being used. It sounds like you are using cookies, though, given
 your statement about using Firebug to read the headers en route.
 
 I'm not using any cookies.  Also i want to stress the fact that the
 app works fine in my local environment.

Uh, then I'm confused by your original post, which included this:


Which is strange because the session id is
the same (i have verified by printing it out, and also seeing what is
sent in the actual request headers via firebug).


If you were observing the headers for your session id, then what other
header would you be looking for besides the JSESSIONID cookie? IF you
aren't using cookies for session id management, then are you properly
encoding all your URLs? If you aren't, you'll lose your session when you
click on one of those URLs.

Please post the HTML code around the link to your Messages page.

 2. Even if your session id is okay, are you dumping the value of the
 test attribute for the session? Even though you aren't removing it,
 that attribute might have been damaged by something else.
 
 I've looked everywhere, and unless i missed something i don't think
 this is the issue.

You still didn't say that you actually observed the value you expect to
be in the session, and your Filter still forces a login. Could you:

1. Post the code to your filter
2. Add a logging statement that prints the URL being accessed

It's possible that there's some image being requested that's fouling
things up.

 3. You could write another filter that wraps your HttpSession when
 requested by the webapp and reports all modifications to it (that is,
 calls to setAttribute/removeAttribute/setValue/removeValue).
 
 How would I go about doing this?  Is there a particular filter that
 listens to attributes being changed?

No, which is why I said you could write one. I believe I've posted the
full code for such a filter on this list in the past. Consider searching
the archives.

 4. Any reason not to use the container-managed login and session
 management? Tomcat can take care of all this logic for you...
 
 Will eventually move to this, you're right.  I am using Spring so will
 use Spring security/Acegi.

Maybe now would be a good time for that. You may spend less time
implementing ACEGI than you would tracking-down whatever this problem is.

I suspect that the Windows vs. Linux environment is not related to the
problem you're experiencing (unless this is some kind of case-sensitive
issue, which is entirely possible).

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

iEYEARECAAYFAkx1JIsACgkQ9CaO5/Lv0PBfpwCcCjb7uWXkbMTqy8JAbFcshZBA
1uAAn079qe7eMAQ+KiHojMk/Rx3+jqt0
=FGiU
-END PGP SIGNATURE-

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



java.net.BindException: Address already in use

2010-08-25 Thread Paul Bourget
I assumed that this indicates be a port conflict before I googled this
problem.  Every solution I found said find and resolve the port
conflict.  I cannot find the conflict.

 

 

[r...@localhost logs]# netstat -a | grep 8209

[r...@localhost logs]#

 

[r...@localhost logs]# netstat -a | grep 8606

[r...@localhost logs]#

 

[r...@localhost logs]# ps -ef | egrep 'httpd | apache | tomcat |
catalina'

root  3036 1  0 Aug24 ?00:00:00 Xvnc :5 -desktop
localhost.localdomain:5 (root) -httpd /usr/share/vnc/classes -auth
/root/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 3 -rfbauth
/root/.vnc/passwd -rfbport 5905 -pn

 

 

Here's the log output

 

[r...@localhost logs]# more catalina.2010-08-24.log

Aug 24, 2010 1:51:16 PM org.apache.catalina.startup.Catalina load

INFO: Initialization processed in 570 ms

Aug 24, 2010 1:51:16 PM org.apache.catalina.core.StandardService start

INFO: Starting service Tomcat-Standalone

Aug 24, 2010 1:51:16 PM org.apache.catalina.core.StandardEngine start

INFO: Starting Servlet Engine: Apache Tomcat/5.5.23

Aug 24, 2010 1:51:16 PM org.apache.catalina.core.StandardHost start

INFO: XML validation disabled

Aug 24, 2010 1:51:42 PM org.apache.jk.common.ChannelSocket init

**

INFO: Port busy 8209 java.net.BindException: Address already in use

**

Aug 24, 2010 1:51:42 PM org.apache.jk.common.ChannelSocket init

INFO: JK: ajp13 listening on /0.0.0.0:8210

Aug 24, 2010 1:51:42 PM org.apache.jk.server.JkMain start

INFO: Jk running ID=1 time=1/89  config=null

Aug 24, 2010 1:51:42 PM org.apache.catalina.startup.Catalina start

INFO: Server startup in 25506 ms

**

Aug 24, 2010 1:51:42 PM org.apache.catalina.core.StandardServer await

SEVERE: StandardServer.await: create[8606]:

java.net.BindException: Address already in use

at java.net.PlainSocketImpl.socketBind(Native Method)

at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)

at java.net.ServerSocket.bind(ServerSocket.java:319)

at java.net.ServerSocket.init(ServerSocket.java:185)

at
org.apache.catalina.core.StandardServer.await(StandardServer.java:363)

at org.apache.catalina.startup.Catalina.await(Catalina.java:616)

at org.apache.catalina.startup.Catalina.start(Catalina.java:576)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)

at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)

at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)

Aug 24, 2010 1:51:43 PM org.apache.catalina.core.StandardService stop

INFO: Stopping service Tomcat-Standalone

Aug 24, 2010 2:29:02 PM org.apache.catalina.connector.Connector pause

SEVERE: Protocol handler pause failed

java.net.SocketException: Network is unreachable

at java.net.PlainSocketImpl.socketConnect(Native Method)

at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)

at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)

at java.net.Socket.connect(Socket.java:520)

at java.net.Socket.connect(Socket.java:470)

at java.net.Socket.init(Socket.java:367)

 

 

 

 

 

Paul Bourget

Director, Network Operations

Isabella Products

9 Damonmill Square, Suite 4A

Concord, MA 01742

978 287 0007 Ext 123

 



Re: Tomcat Version Numbers

2010-08-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

On 8/20/2010 12:36 PM, Caldarale, Charles R wrote:
 From: Christopher Schultz [mailto:ch...@christopherschultz.net]
 Subject: Tomcat Version Numbers

 What was the first version of TC 6.0 that was considered stable?
 
 Looks like 6.0.1 was the first release marked stable.
 
 Browsing to http://archive.apache.org/dist/tomcat/tomcat-6/ seems 
 to indicate that 6.0.10 was the first version not marked as alpha
 or beta.
 
 You missed 6.0.1.

My confusion persists. Here is a sample of the subdirectory names from
the above directory:

[DIR] v6.0.0-alpha/   2006-10-21 00:02-
[DIR] v6.0.0/ 2006-10-21 00:02-
[DIR] v6.0.1-alpha/   2006-11-08 12:52-
[DIR] v6.0.1/ 2006-11-08 12:52-
[DIR] v6.0.10/2007-02-26 17:13-
[DIR] v6.0.13/2007-05-14 15:32-
[DIR] v6.0.14/2007-08-09 12:35-
[DIR] v6.0.16/2008-02-06 23:55-
[DIR] v6.0.18/2008-07-30 09:51-
[DIR] v6.0.2-alpha/   2006-11-16 00:02-
[DIR] v6.0.2-beta/2006-11-16 00:02-
[DIR] v6.0.2/ 2006-11-16 00:02-

So, there's a 6.0.0-alpha, and then a 6.0.0, unqualified. Does that mean
that 6.0.0 was stable -- at least after the alpha stage? What about,
say, 6.0.2? If 6.0.0 (or even 6.0.1) was stable, why was 6.0.2 relegated
to beta (and, apparently, alpha) status? Were those pre-6.0.2 tags with
6.0.2 being the release version? At some point, the -alpha and -beta
qualifications disappear (after 6.0.9, which is why I concluded that
6.0.10 was the first release version).

I'm sure I'm muddying the waters by using the term stable which
generally means API-compatible, not necessarily production-quality.

 Is there a reason that the alphas and betas are not called 
 something like 7.0.0-beta1 and 7.0.0-beta2, etc.?
 
 Simplicity.  When a branch is tagged, its number is fixed at that point, and 
 the content frozen.  As field testing progresses, the designation of the 
 branch may be advanced from alpha, to beta, to stable - with no code changes. 
  Or problems may be discovered, code committed, and a new branch tagged, with 
 a new number.

The above does not strike me as simple. If you can have 6.0.0-alpha and
6.0.2-beta, why not have a tag progression that looks like this:

6.0.0-alpha
6.0.0-beta1
6.0.0-beta2
6.0.0-beta3
6.0.0 [release]
6.0.1 [release]
6.0.2 [release]

Again, this is partly because I feel a certain sense of order which
requires releases to be X.0.0.

My original question was sparked by the fact that 7.0.2 was released
which would, merely by the version number, indicate to me that it was a
stable bugfix release to the 7.0 line. In fact, it is another in a
string of non-production-quality releases.

For those who never read http://tomcat.apache.org/whichversion.html, or
don't understand it (btw: that page says 7.0.0 is the current version of
the 7.0.x versions), downloading the highest version number available
(7.0.2) might not be such a good idea.

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

iEYEARECAAYFAkx1J1kACgkQ9CaO5/Lv0PApJACeNBcuF+cQkMykU1cqpZe3/NeO
sIwAoICZpWqCA0G8e7aEW8Zo8I2CkzS6
=jnk9
-END PGP SIGNATURE-

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



Re: java.net.BindException: Address already in use

2010-08-25 Thread Peter Crowther
Well, the ports you're requesting are or have recently been in use.

Try:
netstat -an | grep 8209
... just in case someone's given the service a name in /etc/services.  Also
just check that you've not got the same number in two places in
conf/server.xml, for example as the shutdown port.  Finally, check none of
your scripts are trying to start two instances of the same Tomcat at the
same time - it has happened!

If it's none of those, come back to us.  If you could give us details about
your environment (OS version, Tomcat version, Java version) we'd be more
likely to give help that's specific to you.  I can see Tomcat 5.5.23 in the
logs (why so old, by the way?) but have no idea about the others.

Finally, what's that Socks socket doing at shutdown?

- Peter

On 25 August 2010 15:17, Paul Bourget paul.bour...@isabellaproducts.comwrote:

 I assumed that this indicates be a port conflict before I googled this
 problem.  Every solution I found said find and resolve the port
 conflict.  I cannot find the conflict.





 [r...@localhost logs]# netstat -a | grep 8209

 [r...@localhost logs]#



 [r...@localhost logs]# netstat -a | grep 8606

 [r...@localhost logs]#



 [r...@localhost logs]# ps -ef | egrep 'httpd | apache | tomcat |
 catalina'

 root  3036 1  0 Aug24 ?00:00:00 Xvnc :5 -desktop
 localhost.localdomain:5 (root) -httpd /usr/share/vnc/classes -auth
 /root/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 3 -rfbauth
 /root/.vnc/passwd -rfbport 5905 -pn





 Here's the log output



 [r...@localhost logs]# more catalina.2010-08-24.log

 Aug 24, 2010 1:51:16 PM org.apache.catalina.startup.Catalina load

 INFO: Initialization processed in 570 ms

 Aug 24, 2010 1:51:16 PM org.apache.catalina.core.StandardService start

 INFO: Starting service Tomcat-Standalone

 Aug 24, 2010 1:51:16 PM org.apache.catalina.core.StandardEngine start

 INFO: Starting Servlet Engine: Apache Tomcat/5.5.23

 Aug 24, 2010 1:51:16 PM org.apache.catalina.core.StandardHost start

 INFO: XML validation disabled

 Aug 24, 2010 1:51:42 PM org.apache.jk.common.ChannelSocket init

 **

 INFO: Port busy 8209 java.net.BindException: Address already in use

 **

 Aug 24, 2010 1:51:42 PM org.apache.jk.common.ChannelSocket init

 INFO: JK: ajp13 listening on /0.0.0.0:8210

 Aug 24, 2010 1:51:42 PM org.apache.jk.server.JkMain start

 INFO: Jk running ID=1 time=1/89  config=null

 Aug 24, 2010 1:51:42 PM org.apache.catalina.startup.Catalina start

 INFO: Server startup in 25506 ms

 **

 Aug 24, 2010 1:51:42 PM org.apache.catalina.core.StandardServer await

 SEVERE: StandardServer.await: create[8606]:

 java.net.BindException: Address already in use

at java.net.PlainSocketImpl.socketBind(Native Method)

at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)

at java.net.ServerSocket.bind(ServerSocket.java:319)

at java.net.ServerSocket.init(ServerSocket.java:185)

at
 org.apache.catalina.core.StandardServer.await(StandardServer.java:363)

at org.apache.catalina.startup.Catalina.await(Catalina.java:616)

at org.apache.catalina.startup.Catalina.start(Catalina.java:576)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
 a:39)

at
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
 Impl.java:25)

at java.lang.reflect.Method.invoke(Method.java:585)

at
 org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)

at
 org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)

 Aug 24, 2010 1:51:43 PM org.apache.catalina.core.StandardService stop

 INFO: Stopping service Tomcat-Standalone

 Aug 24, 2010 2:29:02 PM org.apache.catalina.connector.Connector pause

 SEVERE: Protocol handler pause failed

 java.net.SocketException: Network is unreachable

at java.net.PlainSocketImpl.socketConnect(Native Method)

at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)

at
 java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)

at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)

at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)

at java.net.Socket.connect(Socket.java:520)

at java.net.Socket.connect(Socket.java:470)

at java.net.Socket.init(Socket.java:367)











 Paul Bourget

 Director, Network Operations

 Isabella Products

 9 Damonmill Square, Suite 4A

 Concord, MA 01742

 978 287 0007 Ext 123






Re: [OT] Sessions mix-up on Tomcat 6.0.26 on Linux

2010-08-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Yawar,

On 8/21/2010 12:42 AM, Yawar Khan wrote:
 chris, i had a look at container managed authentication and its quite handy. 
 but 
 i couldnt see how i can add extra functionality like calling an encryption 
 function on password text field before tomcat does its authentication on it.

It's built-in. As long as you just want to do a simple hash of the
user's password (like MD5, SHA-256, etc.), you should be good to go.
Unfortunately, Tomcat does not currently support any salting of the
password before hashing.

 for js, my client side authentication is done on form submit button click 
 event, 
 if the hackers do disable javascripts, how will my html form be submitted? 

You don't even need a page in order to submit a form to a web server.
You can use 'wget' from the command-line to synthesize a request if
you're lazy. If you're determined, you can write your own client that
feeds everything to the web server and acts just like a web browser.

 however, i will add some server side validation as well, i agree thats 
 important.

I should say so.

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

iEYEARECAAYFAkx1KEUACgkQ9CaO5/Lv0PCBnwCfahxtdo7urHBQluUyZcq7JyeQ
nqUAn02+e1+nw3LfBh/6zRwT3667ngIn
=GU9r
-END PGP SIGNATURE-

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



Re: Tomcat Version Numbers

2010-08-25 Thread Peter Crowther
On 25 August 2010 15:23, Christopher Schultz
ch...@christopherschultz.netwrote:

 Again, this is partly because I feel a certain sense of order which
 requires releases to be X.0.0.

 Why?  And by release do you mean stable, production-quality releases
that we'll stake our reputations on (in which case almost every x.0.0 would
in reality fail the test) or do you mean released outside the development
team?

Not saying it's wrong (I tend to avoid right and wrong due to
relativism), just interested by the expectation.

Cheers,

- Peter


Re: How stable is Tomcat?

2010-08-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Yawar,

On 8/21/2010 8:59 AM, Yawar Khan wrote:
 Guys, is tomcat stable enough to host large scale production
 applications getting 1500+ hits everyday?

Certainly.

1500 hits/day is nothing. You could do that on a smartphone.

Our daily average for August so far is 26869 hits (which isn't much /at
all/) and Tomcat 5.5.x isn't batting an eyelash at that. We run with a
measly 10 database connections in our pool, too. Mean response time (on
the server, so there's no network time taken into account) for all
requests over the last 6 months or so is 135ms (weighted average...
unweighted average is 154ms).

That's with an old version of Tomcat, run through Apache httpd/mod_jk,
using the blocking I/O AJP connector, using a 3GHz quad-core CPU with a
heap size of a mere 500MiB (I thought we were using 192MiB, but it looks
like I forgot to constrain the heap size the last time I launched the JVM).

The JVM has never crashed in the 7 years we've been running this webapp
(it's actually 4 webapps, running in 4 separate JVMs), nor has Tomcat.
The only unexpected downtime we've ever had was when we busted the heap
once long ago (when we were running under a 64MiB heap) and that was
because we had a poor capacity plan, not because of Java/Tomcat.

 and as much concurrent database connections.

1500 database connections might be a lot to configure. Remember that
you'll likely get those 1500+ hits during a 24-hour period (or even an
8-hour period) and not all at once. You probably need far fewer database
connections than you think you do.

 I know alot depends on the applications architecture but just how
 good is tomcat?

Really effing good.

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

iEYEARECAAYFAkx1LEgACgkQ9CaO5/Lv0PD6rACglH6ICeQl4hpKctAaC9UZiFUN
djIAn2DzK0AvMsC+hedrInR8SfCpud6a
=XWVz
-END PGP SIGNATURE-

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



Re: Corrupt files in 6.0.29 distribution?

2010-08-25 Thread Konstantin Kolinko
2010/8/25 Clifton, Matthew R (AS) matthew.clif...@ngc.com:
 Just performed a download on the 6.0.29 version of the software, and
 after performing a Sophos Anti-virus scan found the following four files
 to be corrupt: dso-dlfcn.o, locks.o, replace.o, signals.o.  These files
 were found within the commons-daemon-native.tar.gz for the
 apache-tomcat-6.0.29.tar.gz download.  The same files seem to be coming
 up corrupt for different types of download for 6.0.29, and versions
 earlier then 6.0.29...since the files don't appear in the beta for 7,
 this isn't an issue for that version.  Wondering if this is a known
 issue, how necessary these files are, etc.


Those are in commons-daemon-native.tar.gz

See
https://issues.apache.org/bugzilla/show_bug.cgi?id=49674

Best regards,
Konstantin Kolinko

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



Re: How stable is Tomcat?

2010-08-25 Thread David kerber

On 8/25/2010 10:44 AM, Christopher Schultz wrote:

...


I know alot depends on the applications architecture but just how
good is tomcat?


Really effing good.


+1

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



Re: Tomcat Version Numbers

2010-08-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Peter,

On 8/25/2010 10:30 AM, Peter Crowther wrote:
 On 25 August 2010 15:23, Christopher Schultz
 ch...@christopherschultz.netwrote:
 
 Again, this is partly because I feel a certain sense of order which
 requires releases to be X.0.0.

 Why?  And by release do you mean stable, production-quality releases
 that we'll stake our reputations on (in which case almost every x.0.0 would
 in reality fail the test) or do you mean released outside the development
 team?
 
 Not saying it's wrong (I tend to avoid right and wrong due to
 relativism), just interested by the expectation.

Microsoft products notwithstanding, I kind of expect that release X.0.0
will be appropriate for general-purpose use. That wasn't true of 6.0.0
and 7.0.0. One had to wait around until 6.0.1 or 6.0.10 or whatever
before 6.0.x was really ready. I'm sure there will be an announcement
at some point that 7.0.5 (or whatever it happens to be) is stable (no
API changes) and production-quality in that no correctness tests fail,
but it would be nice to just /know/ that 7.0.0 is the release and
everything after that is bugfixes and stuff. Instead, 7.0.5 (or
whatever) will be the release which is just... surprising.

It's not really tripping me up: don't worry. I'm thinking about casual
readers/downloaders who don't see the beta in the name (which, by the
way, only appears in a single place on
http://tomcat.apache.org/download-70.cgi, with no specific warning about
how it's a beta release and not appropriate for production).

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

iEYEARECAAYFAkx1L/cACgkQ9CaO5/Lv0PCihgCcDLX2J5RWx+M9rB1R/tLLuvMI
m4oAn0WCXF4ajP1MK/3bBpyB1Ut+4lkt
=nCnY
-END PGP SIGNATURE-

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



Re: How stable is Tomcat?

2010-08-25 Thread Edmund Urbani
On 08/25/10 16:51, David kerber wrote:
 On 8/25/2010 10:44 AM, Christopher Schultz wrote:

 I know alot depends on the applications architecture but just how
 good is tomcat?

 Really effing good.
 
 +1
 
Tomcat itself is usually the last thing to be worried about when it comes to
performance and stability. Your webapp, your database, your network should come
first.

And if you are expecting really huge loads, Tomcat's clustering and
load-balancing features can help you distribute that onto several servers.

Cheers,
 Edmund


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



Re: Session problem

2010-08-25 Thread Hisham
Chris,

Let me rephrase what I said: I am not using any custom cookies, the
JsessionID cookie gets created by default.

So i created an HttpSessionAttributeListener listener.  And what i
observed is truly weird.  Once i click on Messages tab, the request
goes through fine, there are a couple of images that are requested
that are delivered correctly.  After all this has finished, 2 of the
attributes i have stored in the session are removed.  Mind you, i have
more attributes that DON'T get removed.  I did a complete hack that IF
these other attributes are still present then go ahead and put the 2
attributes back into the session - and it works fine now!

Of course i'm not gonna leave it like this, i still need to figure out
what the hell is going on!  Here is my filter code:

public void doFilter(ServletRequest request, ServletResponse
response, FilterChain chain) throws IOException, ServletException {
boolean authorized = false;

HttpServletRequest req = (HttpServletRequest)request;
HttpServletResponse res = (HttpServletResponse)response;
HttpSession session = req.getSession(false);

   System.out.println(req.getRequestURL());

if (session != null  session.getAttribute(ub) != null)) {

authorized = true;
System.out.println(setting authorized = true);
chain.doFilter(request, response);
}   

// forward the request to login page
if (!authorized) {  
System.out.println(kicked someone from 
+request.getRemoteAddr()); 
res.setHeader(session, invalid);
res.sendError(HttpServletResponse.SC_UNAUTHORIZED, 
Your session is
invalid or have expired.);
}
}

-h



On Wed, Aug 25, 2010 at 10:11 AM, Christopher Schultz
ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Hisham,

 On 8/25/2010 9:55 AM, Hisham wrote:
 1. Are you using cookies? If you don't properly encode all the URLs in
 your webapp, you could be losing session information when cookies are
 /not/ being used. It sounds like you are using cookies, though, given
 your statement about using Firebug to read the headers en route.

 I'm not using any cookies.  Also i want to stress the fact that the
 app works fine in my local environment.

 Uh, then I'm confused by your original post, which included this:

 
 Which is strange because the session id is
 the same (i have verified by printing it out, and also seeing what is
 sent in the actual request headers via firebug).
 

 If you were observing the headers for your session id, then what other
 header would you be looking for besides the JSESSIONID cookie? IF you
 aren't using cookies for session id management, then are you properly
 encoding all your URLs? If you aren't, you'll lose your session when you
 click on one of those URLs.

 Please post the HTML code around the link to your Messages page.

 2. Even if your session id is okay, are you dumping the value of the
 test attribute for the session? Even though you aren't removing it,
 that attribute might have been damaged by something else.

 I've looked everywhere, and unless i missed something i don't think
 this is the issue.

 You still didn't say that you actually observed the value you expect to
 be in the session, and your Filter still forces a login. Could you:

 1. Post the code to your filter
 2. Add a logging statement that prints the URL being accessed

 It's possible that there's some image being requested that's fouling
 things up.

 3. You could write another filter that wraps your HttpSession when
 requested by the webapp and reports all modifications to it (that is,
 calls to setAttribute/removeAttribute/setValue/removeValue).

 How would I go about doing this?  Is there a particular filter that
 listens to attributes being changed?

 No, which is why I said you could write one. I believe I've posted the
 full code for such a filter on this list in the past. Consider searching
 the archives.

 4. Any reason not to use the container-managed login and session
 management? Tomcat can take care of all this logic for you...

 Will eventually move to this, you're right.  I am using Spring so will
 use Spring security/Acegi.

 Maybe now would be a good time for that. You may spend less time
 implementing ACEGI than you would tracking-down whatever this problem is.

 I suspect that the Windows vs. Linux environment is not related to the
 problem you're experiencing (unless this is some kind of case-sensitive
 issue, which is entirely possible).

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - 

RE: Tomcat Version Numbers

2010-08-25 Thread Caldarale, Charles R
 From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
 Subject: Re: Tomcat Version Numbers

 there's a 6.0.0-alpha, and then a 6.0.0, unqualified.
 Does that mean that 6.0.0 was stable -- at least after
 the alpha stage?

Yes. (I missed the unmarked 6.0.0 leg.)

 why was 6.0.2 relegated to beta (and, apparently,
 alpha) status?

Because there hadn't been enough field testing to consider it stable.  As more 
testing occurred, and more reports received, the marking was upgraded.

 I'm sure I'm muddying the waters by using the term stable which
 generally means API-compatible, not necessarily production-quality.

I've always considered stable to mean production-quality; it has nothing to 
do with API compatibility.

 why not have a tag progression that looks like this:

 6.0.0-alpha
 6.0.0-beta1
 6.0.0-beta2

Because there are no changes to an x.y.z level, regardless of how its marking 
progresses.  _Any_ changes require a new dot number.  The 6.0.0-alpha and 6.0.0 
are identical; only the labeling changed to indicate that the particular level 
had progressed through more testing.  Your suggestion causes no end of 
confusion, since there will be flavors of 6.0.0 running around with different 
content.

 Again, this is partly because I feel a certain sense of order which
 requires releases to be X.0.0.

That makes absolutely no sense to me.

 My original question was sparked by the fact that 7.0.2 was released
 which would, merely by the version number, indicate to me that it was a
 stable bugfix release to the 7.0 line.

7.0.2 never got out of beta, nor did any of its 7.0.x predecessors.  Why would 
you think it's stable?

 downloading the highest version number available
 (7.0.2) might not be such a good idea.

A version won't make it into the archives unless it's alpha, beta, or stable - 
and it will be marked as such, so you have a pretty good idea of how well it's 
been exercised.  If you're looking at SVN, you're on your own.

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


How to configure different default webapp in function of requested hostname on one tomcat server

2010-08-25 Thread arnaud icard

Hello,

I guess my subject isn't clear at all so here is my problem :

I have 1 server with Apache2/Tomcat6 installed.
The purpose of this server is to host multiple webapps (this one for 
instance : http://www.jasig.org/cas)

For each of these webapps, we will contact the server with different urls :

   * cas.domain.fr for the CAS webapp
   * ent.domain.fr for the ENT webapp
   * appli1.domain.fr for the appli1 webapp

How can I do such a thing ?

Until now, I have created a virtual host in Apache with this configuration :

   VirtualHost *:80
JkMount /* default

ServerName appli1.domain.fr
ServerAdmin webmas...@domain.fr

DocumentRoot /opt/tomcat/webapps/appli1

ErrorLog /var/www/appli1.domain.fr/logs/error.log
CustomLog /var/www/appli1.domain.fr/logs/access.log common

   directory /opt/tomcat/webapps/appli1
Options -Indexes
   /directory
   /VirtualHost


However,when accessing to http://appli1.domain.fr, I am always 
redirected to the ROOT pages and not the appli1.


I hope to be as clear as possible!

Would you have some simple and elegant solution?

Best regards,
arnaud

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

Re: How to configure different default webapp in function of requested hostname on one tomcat server

2010-08-25 Thread Wesley Acheson
Hi,

You can configure the host element as per
http://tomcat.apache.org/tomcat-6.0-doc/config/host.html


On Wed, Aug 25, 2010 at 6:13 PM, arnaud icard
arnaud.ic...@univ-avignon.fr wrote:
 Hello,

 I guess my subject isn't clear at all so here is my problem :

 I have 1 server with Apache2/Tomcat6 installed.
 The purpose of this server is to host multiple webapps (this one for
 instance : http://www.jasig.org/cas)
 For each of these webapps, we will contact the server with different urls :

 cas.domain.fr for the CAS webapp
 ent.domain.fr for the ENT webapp
 appli1.domain.fr for the appli1 webapp

 How can I do such a thing ?

 Until now, I have created a virtual host in Apache with this configuration :

 VirtualHost *:80
     JkMount /* default

     ServerName appli1.domain.fr
     ServerAdmin webmas...@domain.fr

     DocumentRoot /opt/tomcat/webapps/appli1

     ErrorLog /var/www/appli1.domain.fr/logs/error.log
     CustomLog /var/www/appli1.domain.fr/logs/access.log common

     directory /opt/tomcat/webapps/appli1
     Options -Indexes
     /directory
 /VirtualHost

 However,when accessing to http://appli1.domain.fr, I am always redirected to
 the ROOT pages and not the appli1.

 I hope to be as clear as possible!

 Would you have some simple and elegant solution?

 Best regards,
 arnaud


 -
 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: How to configure different default webapp in function of requested hostname on one tomcat server

2010-08-25 Thread Caldarale, Charles R
 From: Wesley Acheson [mailto:wesley.ache...@gmail.com] 
 Subject: Re: How to configure different default webapp in function of 
 requested hostname on one tomcat server

 You can configure the host element as per
 http://tomcat.apache.org/tomcat-6.0-doc/config/host.html

Also look at:
http://wiki.apache.org/tomcat/TomcatDevelopmentVirtualHosts

(Don't be scared off by the use of the word development in the above.)

 - 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: How to configure different default webapp in function of requested hostname on one tomcat server

2010-08-25 Thread Hassan Schroeder
On Wed, Aug 25, 2010 at 9:13 AM, arnaud icard
arnaud.ic...@univ-avignon.fr wrote:

 The purpose of this server is to host multiple webapps (this one for
 instance : http://www.jasig.org/cas)
 For each of these webapps, we will contact the server with different urls :

 cas.domain.fr for the CAS webapp
 ent.domain.fr for the ENT webapp
 appli1.domain.fr for the appli1 webapp

 How can I do such a thing ?

Configure a Host element in server.xml for each of the above with
its own unique appBase, and make your app (e.g. CAS) the ROOT
webapp for that host.

Done.

If you really need Apache httpd for something else, then adjust your
forwarding appropriately. Otherwise you can remove it.

HTH,
-- 
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

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



tomcat 5

2010-08-25 Thread Wesley Acheson
Hi,

Is the 5.5 branch actively maintained? Or is it all tc6 now? Just wondering.

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



Re: tomcat 5

2010-08-25 Thread Mark Thomas
On 25/08/2010 18:39, Wesley Acheson wrote:
 Hi,
 
 Is the 5.5 branch actively maintained? Or is it all tc6 now? Just wondering.

http://wiki.apache.org/tomcat/TomcatVersions

Mark



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



Re: Tomcat Version Numbers

2010-08-25 Thread Mark Thomas
On 25/08/2010 16:23, Christopher Schultz wrote:

 For those who never read http://tomcat.apache.org/whichversion.html, or
 don't understand it (btw: that page says 7.0.0 is the current version of
 the 7.0.x versions), downloading the highest version number available
 (7.0.2) might not be such a good idea.

My bad. I missed updating that page when I released 7.0.2. I've fixed it
and it should sync to the live servers in an hour or so.

Mark



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



Re: Tomcat ISAPI Redirector for IIS

2010-08-25 Thread andoridyou2010

check the fitler vs extension

here is one post
http://androidyou.blogspot.com/2010/08/could-not-get-worker-for-name-ajp13.html


doepain wrote:
 
 No matter what I try where I go I just keep hitting a wall with this ISAPI
 redirector for IIS/Tomcat.
 I have been trying to get this to work since 9:00 AM est, and I am losing
 steam.  
 
 I tried supplying any useful information for trouble shooting below
 
 Error:
 HTTP Status 404 - /jakarta/isapi_redirect.dll
   type Status report
   message /jakarta/isapi_redirect.dll
   description The requested resource (/jakarta/isapi_redirect.dll) is not
 available.
 Apache Tomcat/5.0.16
 
 uriworkermap.properties File:
 # uriworker.properties -
 #
 # This file provides sample mappings for example
 # ajp13w worker defined in workermap.properties.minimal
 
 /jsp-examples/*=ajp13w
 /servlet-examples/*=ajp13w
 
 # Now filter out all .jpeg files inside that context
 # For no mapping the url has to start with exclamation (!)
 #!/servlet-examples/*.jpeg=ajp13w
 
 Workers.Properties.Minimal:
 # workers.properties.minimal -
 # This file provides minimal jk configuration properties needed to 
 # connect to Tomcat.
 # The workers that jk should create and work with 
 # Defining a worker named ajp13w and of type ajp13
 # Note that the name and the type do not have to match.
 
 #worker.list=ajp13w
 worker.ajp13w.type=ajp13
 worker.ajp13w.host=localhost
 worker.ajp13w.port=8009
 
 Jakarta Isapi Redirector Install path:
 C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector\conf
 
 Tomcat Install Path:
 C:\Program Files\Apache Software Foundation\Tomcat 5.0
 
 Tomcat Status is Started.
 
 IIS V6.0 Settings
 The jakarta Web Service Extension is Installed, and Allowed.
 The ISAPI Filter for jakarta in installed, and its Status is Online
 Priority High
 
 Host:
 Windows Server 2003 SP2
 
 ISAPI-Redirector Log output:
 [Mon Feb 18 13:11:38 2008] [error] HttpExtensionProc::jk_isapi_plugin.c
 (944): could not get a worker for name ajp13
 [Mon Feb 18 13:11:39 2008] [error] HttpExtensionProc::jk_isapi_plugin.c
 (944): could not get a worker for name ajp13
 [Mon Feb 18 13:21:47 2008] [error]
 ajp_connection_tcp_send_message::jk_ajp_common.c (902): sendfull returned
 -3 with errno=54 
 [Mon Feb 18 13:21:47 2008] [error] ajp_send_request::jk_ajp_common.c
 (1158): Error sending request try another pooled connection
 [Mon Feb 18 13:21:48 2008] [info]  jk_open_socket::jk_connect.c (183):
 connect() failed errno = 61
 [Mon Feb 18 13:21:48 2008] [info] 
 ajp_connect_to_endpoint::jk_ajp_common.c (862): Failed connecting to
 tomcat. Tomcat is probably not started or is listening on the wrong
 host/port (127.0.0.1:8009). Failed errno = 61
 [Mon Feb 18 13:21:48 2008] [info]  ajp_send_request::jk_ajp_common.c
 (1186): Error connecting to the Tomcat process.
 [Mon Feb 18 13:21:48 2008] [info]  ajp_service::jk_ajp_common.c (1665):
 Sending request to tomcat failed,  recoverable operation attempt=0
 [Mon Feb 18 13:21:48 2008] [info]  ajp_done::jk_ajp_common.c (1947): could
 not find empty cache slot from 1 for worker ajp13. Rise worker cachesize
 [Mon Feb 18 13:43:40 2008] [error]
 ajp_connection_tcp_send_message::jk_ajp_common.c (902): sendfull returned
 -3 with errno=54 
 [Mon Feb 18 13:43:40 2008] [error] ajp_send_request::jk_ajp_common.c
 (1158): Error sending request try another pooled connection
 [Mon Feb 18 13:43:41 2008] [info]  jk_open_socket::jk_connect.c (183):
 connect() failed errno = 61
 [Mon Feb 18 13:43:41 2008] [info] 
 ajp_connect_to_endpoint::jk_ajp_common.c (862): Failed connecting to
 tomcat. Tomcat is probably not started or is listening on the wrong
 host/port (127.0.0.1:8009). Failed errno = 61
 [Mon Feb 18 13:43:41 2008] [info]  ajp_send_request::jk_ajp_common.c
 (1186): Error connecting to the Tomcat process.
 [Mon Feb 18 13:43:41 2008] [info]  ajp_service::jk_ajp_common.c (1665):
 Sending request to tomcat failed,  recoverable operation attempt=0
 [Mon Feb 18 13:43:42 2008] [info]  jk_open_socket::jk_connect.c (183):
 connect() failed errno = 61
 [Mon Feb 18 13:43:42 2008] [info] 
 ajp_connect_to_endpoint::jk_ajp_common.c (862): Failed connecting to
 tomcat. Tomcat is probably not started or is listening on the wrong
 host/port (127.0.0.1:8009). Failed errno = 61
 [Mon Feb 18 13:43:42 2008] [info]  ajp_send_request::jk_ajp_common.c
 (1186): Error connecting to the Tomcat process.
 [Mon Feb 18 13:43:42 2008] [info]  ajp_service::jk_ajp_common.c (1665):
 Sending request to tomcat failed,  recoverable operation attempt=1
 [Mon Feb 18 13:43:43 2008] [info]  jk_open_socket::jk_connect.c (183):
 connect() failed errno = 61
 [Mon Feb 18 13:43:43 2008] [info] 
 ajp_connect_to_endpoint::jk_ajp_common.c (862): Failed connecting to
 tomcat. Tomcat is probably not started or is listening on the wrong
 host/port (127.0.0.1:8009). Failed errno = 61
 [Mon Feb 18 13:43:43 2008] [info]  ajp_send_request::jk_ajp_common.c
 (1186): Error connecting to the Tomcat 

Re: Tomcat ISAPI Redirector for IIS

2010-08-25 Thread andoridyou2010

http://androidyou.blogspot.com/2010/08/using-iis-7-75-tracing-features-to.html

andoridyou2010 wrote:
 
 check the fitler vs extension
 
 here is one post
 http://androidyou.blogspot.com/2010/08/could-not-get-worker-for-name-ajp13.html
 
 
 doepain wrote:
 
 No matter what I try where I go I just keep hitting a wall with this
 ISAPI redirector for IIS/Tomcat.
 I have been trying to get this to work since 9:00 AM est, and I am losing
 steam.  
 
 I tried supplying any useful information for trouble shooting below
 
 Error:
 HTTP Status 404 - /jakarta/isapi_redirect.dll
  type Status report
  message /jakarta/isapi_redirect.dll
  description The requested resource (/jakarta/isapi_redirect.dll) is not
 available.
 Apache Tomcat/5.0.16
 
 uriworkermap.properties File:
 # uriworker.properties -
 #
 # This file provides sample mappings for example
 # ajp13w worker defined in workermap.properties.minimal
 
 /jsp-examples/*=ajp13w
 /servlet-examples/*=ajp13w
 
 # Now filter out all .jpeg files inside that context
 # For no mapping the url has to start with exclamation (!)
 #!/servlet-examples/*.jpeg=ajp13w
 
 Workers.Properties.Minimal:
 # workers.properties.minimal -
 # This file provides minimal jk configuration properties needed to 
 # connect to Tomcat.
 # The workers that jk should create and work with 
 # Defining a worker named ajp13w and of type ajp13
 # Note that the name and the type do not have to match.
 
 #worker.list=ajp13w
 worker.ajp13w.type=ajp13
 worker.ajp13w.host=localhost
 worker.ajp13w.port=8009
 
 Jakarta Isapi Redirector Install path:
 C:\Program Files\Apache Software Foundation\Jakarta Isapi Redirector\conf
 
 Tomcat Install Path:
 C:\Program Files\Apache Software Foundation\Tomcat 5.0
 
 Tomcat Status is Started.
 
 IIS V6.0 Settings
 The jakarta Web Service Extension is Installed, and Allowed.
 The ISAPI Filter for jakarta in installed, and its Status is Online
 Priority High
 
 Host:
 Windows Server 2003 SP2
 
 ISAPI-Redirector Log output:
 [Mon Feb 18 13:11:38 2008] [error] HttpExtensionProc::jk_isapi_plugin.c
 (944): could not get a worker for name ajp13
 [Mon Feb 18 13:11:39 2008] [error] HttpExtensionProc::jk_isapi_plugin.c
 (944): could not get a worker for name ajp13
 [Mon Feb 18 13:21:47 2008] [error]
 ajp_connection_tcp_send_message::jk_ajp_common.c (902): sendfull returned
 -3 with errno=54 
 [Mon Feb 18 13:21:47 2008] [error] ajp_send_request::jk_ajp_common.c
 (1158): Error sending request try another pooled connection
 [Mon Feb 18 13:21:48 2008] [info]  jk_open_socket::jk_connect.c (183):
 connect() failed errno = 61
 [Mon Feb 18 13:21:48 2008] [info] 
 ajp_connect_to_endpoint::jk_ajp_common.c (862): Failed connecting to
 tomcat. Tomcat is probably not started or is listening on the wrong
 host/port (127.0.0.1:8009). Failed errno = 61
 [Mon Feb 18 13:21:48 2008] [info]  ajp_send_request::jk_ajp_common.c
 (1186): Error connecting to the Tomcat process.
 [Mon Feb 18 13:21:48 2008] [info]  ajp_service::jk_ajp_common.c (1665):
 Sending request to tomcat failed,  recoverable operation attempt=0
 [Mon Feb 18 13:21:48 2008] [info]  ajp_done::jk_ajp_common.c (1947):
 could not find empty cache slot from 1 for worker ajp13. Rise worker
 cachesize
 [Mon Feb 18 13:43:40 2008] [error]
 ajp_connection_tcp_send_message::jk_ajp_common.c (902): sendfull returned
 -3 with errno=54 
 [Mon Feb 18 13:43:40 2008] [error] ajp_send_request::jk_ajp_common.c
 (1158): Error sending request try another pooled connection
 [Mon Feb 18 13:43:41 2008] [info]  jk_open_socket::jk_connect.c (183):
 connect() failed errno = 61
 [Mon Feb 18 13:43:41 2008] [info] 
 ajp_connect_to_endpoint::jk_ajp_common.c (862): Failed connecting to
 tomcat. Tomcat is probably not started or is listening on the wrong
 host/port (127.0.0.1:8009). Failed errno = 61
 [Mon Feb 18 13:43:41 2008] [info]  ajp_send_request::jk_ajp_common.c
 (1186): Error connecting to the Tomcat process.
 [Mon Feb 18 13:43:41 2008] [info]  ajp_service::jk_ajp_common.c (1665):
 Sending request to tomcat failed,  recoverable operation attempt=0
 [Mon Feb 18 13:43:42 2008] [info]  jk_open_socket::jk_connect.c (183):
 connect() failed errno = 61
 [Mon Feb 18 13:43:42 2008] [info] 
 ajp_connect_to_endpoint::jk_ajp_common.c (862): Failed connecting to
 tomcat. Tomcat is probably not started or is listening on the wrong
 host/port (127.0.0.1:8009). Failed errno = 61
 [Mon Feb 18 13:43:42 2008] [info]  ajp_send_request::jk_ajp_common.c
 (1186): Error connecting to the Tomcat process.
 [Mon Feb 18 13:43:42 2008] [info]  ajp_service::jk_ajp_common.c (1665):
 Sending request to tomcat failed,  recoverable operation attempt=1
 [Mon Feb 18 13:43:43 2008] [info]  jk_open_socket::jk_connect.c (183):
 connect() failed errno = 61
 [Mon Feb 18 13:43:43 2008] [info] 
 ajp_connect_to_endpoint::jk_ajp_common.c (862): Failed connecting to
 tomcat. Tomcat is probably not started or is listening on the wrong
 host/port (127.0.0.1:8009). Failed errno = 61
 [Mon 

Re: Feedback Requested: Proposed CLI Tool for Apache Tomcat; kitty.

2010-08-25 Thread Mark Thomas
On 19/08/2010 16:13, Jim Jagielski wrote:
 Any interest in the code moving to the ASF incubator?

+1 Incubator sounds like the right place to me.

Mark

 
 On Aug 16, 2010, at 4:06 PM, Networked wrote:
 
 Elevator pitch

 Myself and Peary Chiu have created a lightweight utility for
 administering Tomcat from the command line in our copious amounts of
 free time on the weekends.
 This is a very rough utility, but we wanted a command line
 administration utility that made it very easy and quick to debug a
 Tomcat server via JMX.

 We are looking to solicit feedback from the community on this utility.
 Really it could be used for any application server, but because of
 Tomcat's relevance and our familiarity with it, we prefer to offer to
 this audience.

 The reason we are creating this utility is because we didn't feel that
 jconsole or other utilities such as jmxsh were not swift enough or
 user friendly enough for troubleshooting Tomcat in a production
 environment. We have nothing against these projects, we just had a
 different preference for this tool.

 Needs to be improved

 We are aware that it needs some features, such as:
 - #1 Documentation
 - Easier navigation
 - Bash-style auto completion (if accomplished, could also benefit the
 Jython project)
 - Compile Jython code to Java classes

 We are working on getting these problems addressed.

 To our knowledge it works without issue with Jython 2.5.1+.
 (http://sourceforge.net/projects/jython/files/)

 What we'd appreciate

 Feel free to reply back with bugs and enhancement requests.
 We believe this will eventually be a useful, lightweight
 administration utility for Tomcat.
 We believe that by putting this out to the community early, we can
 address the needs of the community for such a utility, if at all, and
 have the community give some feedback on their general thoughts on the
 project.

 Fin
 Code is available at: http://github.com/msacks/kitty

 Thanks for your friendly replies,
 Matthew Sacks

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

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




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



RE: Deploying a war to the root URL path

2010-08-25 Thread Jeffrey Janner
Quite right.  I'd skipped over that little throwaway line in his initial post.

 -Original Message-
 From: Christopher Schultz [mailto:ch...@christopherschultz.net]
 Sent: Wednesday, August 25, 2010 8:35 AM
 To: Tomcat Users List
 Subject: Re: Deploying a war to the root URL path
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Jeffrey,
 
 On 8/23/2010 12:56 PM, Jeffrey Janner wrote:
  Also, I'm surprised no one offered the obvious tuckey redirector
  solution, which usually gets brought up a lot on this list.
  You can always deploy your jira.war as normal, but also create a
  ROOT.war that contains the tuckey redirector configured to redirect
 ALL
  requests to insert /jira after the hostname of every request.  This
  will add a little overhead, but probably only on the initial
  http://hostname request.
 
 Since the OP is using Apache httpd with AJP (didn't specifiy mod_jk or
 mod_proxy_ajp), he could also rewrite the URLs on the fly in the httpd
 world and still deploy to /jira in Tomcat.
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iEYEARECAAYFAkx1HAAACgkQ9CaO5/Lv0PAgwgCgo75dx3C155bAzZqwiMPKV1PR
 quMAnjXR7bpVofvBl0xSX+SRd1Aax14m
 =9+6f
 -END PGP SIGNATURE-
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 

__

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

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


Re: Session problem

2010-08-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hisham,

On 8/25/2010 11:07 AM, Hisham wrote:
 Let me rephrase what I said: I am not using any custom cookies, the
 JsessionID cookie gets created by default.

That makes a lot more sense.

 So i created an HttpSessionAttributeListener listener.  And what i
 observed is truly weird.  Once i click on Messages tab, the request
 goes through fine, there are a couple of images that are requested
 that are delivered correctly.  After all this has finished, 2 of the
 attributes i have stored in the session are removed.  Mind you, i have
 more attributes that DON'T get removed.  I did a complete hack that IF
 these other attributes are still present then go ahead and put the 2
 attributes back into the session - and it works fine now!

Er, that will sort of subvert your own authorization mechanism, right?

In your listener, why don't you dump a stack trace when a session
attribute is removed? That will let you know where the code is that is
removing your attributes. You may be surprised.

 Of course i'm not gonna leave it like this, i still need to figure out
 what the hell is going on!  Here is my filter code:
 
   public void doFilter(ServletRequest request, ServletResponse
 response, FilterChain chain) throws IOException, ServletException {
   boolean authorized = false;
   
   HttpServletRequest req = (HttpServletRequest)request;
   HttpServletResponse res = (HttpServletResponse)response;
   HttpSession session = req.getSession(false);
   
System.out.println(req.getRequestURL());
 
   if (session != null  session.getAttribute(ub) != null)) {
   
   authorized = true;
   System.out.println(setting authorized = true);
   chain.doFilter(request, response);
   }   
 
   // forward the request to login page
   if (!authorized) {  
   System.out.println(kicked someone from 
 +request.getRemoteAddr()); 
   res.setHeader(session, invalid);
   res.sendError(HttpServletResponse.SC_UNAUTHORIZED, 
 Your session is
 invalid or have expired.);
   }
   }

Aside from the odd logic above, this looks okay, except, I don't see a
redirect to a login form anywhere, here. You also didn't say what the
URL mapping was for this filter was. Is it /*? If so, then you'll
probably not be able to serve your login page unless you're logged-in.

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

iEYEARECAAYFAkx1Zg8ACgkQ9CaO5/Lv0PA6HACcDuDEppOaVSyuDrvYqjB68uD5
Em4AnjyHmIRgcO5ncOAV22CkAPOy18Vp
=SOPc
-END PGP SIGNATURE-

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



Re: Tomcat Version Numbers

2010-08-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

On 8/25/2010 11:15 AM, Caldarale, Charles R wrote:
 From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
 Subject: Re: Tomcat Version Numbers
 
 why not have a tag progression that looks like this:
 
 6.0.0-alpha
 6.0.0-beta1
 6.0.0-beta2
 
 Because there are no changes to an x.y.z level, regardless of how its marking 
 progresses.  _Any_ changes require a new dot number.  The 6.0.0-alpha and 
 6.0.0 are identical; only the labeling changed to indicate that the 
 particular level had progressed through more testing.  Your suggestion causes 
 no end of confusion, since there will be flavors of 6.0.0 running around with 
 different content.

Okay. Does that mean that:

[DIR] v6.0.2-alpha/   2006-11-16 00:02-
[DIR] v6.0.2-beta/2006-11-16 00:02-
[DIR] v6.0.2/ 2006-11-16 00:02-

...means that 6.0.2, 6.0.2-alpha, and 6.0.2-beta are all the exact same
sets of files, just with different tag names?

 Again, this is partly because I feel a certain sense of order which
 requires releases to be X.0.0.
 
 That makes absolutely no sense to me.

*shrug*

 My original question was sparked by the fact that 7.0.2 was released
 which would, merely by the version number, indicate to me that it was a
 stable bugfix release to the 7.0 line.
 
 7.0.2 never got out of beta, nor did any of its 7.0.x predecessors.  Why 
 would you think it's stable?
 
 downloading the highest version number available
 (7.0.2) might not be such a good idea.
 
 A version won't make it into the archives unless it's alpha, beta, or stable 
 - and it will be marked as such, so you have a pretty good idea of how well 
 it's been exercised.  If you're looking at SVN, you're on your own.

I can download 7.0.2 today (without fiddling with SVN) by going to
http://tomcat.apache.org/download-70.cgi (no warning about it's
beta-ness before you get to this page) and then the only place on the
page where you might get the idea that this isn't ready for production
is the word BETA in the title of the release section. It's quite easy
to miss.

(Note that this isn't a proper title, even: it's an a within a font
within a td and therefore has no structural significance to the page.
But that's a completely separate issue.)

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

iEYEARECAAYFAkx1Z4UACgkQ9CaO5/Lv0PDNawCeJEJbgyF9fQjYDKlm9R2FRhDO
HG8Amwe1/EPaEmaA595PLjfmaeS8B9t7
=iNxE
-END PGP SIGNATURE-

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



Re: Apache Tomcat 5.5.0 issue - SEVERE: All threads (200) are currently busy, waiting. Increase maxThreads

2010-08-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Scott,

On 8/24/2010 12:12 PM, Scott Hamilton wrote:
 You've got two connectors in that server.xml, and one of them is AJP
 without any real other configuration parameters.  If memory serves the
 thread limit when not specified for a connector is 200...

+1

 Can we assume you're using apache as a web server connecting to tomcat?

Yeah, he said that in his original original post.

 What are you using there - mod_proxy_ajp?  Mod_jk?  What do the settings
 for that look like?

Still waiting on that information.

Also, if the OP is still using 5.5.0, it's really time to upgrade to 5.5.30.

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

iEYEARECAAYFAkx1aIYACgkQ9CaO5/Lv0PChmwCdFwQ6er/fHTlqh/cWJO1iFL2B
eokAoKXrouSEhmYX2xBtN3PdipZiXSl1
=oDcC
-END PGP SIGNATURE-

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



Re: separating deployment of classes/lib/config from web content (jsp's/html)

2010-08-25 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jason,

On 8/24/2010 2:38 PM, Jason Britton wrote:


 The short answer is: you can't separate the components of a webapp out
 into separate locations.


 
 Thanks for the response P.  Understood and agreed as to the function and
 purpose of .war file.  The reasoning for the separation is that in our
 current environment we have users from 3 or so other departments accustomed
 to being able to drag html and jsp files up to our web server (good bad or
 otherwise).  With a change to tomcat as our app server, I could provide that
 same sort of access where jsp and html docs are just moved into the docBase
 directory at will by multiple individuals, but I would never be able to
 undeploy that directory without fear of losing all the jsp and html files
 they may have tossed in there.

This sounds completely insane.

You have developers changing things in a whim and no record of the
changes they're making? Consider using a revision-tracking system for
this sort of thing. There are at least two quite popular free ones: CVS
and Subversion.

Once you have a revision-tracking system, you can pull the current
version from the repository and nobody has to do any copying of files
into a shared location. This is generally known as a nightly build.
Each dev works separately, and the nightly build has everything that's
been committed to the revision-tracking repository.

 I would have to resort to hand copying in
 class file/config and lib changes into the WEB-INF so as not to risk losing
 any content files on a redeployment.

This also sounds completely insane.

You need to have a sane deployment process. Generally, when developing a
web application, you can feel free to have all your .java files, .jsps,
static content, etc. scattered all over the place. Once it's time to
deploy, though, it's time to sew everything up into a WAR (whether it's
actually a .war file or just on the disk with the same directory/file
structure). I highly recommend using Apache ant for this sort of thing:
there's a war command that you can use where you can specify all the
places where source files should come from. Boom: instant .war file.

 We rigged our current application server (Oracle OAS 10.1.3.4) to allow this
 separation of content from configuration/classes/lib but that is neither
 here nor there.

Exactly. That is completely independent of the servlet specification,
and therefore vendor-specific.

I'd be happy to share some ant scripts and suggestions for development
directory structure if you'd like.

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

iEYEARECAAYFAkx1ai0ACgkQ9CaO5/Lv0PDpgACgxEoUknZR9Tp7MqV+p+xcmJ5V
fLkAn2iscxe2UzZGQP8IFBfK8gzped9J
=oE8j
-END PGP SIGNATURE-

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



RE: Tomcat Version Numbers

2010-08-25 Thread Caldarale, Charles R
 From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
 Subject: Re: Tomcat Version Numbers

 Okay. Does that mean that:
 [DIR] v6.0.2-alpha/   2006-11-16 00:02-
 [DIR] v6.0.2-beta/2006-11-16 00:02-
 [DIR] v6.0.2/ 2006-11-16 00:02-

 ...means that 6.0.2, 6.0.2-alpha, and 6.0.2-beta are all the 
 exact same sets of files, just with different tag names?

Exactly.

 I can download 7.0.2 today (without fiddling with SVN) by going to
 http://tomcat.apache.org/download-70.cgi (no warning about it's
 beta-ness before you get to this page)

Actually, there is warning: on the Tomcat home page, under Tomcat 7.0.2 
Released, it says:

The Apache Tomcat Project is proud to announce the release of version 7.0.2 
beta...

It's also noted prominently on the Which version? page, which also contains 
the definition of alpha/beta/stable in the Tomcat context.

 the only place on the page where you might get the idea that 
 this isn't ready for production is the word BETA in the title
 of the release section. It's quite easy to miss.

How would you propose highlighting it?

 (Note that this isn't a proper title, even: it's an a within 
 a font within a td

No, that's just the anchor; the text displayed comes from strong7.0.2 
BETA/strong (still within the font, as it should be).

 - 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 Version Numbers

2010-08-25 Thread Rainer Jung

On 25.08.2010 20:57, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chuck,

On 8/25/2010 11:15 AM, Caldarale, Charles R wrote:

From: Christopher Schultz [mailto:ch...@christopherschultz.net]
Subject: Re: Tomcat Version Numbers



why not have a tag progression that looks like this:



6.0.0-alpha
6.0.0-beta1
6.0.0-beta2


Because there are no changes to an x.y.z level, regardless of how its marking 
progresses.  _Any_ changes require a new dot number.  The 6.0.0-alpha and 6.0.0 
are identical; only the labeling changed to indicate that the particular level 
had progressed through more testing.  Your suggestion causes no end of 
confusion, since there will be flavors of 6.0.0 running around with different 
content.


Okay. Does that mean that:

[DIR] v6.0.2-alpha/   2006-11-16 00:02-
[DIR] v6.0.2-beta/2006-11-16 00:02-
[DIR] v6.0.2/ 2006-11-16 00:02-

...means that 6.0.2, 6.0.2-alpha, and 6.0.2-beta are all the exact same
sets of files, just with different tag names?


On the file system, the directories named *alpha and *beta are symlinks 
to the one without suffix.


Looking at the list archives I would say the RM found it easiest to 
always produce the directory without suffix and then add symlinks 
according to the release status.


From this digging into history I would say:

6.0.0: alpha
6.0.1: alpha
6.0.2: beta
6.0.4: alpha
6.0.6: alpha
6.0.7: beta
6.0.8: alpha
6.0.9: beta

Starting with 6.0.10: stable

And yes it is possible, that a release after a beta release is again 
alpha, or a release after stable is again beta incase there is a major 
regression. So the use of the terminology is slightly non-standard.


Regards,

Rainer


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



Re: separating deployment of classes/lib/config from web content (jsp's/html)

2010-08-25 Thread Jason Britton
:)  I got a good laugh out of your response Christopher and I
appreciate you taking the time to guide a possibly astray developer
but let me hopefully put your mind somewhat at ease in regards to our
development practices/environment.  Not claiming we have anything
resembling a perfect process either.  We have a separate department
that is more marketing/static content than it is anything, they'll put
their own stuff up on the website that for the most part is not under
revision control, but backed up and they each have their own local
copies, heavy dreamweaver users and we'll give them tag libraries to
use for some dynamic content here and there.  All our tag libraries,
main web workflows (ecommerce), search functionality, page templates
etc. are under revision control, we are happy subversion users after
escaping from starteam some time ago.  Our classes, web.xml, libs are
deployed in one war file for our main site, deployment configuration
*managed by JDeveloper project, I'm not proud of this but we are
migrating off of Oracle app server and I plan to take a look at
Eclipse for ide and change our project builds to use maven or ant.  We
have other traditional web apps whose content/config/classes/libs are
all traditionally packed up and deployed in a war.

As for my previous problem separating config/lib/classes from content.
 I ended up using a symlink on WEB-INF directory on ROOT context, I've
got app called foo, ROOT/WEB-INF is symlinked to FOO's WEB-INF
directory.  I can redeploy FOO and ROOT gets new config/classes/lib
via symlink and I don't have to worry about docBase of ROOT getting
undeployed.  Tried aliases context attribute in 7.0, just couldn't get
it to provide same separation symlink did, or I just wasn't using it
correctly.

Jason


 I would have to resort to hand copying in
 class file/config and lib changes into the WEB-INF so as not to risk losing
 any content files on a redeployment.

 This also sounds completely insane.

 You need to have a sane deployment process. Generally, when developing a
 web application, you can feel free to have all your .java files, .jsps,
 static content, etc. scattered all over the place. Once it's time to
 deploy, though, it's time to sew everything up into a WAR (whether it's
 actually a .war file or just on the disk with the same directory/file
 structure). I highly recommend using Apache ant for this sort of thing:
 there's a war command that you can use where you can specify all the
 places where source files should come from. Boom: instant .war file.


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



RE: java.net.BindException: Address already in use

2010-08-25 Thread Paul Bourget
I just started working with Tomcat so I don't know what script is used
to start it other than Catalina.sh (the start section pasted below the
command output).

It used to work but stopped working recently.  I did add a network
interface and change the default gateway to point to the new interface.
It is probably not related but, I also had a power outage.

[r...@localhost logs]# netstat -an | grep 8209
[r...@localhost logs]# netstat -an | grep 8606

[r...@localhost conf]# grep 8209 server.xml
Connector protocol=AJP/1.3 acceptCount=100 bufferSize=2048
connectionTimeout=5000 debug=0 disableUploadTimeout=false
enableLookups=false maxProcessors=75 minProcessors=1 port=8209
proxyPort=0 redirectPort=8643 scheme=http secure=false
tcpNoDelay=true useURIValidationHack=false
useBodyEncodingForURI=true URIEncoding=UTF-8/Connector

[r...@localhost conf]# grep 8606 server.xml
Server debug=0 port=8606 shutdown=SHUTDOWN

[r...@localhost conf]# dmesg | grep -i centos
Linux version 2.6.18-164.10.1.el5 (mockbu...@builder16.centos.org) (gcc
version 4.1.2 20080704 (Red Hat 4.1.2-46)) #1 SMP Thu Jan 7 20:00:41 EST
2010

[r...@localhost bin]# ./catalina.sh version
Using CATALINA_BASE:   /usr/local/netomat/tomcat
Using CATALINA_HOME:   /usr/local/netomat/tomcat
Using CATALINA_TMPDIR: /usr/local/netomat/tomcat/temp
Using JRE_HOME:   /usr/jdk1.5.0_17
Server version: Apache Tomcat/5.5.23
Server built:   Mar 5 2007 08:25:04
Server number:  5.5.23.0
OS Name:Linux
OS Version: 2.6.18-164.10.1.el5
Architecture:   i386
JVM Version:1.5.0_17-b04
JVM Vendor: Sun Microsystems Inc.
[r...@localhost bin]#


**From Catalina.sh
elif [ $1 = start ] ; then

  shift
  touch $CATALINA_BASE/logs/catalina.out
  if [ $1 = -security ] ; then
echo Using Security Manager
shift
$_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \
  -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS -classpath $CLASSPATH
\
  -Djava.security.manager \
  -Djava.security.policy==$CATALINA_BASE/conf/catalina.policy \
  -Dcatalina.base=$CATALINA_BASE \
  -Dcatalina.home=$CATALINA_HOME \
  -Djava.io.tmpdir=$CATALINA_TMPDIR \
  org.apache.catalina.startup.Bootstrap $@ start \
   $CATALINA_BASE/logs/catalina.out 21 

  if [ ! -z $CATALINA_PID ]; then
echo $!  $CATALINA_PID
  fi
  else
$_RUNJAVA $JAVA_OPTS $CATALINA_OPTS \
  -Djava.endorsed.dirs=$JAVA_ENDORSED_DIRS -classpath $CLASSPATH
\
  -Dcatalina.base=$CATALINA_BASE \
  -Dcatalina.home=$CATALINA_HOME \
  -Djava.io.tmpdir=$CATALINA_TMPDIR \
  org.apache.catalina.startup.Bootstrap $@ start \
   $CATALINA_BASE/logs/catalina.out 21 

  if [ ! -z $CATALINA_PID ]; then
echo $!  $CATALINA_PID
  fi
  fi

** end of snippet











Paul Bourget
Isabella Products
 

-Original Message-
From: peter.crowth...@googlemail.com
[mailto:peter.crowth...@googlemail.com] On Behalf Of Peter Crowther
Sent: Wednesday, August 25, 2010 10:26 AM
To: Tomcat Users List
Subject: Re: java.net.BindException: Address already in use

Well, the ports you're requesting are or have recently been in use.

Try:
netstat -an | grep 8209
... just in case someone's given the service a name in /etc/services.
Also
just check that you've not got the same number in two places in
conf/server.xml, for example as the shutdown port.  Finally, check none
of
your scripts are trying to start two instances of the same Tomcat at the
same time - it has happened!

If it's none of those, come back to us.  If you could give us details
about
your environment (OS version, Tomcat version, Java version) we'd be more
likely to give help that's specific to you.  I can see Tomcat 5.5.23 in
the
logs (why so old, by the way?) but have no idea about the others.

Finally, what's that Socks socket doing at shutdown?

- Peter

On 25 August 2010 15:17, Paul Bourget
paul.bour...@isabellaproducts.comwrote:

 I assumed that this indicates be a port conflict before I googled this
 problem.  Every solution I found said find and resolve the port
 conflict.  I cannot find the conflict.





 [r...@localhost logs]# netstat -a | grep 8209

 [r...@localhost logs]#



 [r...@localhost logs]# netstat -a | grep 8606

 [r...@localhost logs]#



 [r...@localhost logs]# ps -ef | egrep 'httpd | apache | tomcat |
 catalina'

 root  3036 1  0 Aug24 ?00:00:00 Xvnc :5 -desktop
 localhost.localdomain:5 (root) -httpd /usr/share/vnc/classes -auth
 /root/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 3 -rfbauth
 /root/.vnc/passwd -rfbport 5905 -pn





 Here's the log output



 [r...@localhost logs]# more catalina.2010-08-24.log

 Aug 24, 2010 1:51:16 PM org.apache.catalina.startup.Catalina load

 INFO: Initialization processed in 570 ms

 Aug 24, 2010 1:51:16 PM org.apache.catalina.core.StandardService start

 INFO: Starting service Tomcat-Standalone

 Aug 24, 2010 1:51:16 PM org.apache.catalina.core.StandardEngine start

 INFO: Starting Servlet Engine: Apache Tomcat/5.5.23

 Aug 24, 

Re: Mapping REST requests across multiple app contexts

2010-08-25 Thread Ken Fox
Charles Caldarale recommended UrlRewriteFilter and after experimenting with
it, I agree it's very nice: great performance, very flexible and handles
cross-context forwarding. The custom Valve option is still attractive
because it has slightly better performance, slightly better cross-context
support, and much simpler configuration--at the expense of generality of
course.

Can someone look at the following Valve logic and let me know if this is
safe on Tomcat 6? It has been working fine and is stable under load, but I'm
totally new to the Tomcat code base and would really appreciate another pair
of eyes. Thanks.


public class MapRESTRequest extends ValveBase {

public void invoke(Request request, Response response) {
if (/v1.equals(request.getContextPath())) {
// map the in-bound REST URI to the app handling it
String newRequestURI = /new-app/some/derived/uri;

org.apache.coyote.Request req = request.getCoyoteRequest();
req.requestURI().setString(newRequestURI);
req.decodedURI().setString(newRequestURI);

MessageBytes uriMB = MessageBytes.newInstance();
uriMB.duplicate(req.decodedURI());

MessageBytes hostMB = MessageBytes.newInstance();
hostMB.setString(request.getHost().getName());

MappingData mappingData = request.getMappingData();
mappingData.recycle();
request.getConnector().getMapper().map(hostMB, uriMB, mappingData);

request.setContext((Context) mappingData.context);
request.setWrapper((Wrapper) mappingData.wrapper);
}

getNext().invoke(request, response);
}


If anyone is interested in this, I can share the source. What I have allows
you to implement a REST resource name space as a collection of web apps (I
mainly use Jersey for the apps). The public URLs are mapped onto the web
apps however you want by configuring each app's web.xml. Here's a web.xml
fragment that shows the configuration (this servlet is only used for Valve
configuration; it doesn't handle any requests itself):


servlet
servlet-classcom.vulpes.tomcat.MapResources/servlet-class
load-on-startup2/load-on-startup
init-param
param-nameresourcePaths/param-name

param-value/game/**;/profile/*/tokens;/profile/*/awards/param-value
/init-param
/servlet


That mapping accepts request URLs like /v1/foo/bar/game/123 and forwards
them to /a-service/game/123.

Collisions between resources are resolved with deepest-match wins
(individual path elements are resolved with longest-match wins). A trie is
used for the mapping, so it is reasonably fast for large numbers of
patterns.

- Ken




On Sat, Aug 21, 2010 at 2:04 PM, Ken Fox k...@vulpes.com wrote:

 I'm looking for advice on the best way to map REST requests onto a
 collection of Tomcat apps all running in the same JVM. The REST name space
 was designed for client use and doesn't reflect how the apps implement it.
 For example, the resource /v1/x/123 is implemented by app X, but the
 resource /v1/x/123/y is implemented by app Y.

 A proxy (e.g. Apache mod_proxy or Squid) in front of Tomcat can rewrite the
 URLs to go to the correct app, but this gives us some pretty ugly proxy
 configurations which have to be kept in lock-step with the Tomcat apps.
 Relying on a proxy also makes it a bit harder to use Amazon's load balancer
 because it doesn't do rewrites (I think we'd have to run a proxy on each
 Tomcat instance).

 I'm trying to implement the rewrite as a Valve (code outline below)
 registered with the Engine which will run before any Hosts or Contexts. This
 seems like a good approach and may even let me grab the JAX-RS annotations
 from the apps to dynamically build the rewrite rules.

 Does anyone have advice for REST name spaces in Tomcat in general?

 Has anyone had good experiences with a rewrite proxy in front of Tomcat on
 Amazon EC2 with Amazon's ELB?

 Has anybody tried a rewrite Valve similar to this? It has to modify the
 CoyoteRequest and generate new Request.mappingData which seems kind of
 risky. (Though I think it will work in Tomcat 7, I've only tried Tomcat 6.)
 This is my favorite approach so far.

 Thanks,

 - Ken


 public void invoke(Request request, Response response) {
 if (/v1.equals(request.getContextPath())) {
 // map the in-bound REST URI to the app handling it
 String newRequestURI = /new-app/some/derived/uri;

 org.apache.coyote.Request req = request.getCoyoteRequest();
 req.requestURI().setString(newRequestURI);
 req.decodedURI().setString(newRequestURI);

 MessageBytes uriMB = MessageBytes.newInstance();
 uriMB.duplicate(req.decodedURI());

 MessageBytes hostMB = MessageBytes.newInstance();
 hostMB.setString(request.getHost().getName());

 MappingData mappingData = request.getMappingData();
 mappingData.recycle();
 request.getConnector().getMapper().map(hostMB, uriMB, mappingData);


Re: failed FORM authentication redirects to /j_security_check

2010-08-25 Thread Shaun Senecal
Thanks for the response Chris.

You're right.  Jetty does a redirect, so on the client-side the
browser sees /login.html?error=true.  Since this isn't happening in
Tomcat, I am unable to retrieve the query string client side.  As you
indicated my login page is static html and I am relying on client-side
processing to interpret the query string.  I ended up working around
the issue by creating a loginerror.html which is identical to
login.html except that I have added a hidden DIV to the
loginerror.html.  I can then search for the hidden DIV to determine if
there was a login failure or not.  Not pretty, but it works!


Thanks

Shaun


On Wed, Aug 25, 2010 at 10:17 PM, Christopher Schultz
ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Shaun,

 On 8/23/2010 4:56 AM, Shaun Senecal wrote:
 I'm using FORM authentication, and everything seems to be working
 (logins are accepted, etc), except when there was an error the URL
 changes in the users browser to point to j_security_check.

 This is expected.

 The
 contents of the redirect to j_security_check contains login.html, so
 the user is able to login as expected, but my error=true query
 string is not passed along.

 How are you checking? If you are forwarding to a .html page, you
 probably don't have any dynamic content in there, and therefore have no
 options for checking for things like request parameters.

 Is there something obvious I am doing
 wrong here?  I got it working under Jetty as a sanity test, but I need
 to get it working in Tomcat too...

 It's possible that Jetty performs a redirect (to login.html?error=true)
 during a failed login and Tomcat performs a forward, which is entirely
 server-side. The result is that the client never sees the error=true
 and therefore only server-side components will be able to see it.

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

 iEYEARECAAYFAkx1F/oACgkQ9CaO5/Lv0PBinQCfYr3S/2sEresGix7Qcd/waAow
 ltYAoIMMm/C9xFuMS5ixJ8jlsm1ensim
 =cFJK
 -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



pick load

2010-08-25 Thread Alexandre Chapellon
Hello,

I'm quite new to tomcat and have an old webapps running on tomcat 4.1
and jvm 1.4.2 with apach2.2 in front ofthem (using modjk).
I'm trying to get ready for a comming pick load I will have to face.
I Try to do some benchmark using ab and the jkstatus worker.
Whatever the configuration of my connecter (both on the apache or tomcat
side) I never go upper than 20 requests / second.
Here are few  parameters I changed in order to get better performances:

-Apache2 (worker):
increased ServerLimit (64), ThreadLimit (256), MaxClients (2048),
ThreadsPerChild (128)
set to a non zero value MaxRequestsPerChild (500)

- modjk (1.2.30):
set to non-zero value worker.selfcare.connection_pool_timeout=60

-Tomcat AJP13 Connector:
acceptCount=50 enableLookups=false maxProcessors=500
bufferSize=4096 socketBuffer=2

Unfortunately this doesn't help and am still stuck with 20req/s when the
machines' load is not that high and 60% of CPU at most is used during
stress test.
I've googled around but can't find anything else about increasing
performances of apache/tomcat... Help much appreciated

Regards

P.S: right now am using ab to send 2000 request with 50 concurrents.


Re: pick load

2010-08-25 Thread Domenico Briganti
Il giorno mer, 25/08/2010 alle 15.28 -1000, Alexandre Chapellon ha
scritto:
 P.S: right now am using ab to send 2000 request with 50 concurrents.

What is the report of ab?



Domenico


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