Tomcat 6 query

2012-11-02 Thread vicky007aggarwal
Team,

In tomcat 6.0 documentation , i didnt see any details for minSpareThreads  
maxSpareThreads

Does these 2 tags are not supported in tomcat 6.0

Thanks,
Vicky

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



Re: Tomcat 6 query

2012-11-02 Thread Mark Eggers

On 11/2/2012 12:25 AM, vicky007aggar...@yahoo.co.in wrote:

Team,

In tomcat 6.0 documentation , i didnt see any details for minSpareThreads  
maxSpareThreads

Does these 2 tags are not supported in tomcat 6.0

Thanks,
Vicky

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


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

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



Re: Tomcat 6 query

2012-11-02 Thread vicky007aggarwal
Thanks mark.

I concern why the  minSpareThreads  maxSpareThreads attributes dont exist 
at the below URL anymore

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

As in tomcat 5 , i am able to locate http connector

Thanks,
Vicky

Sent from my iPhone

On Nov 2, 2012, at 1:22 PM, Mark Eggers its_toas...@yahoo.com wrote:

 On 11/2/2012 12:25 AM, vicky007aggar...@yahoo.co.in wrote:
 Team,
 
 In tomcat 6.0 documentation , i didnt see any details for minSpareThreads 
  maxSpareThreads
 
 Does these 2 tags are not supported in tomcat 6.0
 
 Thanks,
 Vicky
 
 Sent from my iPhone
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 http://tomcat.apache.org/tomcat-6.0-doc/config/executor.html
 
 -
 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



CSRF on multiple tomcat instances

2012-11-02 Thread Wilfred Duizers
Hello,

I am running 2 Tomcat instances on 1 server. So far nothing special :-)
Both:
Apache Tomcat/7.0.25
JVM 1.6.0_20-b02

When a user clicks a link in the webapplication running on Tomcat instance 1 
(portal) an application running on Tomcat instance 2 is opened. Is it possible 
to send the nonce with the link? Because it's running another instance.

Kind regards,
Wilfred


Re: Comma related bug in org.apache.catalina.valves.RemoteIpValve

2012-11-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

André,

On 10/31/12 4:25 PM, André Warnier wrote:
 We'll probably end up with something like
 tagregex1,regex2,.../tag. Or a single regex, with |
 between the alternatives (which could be a workaround for you now,
 I guess).

A single regex with multiple alternatives is the proper way to do
this, but the Tomcat documentation offers an example which simply does
not work, so something needs to be fixed.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCT6cUACgkQ9CaO5/Lv0PA+qACdFFy5++Kn7nEhqIDdXKCPVifN
7F0AoLSBI8ZWGSx3phuydo+IglHpt0ah
=bO8e
-END PGP SIGNATURE-

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



Re: Redirecting from unprotected resource to a protected one

2012-11-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Lyallex,

On 11/2/12 9:43 AM, Lyallex wrote:
 When I have validated the data I want to forward to a protected
 resource like this
 
 forwardTarget = /account/accountView.jsp;
 
 RequestDispatcher rd = 
 getServletContext().getRequestDispatcher(forwardTarget); 
 rd.forward(request, response);
 
 What I was hoping would happen is that the user would be required
 to login but we get to the protected resource without the login
 screen appearing. I realise that I am forwarding an existing
 (unauthenticated) request
 
 I could simply redirect to an 'account created log in now page' but
 that's a bit naff.

The problem is that you are doing a forward and not a redirect.

 Is it possible to redirect to a protected resource from an
 unprotected one ?

Yes, but you have to actually do a redirect. Using forward allows
you to bypass security constraints.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCT8yIACgkQ9CaO5/Lv0PD34gCgssVhb7VtGtS+GFaDQ/lYkO/6
hsUAoL43K5N4d87hx4zZG/twED9hJhaC
=HWNf
-END PGP SIGNATURE-

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



RE: Comma related bug in org.apache.catalina.valves.RemoteIpValve

2012-11-02 Thread Simon Dean
 -Original Message-
 From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
 Sent: 31 October 2012 20:35
 To: Tomcat Users List
 Subject: RE: Comma related bug in
 org.apache.catalina.valves.RemoteIpValve
 
  From: André Warnier [mailto:a...@ice-sa.com]
  Subject: Re: Comma related bug in
  org.apache.catalina.valves.RemoteIpValve
 
  We'll probably end up with something like
 tagregex1,regex2,.../tag.
  Or a single regex, with | between the alternatives (which could be a
  workaround for you now, I guess).
 
 I have a vague memory of a discussion on either the dev or users' list about
 simply removing the comma separation, and using just regex standard
 formats.  As I recall, the final resolution was to remove the comma
 separation in Tomcat 7, but keep it in 6 for compatibility - even if it is 
 broken
 and not completely resolvable.  If you look at the RemoteIpValve doc for 7,
 you'll see there's no mention of comma-separated regexes.

Yep.  Tomcat 7 is treating the values as whole regexes (taking advantage of 
regular expressions' logical OR operation - the pipe symbol).  

In Tomcat 6 though, there is a real bug with the current documentation and 
implementation. The documentation gives example values for internalProxies that 
have commas in the regex.  See 
http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Remote_IP_Valve and 
http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/valves/RemoteIpValve.html
Both specify the following as the default value for internalProxies: 

10\.\d{1,3}\.\d{1,3}\.\d{1,3}, 192\.168\.\d{1,3}\.\d{1,3}, 
169\.254\.\d{1,3}\.\d{1,3}, 127\.\d{1,3}\.\d{1,3}\.\d{1,3}

But that value won't work if you assigned it to internalProxies because it has 
commas in the {1,3} bit.  Worse still, the valve silently fails, giving no 
feedback that there's anything wrong.  

Quick remedies would be to change the code and documentation to use this as the 
default: 

10\.\d{1,3}\.\d+\.\d{1,3}, 192\.168\.\d+\.\d+, 169\.254\.\d+\.\d+, 
127\.\d+\.\d+\.\d+

Which replaces {1,3} with +.  

Also adding a warning about commas to the code and documentation would also go 
a long way.   

 
 The moral of the story: upgrade.

 
  - Chuck

-
The information contained in this message may be CONFIDENTIAL and is intended 
for the addressee only. Any unauthorised use, dissemination of the information, 
or copying of this message is prohibited. If you are not the addressee, please 
notify the sender immediately by return e-mail and delete this message. 
Although this e-mail and any attachments are believed to be free of any virus, 
or other defect which might affect any computer or system into which they are 
received and opened, it is the responsibility of the recipient to ensure that 
they are virus free and no responsibility is accepted by Moneysupermarket.com 
Financial Group Limited for any loss or damage from receipt or use thereof. 
The views expressed are of the individual, and do not necessarily reflect the 
views of Moneysupermarket.com Financial Group Limited.
Moneysupermarket.com Limited is an appointed representative of 
Moneysupermarket.com Financial Group Limited, which is authorised and regulated 
by the Financial Services Authority (FSA FRN 303190). 
Moneysupermarket.com Financial Group Limited, registered in England No. 
3157344. 
Registered Office: Moneysupermarket House, St. David’s Park, Ewloe, CH5 3UZ. 
Telephone 01244 665700.


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



Re: Redirecting from unprotected resource to a protected one

2012-11-02 Thread Lyallex
On 2 November 2012 16:21, Christopher Schultz
ch...@christopherschultz.netwrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Lyallex,

 On 11/2/12 9:43 AM, Lyallex wrote:
  When I have validated the data I want to forward to a protected
  resource like this
 
  forwardTarget = /account/accountView.jsp;


 The problem is that you are doing a forward and not a redirect.


Yea, well, that was easy wasn't it ;-)

Thanks for taking the time to reply

Much appreciated

Lyallex


Re: Tomcat 6 query

2012-11-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Vicky,

On 11/2/12 4:40 AM, vicky007aggar...@yahoo.co.in wrote:
 Thanks mark.
 
 I concern why the  minSpareThreads  maxSpareThreads attributes
 dont exist at the below URL anymore
 
 http://tomcat.apache.org/tomcat-6.0-doc/config/http.html
 
 As in tomcat 5 , i am able to locate http connector

This stuff isn't in the Connector anymore: it's in the Executor.
So, configure your Tomcat 6 connector to use an executor, then use
minSpareThreads on it. There is no maxSpareThreads anymore, only
maxThreads.

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

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCUBHMACgkQ9CaO5/Lv0PALtQCeJmGzxZFfbNKu3l5goWljXyef
hXIAn0u9w4kvW7nOhoGYJfszcHqRalJ8
=gIeT
-END PGP SIGNATURE-

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



Confused: IllegalStateException

2012-11-02 Thread Jonathan Rosenberg
Basics: Apache Tomcat/7.0.221.6.0_22-b04

I have a Grails app that I'm deploying to this Tomcat.  During the
deployment, I see the following in catalina.out:

Nov 2, 2012 2:25:18 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive Catalog##0025.war
log4j:WARN No appenders could be found for logger (net.bull.javamelody).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig
for more info.
Nov 2, 2012 2:25:41 PM org.apache.catalina.loader.WebappClassLoader loadClass
INFO: Illegal access: this web application instance has been stopped
already.  Could not load com.mysql.jdbc.SQLError.  The eventual
following stack trace is caused by an error thrown for debugging
purposes as well as to attempt to terminate the thread which caused
the illegal access, and has no functional impact.
java.lang.IllegalStateException
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1564)
at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3352)
at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1696)
at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4368)
at com.mysql.jdbc.ConnectionImpl.cleanup(ConnectionImpl.java:1361)
at com.mysql.jdbc.ConnectionImpl.finalize(ConnectionImpl.java:2729)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)

After this, the app seems to continue loading normally.  I have tried
this on 2 Linux boxes (same Tomcat  JVM).  I see this on both, but on
one of the boxes, the app behaves very strangely (causing an error I
haven't tracked down yet).  On the other box, it runs fine.

What is this message trying to tell me?  Is this a true indication of
an error?  Or is it just a warning I can ignore safely?

--
Jonathan Rosenberg
Founder   Executive Director
Tabby's Place, a Cat Sanctuary
http://www.tabbysplace.org/

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



Re: Confused: IllegalStateException

2012-11-02 Thread Daniel Mikusa
On Nov 2, 2012, at 2:36 PM, Jonathan Rosenberg wrote:

 Basics: Apache Tomcat/7.0.22  1.6.0_22-b04
 
 I have a Grails app that I'm deploying to this Tomcat.  

How are you deploying the  application?  What are the exact steps that you are 
taking?

Dan

 During the
 deployment, I see the following in catalina.out:
 
 Nov 2, 2012 2:25:18 PM org.apache.catalina.startup.HostConfig deployWAR
 INFO: Deploying web application archive Catalog##0025.war
 log4j:WARN No appenders could be found for logger (net.bull.javamelody).
 log4j:WARN Please initialize the log4j system properly.
 log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig
 for more info.
 Nov 2, 2012 2:25:41 PM org.apache.catalina.loader.WebappClassLoader loadClass
 INFO: Illegal access: this web application instance has been stopped
 already.  Could not load com.mysql.jdbc.SQLError.  The eventual
 following stack trace is caused by an error thrown for debugging
 purposes as well as to attempt to terminate the thread which caused
 the illegal access, and has no functional impact.
 java.lang.IllegalStateException
at 
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1564)
at 
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3352)
at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1696)
at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4368)
at com.mysql.jdbc.ConnectionImpl.cleanup(ConnectionImpl.java:1361)
at com.mysql.jdbc.ConnectionImpl.finalize(ConnectionImpl.java:2729)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
 
 After this, the app seems to continue loading normally.  I have tried
 this on 2 Linux boxes (same Tomcat  JVM).  I see this on both, but on
 one of the boxes, the app behaves very strangely (causing an error I
 haven't tracked down yet).  On the other box, it runs fine.
 
 What is this message trying to tell me?  Is this a true indication of
 an error?  Or is it just a warning I can ignore safely?
 
 --
 Jonathan Rosenberg
 Founder   Executive Director
 Tabby's Place, a Cat Sanctuary
 http://www.tabbysplace.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: Confused: IllegalStateException

2012-11-02 Thread Jonathan Rosenberg
On Fri, Nov 2, 2012 at 3:03 PM, Daniel Mikusa dmik...@vmware.com wrote:
 On Nov 2, 2012, at 2:36 PM, Jonathan Rosenberg wrote:

 Basics: Apache Tomcat/7.0.22  1.6.0_22-b04

 I have a Grails app that I'm deploying to this Tomcat.

 How are you deploying the  application?  What are the exact steps that you 
 are taking?

I am using Tomcat's WAR upload and deploy (i.e., through manager app).

--
Jonathan Rosenberg
Founder   Executive Director
Tabby's Place, a Cat Sanctuary
http://www.tabbysplace.org/



 Dan

 During the
 deployment, I see the following in catalina.out:

 Nov 2, 2012 2:25:18 PM org.apache.catalina.startup.HostConfig deployWAR
 INFO: Deploying web application archive Catalog##0025.war
 log4j:WARN No appenders could be found for logger (net.bull.javamelody).
 log4j:WARN Please initialize the log4j system properly.
 log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig
 for more info.
 Nov 2, 2012 2:25:41 PM org.apache.catalina.loader.WebappClassLoader loadClass
 INFO: Illegal access: this web application instance has been stopped
 already.  Could not load com.mysql.jdbc.SQLError.  The eventual
 following stack trace is caused by an error thrown for debugging
 purposes as well as to attempt to terminate the thread which caused
 the illegal access, and has no functional impact.
 java.lang.IllegalStateException
at 
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1564)
at 
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3352)
at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1696)
at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4368)
at com.mysql.jdbc.ConnectionImpl.cleanup(ConnectionImpl.java:1361)
at com.mysql.jdbc.ConnectionImpl.finalize(ConnectionImpl.java:2729)
at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)

 After this, the app seems to continue loading normally.  I have tried
 this on 2 Linux boxes (same Tomcat  JVM).  I see this on both, but on
 one of the boxes, the app behaves very strangely (causing an error I
 haven't tracked down yet).  On the other box, it runs fine.

 What is this message trying to tell me?  Is this a true indication of
 an error?  Or is it just a warning I can ignore safely?

 --
 Jonathan Rosenberg
 Founder   Executive Director
 Tabby's Place, a Cat Sanctuary
 http://www.tabbysplace.org/

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



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


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



Re: Handling requests when under load - ACCEPT and RST vs non-ACCEPT

2012-11-02 Thread Asankha C. Perera

Hi Esmond

You are correct. As I recently found out Tomcat and Java is not causing 
this explicitly, as I first thought. So there is no 'bug' to be fixed.


But I believe there is an elegant way to refuse further connections when 
under load by turning off just the 'accepting' of new connections, and 
causing the client to see a 'connection refused' instead of allowing new 
connections, accepting requests and then resetting connections with a 
'connection reset', preventing the client from a clean failover for 
non-idempotent requests. Apache HttpComponents/NIO library already 
supports this, so its something that Tomcat too can support if the 
community thinks it would be useful.


cheers
asankha

--
Asankha C. Perera
AdroitLogic, http://adroitlogic.org

http://esbmagic.blogspot.com




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



Mystery migrating from tomcat 6 to 7

2012-11-02 Thread Fred Toth

Hi,

I've got a struts2/spring app that's been running under tomcat 6 with no 
problems.


I migrated it to 7 and I've hit a strange brick wall. On startup, the 
logs show the app deploying, absolutely normally with no errors at all.


However, when I try to hit any URL within the app's context, I get not 
found (404). Absolutely nothing in the logs.


I'm deploying by creating data.xml in conf/Catalina/localhost (in both 
6 an 7). The app itself is an expanded application on the file system 
(i.e. not a .war file).


Thus, the URLs should be /data/whatever, but somehow it appears that 
though the app deployed, the context is somehow wrong or broken.


Also, the manager app lists the application normally, shows it as 
running, shows it at the correct context, etc.


Anybody seen this? For reference, here's the content of data.xml, pretty 
simple:


?xml version='1.0' encoding='utf-8'?
Context docBase=/mnt/data_arch/DATA
allowLinking=true

/Context

Thanks,

Fred


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



Re: Mystery migrating from tomcat 6 to 7

2012-11-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Fred,

On 11/2/12 3:27 PM, Fred Toth wrote:
 I've got a struts2/spring app that's been running under tomcat 6
 with no problems.
 
 I migrated it to 7 and I've hit a strange brick wall. On startup,
 the logs show the app deploying, absolutely normally with no errors
 at all.
 
 However, when I try to hit any URL within the app's context, I get
 not found (404). Absolutely nothing in the logs.
 
 I'm deploying by creating data.xml in conf/Catalina/localhost (in
 both 6 an 7). The app itself is an expanded application on the file
 system (i.e. not a .war file).
 
 Thus, the URLs should be /data/whatever, but somehow it appears
 that though the app deployed, the context is somehow wrong or
 broken.
 
 Also, the manager app lists the application normally, shows it as 
 running, shows it at the correct context, etc.
 
 Anybody seen this? For reference, here's the content of data.xml,
 pretty simple:
 
 ?xml version='1.0' encoding='utf-8'? Context
 docBase=/mnt/data_arch/DATA allowLinking=true
 
 /Context

Something similar just happened to me a few minutes ago and it looks
like I didn't wait for the app to fully-deploy. I wasn't getting 404s,
though: I was getting long wait times for ultimately blank responses.

Are you sure the app completed deployment? There may be DNS resolution
or entropy-collection delays when starting-up.

Can you paste the whole catalina.out you have after you launch Tomcat?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCUIowACgkQ9CaO5/Lv0PBTowCeOojUpfud072CrPrKz5ZcNL5M
bSkAnRpfIxicYa26lqcQ/bp8H8ldY4Nd
=qTJo
-END PGP SIGNATURE-

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



Re: Handling requests when under load - ACCEPT and RST vs non-ACCEPT

2012-11-02 Thread Mark Thomas
On 02/11/2012 19:13, Asankha C. Perera wrote:
 Hi Esmond
 
 You are correct. As I recently found out Tomcat and Java is not causing
 this explicitly, as I first thought. So there is no 'bug' to be fixed.
 
 But I believe there is an elegant way to refuse further connections when
 under load by turning off just the 'accepting' of new connections, and
 causing the client to see a 'connection refused' instead of allowing new
 connections, accepting requests and then resetting connections with a
 'connection reset', preventing the client from a clean failover for
 non-idempotent requests. Apache HttpComponents/NIO library already
 supports this, so its something that Tomcat too can support if the
 community thinks it would be useful.

Or you could just read the configuration documentation for the
connector. Hint: acceptCount - and it has been there since at least
Tomcat 4.

Mark

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



Re: Mystery migrating from tomcat 6 to 7

2012-11-02 Thread Fred Toth

Hi,

Well, let me post at least the last bit (the whole thing is noisy and 
long). See below for the indication of a normal startup. In particular, 
my app finishes startup with initialized Struts-Spring integration 
successfully and tomcat indicates it's done with Server startup in 
7487 ms.


Also, no amount of waiting changes behavior. Again, when I get my 404 
errors, I get nothing in catalina.out, as if to say tomcat isn't even 
seeing the request as an error.


(Note also that I'm running on port 80 temporarily while debugging.)

Thanks,

Fred

14:31:04,643  INFO StrutsSpringObjectFactory:42 - ... initialized 
Struts-Spring integration successfully
Nov 2, 2012 2:31:05 PM org.apache.catalina.startup.HostConfig 
deployDirectory
INFO: Deploying web application directory 
/usr/local/aapg/archive-server/apache-tomcat-7.0.32/webapps/manager
Nov 2, 2012 2:31:05 PM org.apache.catalina.startup.HostConfig 
deployDirectory
INFO: Deploying web application directory 
/usr/local/aapg/archive-server/apache-tomcat-7.0.32/webapps/examples
Nov 2, 2012 2:31:05 PM org.apache.catalina.startup.HostConfig 
deployDirectory
INFO: Deploying web application directory 
/usr/local/aapg/archive-server/apache-tomcat-7.0.32/webapps/host-manager
Nov 2, 2012 2:31:05 PM org.apache.catalina.startup.HostConfig 
deployDirectory
INFO: Deploying web application directory 
/usr/local/aapg/archive-server/apache-tomcat-7.0.32/webapps/docs
Nov 2, 2012 2:31:05 PM org.apache.catalina.startup.HostConfig 
deployDirectory
INFO: Deploying web application directory 
/usr/local/aapg/archive-server/apache-tomcat-7.0.32/webapps/ROOT

Nov 2, 2012 2:31:05 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [http-bio-80]
Nov 2, 2012 2:31:05 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler [ajp-bio-8009]
Nov 2, 2012 2:31:05 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 7487 ms

On 11/2/2012 3:44 PM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Fred,

On 11/2/12 3:27 PM, Fred Toth wrote:

I've got a struts2/spring app that's been running under tomcat 6
with no problems.

I migrated it to 7 and I've hit a strange brick wall. On startup,
the logs show the app deploying, absolutely normally with no errors
at all.

However, when I try to hit any URL within the app's context, I get
not found (404). Absolutely nothing in the logs.

I'm deploying by creating data.xml in conf/Catalina/localhost (in
both 6 an 7). The app itself is an expanded application on the file
system (i.e. not a .war file).

Thus, the URLs should be /data/whatever, but somehow it appears
that though the app deployed, the context is somehow wrong or
broken.

Also, the manager app lists the application normally, shows it as
running, shows it at the correct context, etc.

Anybody seen this? For reference, here's the content of data.xml,
pretty simple:

?xml version='1.0' encoding='utf-8'? Context
docBase=/mnt/data_arch/DATA allowLinking=true
/Context

Something similar just happened to me a few minutes ago and it looks
like I didn't wait for the app to fully-deploy. I wasn't getting 404s,
though: I was getting long wait times for ultimately blank responses.

Are you sure the app completed deployment? There may be DNS resolution
or entropy-collection delays when starting-up.

Can you paste the whole catalina.out you have after you launch Tomcat?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCUIowACgkQ9CaO5/Lv0PBTowCeOojUpfud072CrPrKz5ZcNL5M
bSkAnRpfIxicYa26lqcQ/bp8H8ldY4Nd
=qTJo
-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: Confused: IllegalStateException

2012-11-02 Thread Daniel Mikusa
On Nov 2, 2012, at 3:10 PM, Jonathan Rosenberg wrote:

 On Fri, Nov 2, 2012 at 3:03 PM, Daniel Mikusa dmik...@vmware.com wrote:
 On Nov 2, 2012, at 2:36 PM, Jonathan Rosenberg wrote:
 
 Basics: Apache Tomcat/7.0.22  1.6.0_22-b04
 
 I have a Grails app that I'm deploying to this Tomcat.
 
 How are you deploying the  application?  What are the exact steps that you 
 are taking?
 
 I am using Tomcat's WAR upload and deploy (i.e., through manager app).

Thought as much, thanks for confirming.

 Nov 2, 2012 2:25:41 PM org.apache.catalina.loader.WebappClassLoader 
 loadClass
 INFO: Illegal access: this web application instance has been stopped
 already.  Could not load com.mysql.jdbc.SQLError.  The eventual
 following stack trace is caused by an error thrown for debugging
 purposes as well as to attempt to terminate the thread which caused
 the illegal access, and has no functional impact.
 java.lang.IllegalStateException
   at 
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1564)
   at 
 org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
   at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3352)
   at com.mysql.jdbc.MysqlIO.quit(MysqlIO.java:1696)
   at com.mysql.jdbc.ConnectionImpl.realClose(ConnectionImpl.java:4368)
   at com.mysql.jdbc.ConnectionImpl.cleanup(ConnectionImpl.java:1361)
   at com.mysql.jdbc.ConnectionImpl.finalize(ConnectionImpl.java:2729)
   at java.lang.ref.Finalizer.invokeFinalizeMethod(Native Method)
   at java.lang.ref.Finalizer.runFinalizer(Finalizer.java:83)
   at java.lang.ref.Finalizer.access$100(Finalizer.java:14)
   at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:160)
 
 What is this message trying to tell me?  

This would seem to indicate that an application which has been stopped 
(possibly because it has been undeployed) is executing code that would require 
the web application's class loader to load a class (specifically the 
com.mysql.jdbc.SQLError class).  Since the application has already been 
stopped, the class loader associated with it is refusing to load the class.

Based on this, it would seem that you have the MySQL driver bundled with the 
application.  You might want to try moving this to the shared class loader 
(i.e. the lib folder).  I think that might clear up the message.


 Is this a true indication of an error?[1]  Or is it just a warning I can 
 ignore safely?[2]

The error message seems to answer these questions…

[1] - The eventual following stack trace is caused by an error thrown for 
debugging purposes as well as to attempt to terminate the thread which caused 
the illegal access,

[2] - and has no functional impact.

Hope that helps.

Dan



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



Re: Handling requests when under load - ACCEPT and RST vs non-ACCEPT

2012-11-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Mark,

On 11/2/12 3:51 PM, Mark Thomas wrote:
 On 02/11/2012 19:13, Asankha C. Perera wrote:
 Hi Esmond
 
 You are correct. As I recently found out Tomcat and Java is not
 causing this explicitly, as I first thought. So there is no 'bug'
 to be fixed.
 
 But I believe there is an elegant way to refuse further
 connections when under load by turning off just the 'accepting'
 of new connections, and causing the client to see a 'connection
 refused' instead of allowing new connections, accepting requests
 and then resetting connections with a 'connection reset',
 preventing the client from a clean failover for non-idempotent
 requests. Apache HttpComponents/NIO library already supports
 this, so its something that Tomcat too can support if the 
 community thinks it would be useful.
 
 Or you could just read the configuration documentation for the 
 connector. Hint: acceptCount - and it has been there since at
 least Tomcat 4.

That's kind of what I was thinking, but getting information from the
OP was like pulling teeth. I just gave up.

Note that his configuration *does* include an acceptCount which is
being changed from 1 to 1000. I think the problem is that the OS
might be a little fuzzy with that value.

If HttpComponents works as the OP expects, I wonder if he'd be willing
to give us the configuration he uses for *that*? Perhaps there is some
kind of TCP option that HttpComponents is using that Tomcat does not.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCULW0ACgkQ9CaO5/Lv0PATLwCfSsPoVeFJhguRkYwJwHr+s/xk
nSgAn0X1IUSwsH4DqKSMVjUo/g9jzvew
=myR3
-END PGP SIGNATURE-

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



Re: Mystery migrating from tomcat 6 to 7

2012-11-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Fred,

On 11/2/12 4:25 PM, Fred Toth wrote:
 Well, let me post at least the last bit (the whole thing is noisy
 and long). See below for the indication of a normal startup. In
 particular, my app finishes startup with initialized Struts-Spring
 integration successfully and tomcat indicates it's done with
 Server startup in 7487 ms.
 
 Also, no amount of waiting changes behavior. Again, when I get my
 404 errors, I get nothing in catalina.out, as if to say tomcat
 isn't even seeing the request as an error.
 
 (Note also that I'm running on port 80 temporarily while
 debugging.)

Try enabling an AccessLogValve for both the Host and the Context.
If it shows up in the context's access log, then it's likely an
app-level configuration problem. Otherwise, Tomcat is not routing
properly for some reason.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCULgkACgkQ9CaO5/Lv0PDLNACdEDk7HEfGRXP9dea1Ptbsm70n
o9MAnio7qngpI2xZPZPT4R4Qn2BavpRy
=QNQZ
-END PGP SIGNATURE-

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



Re: Comma related bug in org.apache.catalina.valves.RemoteIpValve

2012-11-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Simon,

On 11/2/12 12:27 PM, Simon Dean wrote:
 -Original Message- From: Caldarale, Charles R
 [mailto:chuck.caldar...@unisys.com] Sent: 31 October 2012 20:35 
 To: Tomcat Users List Subject: RE: Comma related bug in 
 org.apache.catalina.valves.RemoteIpValve
 
 From: André Warnier [mailto:a...@ice-sa.com] Subject: Re: Comma
 related bug in org.apache.catalina.valves.RemoteIpValve
 
 We'll probably end up with something like
 tagregex1,regex2,.../tag.
 Or a single regex, with | between the alternatives (which
 could be a workaround for you now, I guess).
 
 I have a vague memory of a discussion on either the dev or users'
 list about simply removing the comma separation, and using just
 regex standard formats.  As I recall, the final resolution was to
 remove the comma separation in Tomcat 7, but keep it in 6 for
 compatibility - even if it is broken and not completely
 resolvable.  If you look at the RemoteIpValve doc for 7, you'll
 see there's no mention of comma-separated regexes.
 
 Yep. Tomcat 7 is treating the values as whole regexes (taking
advantage of regular expressions' logical OR operation - the pipe symbol).
 
 In Tomcat 6 though, there is a real bug with the current 
 documentation and implementation. The documentation gives example
 values for internalProxies that have commas in the regex. See 
 http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Remote_IP_Valve
 and 
 http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/valves/RemoteIpValve.html

 
Both specify the following as the default value for internalProxies:
 
 10\.\d{1,3}\.\d{1,3}\.\d{1,3}, 192\.168\.\d{1,3}\.\d{1,3}, 
 169\.254\.\d{1,3}\.\d{1,3}, 127\.\d{1,3}\.\d{1,3}\.\d{1,3}
 
 But that value won't work if you assigned it to internalProxies 
 because it has commas in the {1,3} bit. Worse still, the valve 
 silently fails, giving no feedback that there's anything wrong.
 
 Quick remedies would be to change the code and documentation to
 use this as the default:
 
 10\.\d{1,3}\.\d+\.\d{1,3}, 192\.168\.\d+\.\d+, 169\.254\.\d+\.\d+, 
 127\.\d+\.\d+\.\d+
 
 Which replaces {1,3} with +.

You missed a few, and you could be safer. Instead of using \d{1,3} in
general for an octet, I would recommend something like this:

0|1[0-9][0-9]?|2([0-4][0-9]|5[0-5]|[6-9])

This disallows things like 123.456.789.999, though it is a bit more
complicated. It does not contain any commas, though. For an example on
the site, though, a simple \d+ should suffice.

 Also adding a warning about commas to the code and documentation 
 would also go a long way.

Patches -- especially to the documentation -- are always welcome.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCUNncACgkQ9CaO5/Lv0PBamwCePBZqFmdCcGOA8xyoN0R4RbRV
HuIAn38zzplbPoxHuvr9r9JuJKnzavDv
=8e47
-END PGP SIGNATURE-

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



RemoteIpValve lacking default 172.16/12

2012-11-02 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

All,

I was looking at the Javadoc for RemoteIpValve's internalProxies
attribute and I saw this comment:


172.16/12 has not been enabled by default because it is complex to
describe with regular expressions.


I'm not sure that is true. This regex ought to do it:

172\.(1[6-9]|2(5[0-5]|[6-9])|[3-9][0-9])\.\d+\.\d+

Any takers?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Mozilla - http://www.enigmail.net/

iEYEARECAAYFAlCUPVIACgkQ9CaO5/Lv0PAVhgCeLmVyvEK4vzIYLw/sNDD5q/F0
Uw4AniaMfn4VGgApnxrki/sSPw8/5daM
=d04x
-END PGP SIGNATURE-

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



Re: HTTP 404 error when trying to run a Hello World Java Servlet while using Eclipse and Tomcat

2012-11-02 Thread Albert Kam
Perhaps you would like to share :
- Whether you started the tomcat successfully (as seen from the
logs/catalina.out)
- Whether you can access the tomcat with http://localhost:8080 (assuming
you didnt change the tomcat's port)
- Whether you mapped the servlet in web.xml ?
- What URL did you use to access the servlet ?



On Sat, Nov 3, 2012 at 2:26 AM, Talia Selitsky talq...@gmail.com wrote:

 Hello,

 I am using Eclipse version Juno and Apache Tomcat 7.  I am trying to run a
 basic Hello World web application.
 I am following all of the basic steps but I keep getting a Http 404 error.
  The tomcat server runs fine, so I am not sure
 what the problem is. I have done tons of research online but none of the
 solutions have worked.
  Any help would be much appreciated.

 Thanks!




-- 
Do not pursue the past. Do not lose yourself in the future.
The past no longer is. The future has not yet come.
Looking deeply at life as it is in the very here and now,
the practitioner dwells in stability and freedom.
(Thich Nhat Hanh)