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

2010-08-26 Thread arnaud icard

Ok I will remove apache httpd and use Tomcat's virtual hosts system.

thank you all for your response.


Caldarale, Charles R a écrit le 25/08/2010 18:31:

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

   



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

Re: pick load

2010-08-26 Thread Rainer Jung

On 26.08.2010 03:28, Alexandre Chapellon wrote:

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.


Take thread dumps of the Tomcat JVM and check what your applicaion is 
actually doing (like waiting for locks or externals components).


Regards,

Rainer

-
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-26 Thread Felix Schumacher
Hello, 

even if you decided to remove httpd and go directly with virtual hosts in
tomcat, there are two things in your httpd config, which could be advanced
(see inline below).

On Wed, 25 Aug 2010 18:13:28 +0200, 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 [1])
  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 :
 
  JkMount /* default
I think you want /|* which matches / as well as /ANYTHING_ELSE. So tomcat
gets a chance to display its own default page.

 
  ServerName appli1.domain.fr
  ServerAdmin webmas...@domain.fr [2]
 
  DocumentRoot /opt/tomcat/webapps/appli1
If that directory is the normal webapp directory, you are risking to
expose WEB-INF and META-INF to the outside world. That could be a serious
security issue. Your JkMount directive above should make this risk a
non-issue for the moment, but you may change that in future and forget
about the implications.

Bye
 Felix
 
  ErrorLog /var/www/appli1.domain.fr/logs/error.log
  CustomLog /var/www/appli1.domain.fr/logs/access.log common
 
  Options -Indexes
 
  However,when accessing to http://appli1.domain.fr [3], 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

 
 Links:
 --
 [1] http://www.jasig.org/cas
 [2] mailto:webmas...@domain.fr
 [3] http://appli1.domain.fr

-
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-26 Thread Pid
On 26/08/2010 02:14, Shaun Senecal wrote:
 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!

If you're using client-side scripting, why not just set a class or id on
the body for each type, instead of the hidden div?


p


 Thanks
 
 Shaun
 
 
 On Wed, Aug 25, 2010 at 10:17 PM, Christopher Schultz
 ch...@christopherschultz.net wrote:
 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

-
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




0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: pick load

2010-08-26 Thread André Warnier

Alexandre Chapellon wrote:

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:


...
Hi.
It is very likely that by changing the default parameters of Apache, mod_jk and Tomcat 
without first knowing exactly where the slowness is happening, you are making the 
situation worse rather than better.


It is also very likely that the webapp itself is the limiting factor.

Apache + mod_jk + Tomcat, in their default configuration, by themselves, can handle 
several hundred requests per second.  If you do not believe this, then try it yourself : 
set up a static html page inside tomcat's ROOT webapp, make sure that the mod_jk 
configuration forwards these requests to Tomcat, and then use ab to make requests to that 
static page, just to convince yourself.

Then use one of the Tomcat standard example webapps, and do the same.

Then, use Tomcat's AccessLogValve 
(http://tomcat.apache.org/tomcat-6.0-doc/config/valve.html#Access_Log_Valve) to compare 
the processing times between static pages, an example webapp and your webapp.


When you really understand where the problem seems to happen, then come back and ask more 
precise questions.


The point is : the default configuration of Apache, mod_jk and Tomcat is *already* tuned 
to perform well in most standard situations. If there existed any way in general to tune 
these things better, and the Apache, mod_jk and Tomcat developers knew it, then of course 
*that* would become the default configuration.


The point is also : nobody here has any idea of what your old webapp is doing; only you 
know that. If it is making 10,000 disk accesses each time it processes a request, then 
maybe what you need is a faster disk. If it builds a huge table in memory each time it is 
called, then maybe you need more memory. Etc..


One last thing : Tomcat 4.1 and the JVM 1.4.2, both, are about 10 years old, and not 
supported anymore.  The current versions are free, and supported.  Do yourself (and 
everyone else) a favor and make your testing on the latest versions.  Your webapp should 
work just as well (or better) with them.


-
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-26 Thread Pid
On 25/08/2010 15:17, Paul Bourget wrote:
 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
 

Please make a backup of your server.xml.
Remove all of the comments and any passwords from it.
Post it (inline) here.


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


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

2010-08-26 Thread arnaud icard

httpd is stopped.

Here is what I have done in the /opt/tomcat/conf/server.xml :

   /Engine name=Catalina defaultHost=tomcat00c
   ...
   Host name=tomcat00c  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

   Valve className=org.apache.catalina.valves.AccessLogValve
   directory=/var/log/tomcat/hosts/
   prefix=tomcat00c_access_log. suffix=.log
   pattern=common resolveHosts=false/
   /Host

   Host name=cas  appBase=/home/tomcat/hosts/cas/webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

   Valve className=org.apache.catalina.valves.AccessLogValve
   directory=/var/log/tomcat/hosts/
   prefix=cas_access_log. suffix=.log
   pattern=common resolveHosts=false/
   /Host

   Host name=appli1  appBase=/home/tomcat/hosts///appli1///webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

   Valve className=org.apache.catalina.valves.AccessLogValve
   directory=/var/log/tomcat/hosts/
   prefix=//appli1//_access_log. suffix=.log
   pattern=common resolveHosts=false/
   /Host
   /Engine/

When connecting to appli1.test.fr, I am redirected to the default ROOT 
content (which means to the tomcat00c host).


I am a little lost now in this tomcat jungle. No black smoke so far 
hopefully :)


arnaud icard a écrit le 26/08/2010 09:21:

Ok I will remove apache httpd and use Tomcat's virtual hosts system.

thank you all for your response.


Caldarale, Charles R a écrit le 25/08/2010 18:31:

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





-
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-26 Thread Pid
On 26/08/2010 11:39, arnaud icard wrote:
 httpd is stopped.
 
 Here is what I have done in the /opt/tomcat/conf/server.xml :
 
 /Engine name=Catalina defaultHost=tomcat00c
 ...
 Host name=tomcat00c  appBase=webapps
 unpackWARs=true autoDeploy=true
 xmlValidation=false xmlNamespaceAware=false

If the DNS records you're using are anything other than the 'name'
attribute, you'll need an Alias, to match:

 Aliaswww.example.com/Alias


p


  Valve
 className=org.apache.catalina.valves.AccessLogValve
 directory=/var/log/tomcat/hosts/ 
prefix=tomcat00c_access_log. suffix=.log
 pattern=common resolveHosts=false/
   /Host
 
   Host name=cas  appBase=/home/tomcat/hosts/cas/webapps
 unpackWARs=true autoDeploy=true
 xmlValidation=false xmlNamespaceAware=false
 
  Valve
 className=org.apache.catalina.valves.AccessLogValve
 directory=/var/log/tomcat/hosts/ 
prefix=cas_access_log. suffix=.log
 pattern=common resolveHosts=false/
   /Host
 
   Host name=appli1 
 appBase=/home/tomcat/hosts///appli1///webapps
 unpackWARs=true autoDeploy=true
 xmlValidation=false xmlNamespaceAware=false
 
 Valve className=org.apache.catalina.valves.AccessLogValve
 directory=/var/log/tomcat/hosts/ 
prefix=//appli1//_access_log. suffix=.log
 pattern=common resolveHosts=false/
   /Host
 /Engine/
 
 When connecting to appli1.test.fr, I am redirected to the default ROOT
 content (which means to the tomcat00c host).
 
 I am a little lost now in this tomcat jungle. No black smoke so far
 hopefully :)
 
 arnaud icard a écrit le 26/08/2010 09:21:
 Ok I will remove apache httpd and use Tomcat's virtual hosts system.

 thank you all for your response.


 Caldarale, Charles R a écrit le 25/08/2010 18:31:
 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





 -
 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



0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


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

2010-08-26 Thread arnaud icard
Right the parameter name in host and the parameter defaultHost in 
engine need the server's FQDN.

I didn't realize that !

Thanks a lot Pid.

Have a great day.

Best regards,
arnaud


Pid a écrit le 26/08/2010 13:54:

On 26/08/2010 11:39, arnaud icard wrote:
   

httpd is stopped.

Here is what I have done in the /opt/tomcat/conf/server.xml :

 /Engine name=Catalina defaultHost=tomcat00c
 ...
 Host name=tomcat00c  appBase=webapps
 unpackWARs=true autoDeploy=true
 xmlValidation=false xmlNamespaceAware=false
 

If the DNS records you're using are anything other than the 'name'
attribute, you'll need an Alias, to match:

  Aliaswww.example.com/Alias


p


   

  Valve
 className=org.apache.catalina.valves.AccessLogValve
 directory=/var/log/tomcat/hosts/
prefix=tomcat00c_access_log. suffix=.log
 pattern=common resolveHosts=false/
   /Host

   Host name=cas  appBase=/home/tomcat/hosts/cas/webapps
 unpackWARs=true autoDeploy=true
 xmlValidation=false xmlNamespaceAware=false

  Valve
 className=org.apache.catalina.valves.AccessLogValve
 directory=/var/log/tomcat/hosts/
prefix=cas_access_log. suffix=.log
 pattern=common resolveHosts=false/
   /Host

   Host name=appli1
 appBase=/home/tomcat/hosts///appli1///webapps
 unpackWARs=true autoDeploy=true
 xmlValidation=false xmlNamespaceAware=false

 Valve className=org.apache.catalina.valves.AccessLogValve
 directory=/var/log/tomcat/hosts/
prefix=//appli1//_access_log. suffix=.log
 pattern=common resolveHosts=false/
   /Host
 /Engine/

When connecting to appli1.test.fr, I am redirected to the default ROOT
content (which means to the tomcat00c host).

I am a little lost now in this tomcat jungle. No black smoke so far
hopefully :)

arnaud icard a écrit le 26/08/2010 09:21:
 

Ok I will remove apache httpd and use Tomcat's virtual hosts system.

thank you all for your response.


Caldarale, Charles R a écrit le 25/08/2010 18:31:
   

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


 



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

2010-08-26 Thread André Warnier



arnaud icard wrote:

httpd is stopped.

Here is what I have done in the /opt/tomcat/conf/server.xml :

   /Engine name=Catalina defaultHost=tomcat00c
   ...
   Host name=tomcat00c  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

   Valve className=org.apache.catalina.valves.AccessLogValve
   directory=/var/log/tomcat/hosts/
   prefix=tomcat00c_access_log. suffix=.log
   pattern=common resolveHosts=false/
   /Host

   Host name=cas  appBase=/home/tomcat/hosts/cas/webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

   Valve className=org.apache.catalina.valves.AccessLogValve
   directory=/var/log/tomcat/hosts/
   prefix=cas_access_log. suffix=.log
   pattern=common resolveHosts=false/
   /Host

   Host name=appli1  appBase=/home/tomcat/hosts///appli1///webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

   Valve className=org.apache.catalina.valves.AccessLogValve
   directory=/var/log/tomcat/hosts/
   prefix=//appli1//_access_log. suffix=.log
   pattern=common resolveHosts=false/
   /Host
   /Engine/

When connecting to appli1.test.fr, I am redirected to the default ROOT 
content (which means to the tomcat00c host).


I am a little lost now in this tomcat jungle. No black smoke so far 
hopefully :)




It is very simple, really :

1) The defaultHost (as named in the Engine tag) is the one which will serve the request 
(any request), when Tomcat is unable to match the request's hostname *exactly* with one of 
the Host tags' name attribute.
In your case, you have a Host with name=appli1, but the request says appli1.test.fr. 
That does not match (appli1 != appl1.test.fr). So Tomcat defaults to the defaultHost 
tomcat00c.


(Under Apache httpd, the default VirtualHost is the first one named, from top 
to bottom.
In Tomcat, the order does not matter, since you explicitly say which one is the 
defaultHost, in the Engine tag.)


2) something similar would happen with the application's name :
A request for http://appli1.test.fr/appli1; would normally be mapped to the Context 
/appli1 in the Host named appli11.test.fr.  But instead (see (1)), it gets mapped to 
the defaultHost.  And this defaultHost does not have an application named appli1, so the 
request gets mapped to the default application (ROOT) in the defaultHost (tomcat00c), 
inside which Tomcat will be looking for a subdirectory 
(catalina_base)/webapps/ROOT/appli1, and probably not find it.


3) you have far too many repeated // in your Host appli1.  I am quite sure that the 
prefix for the access log will not work as shown.




-
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-26 Thread arnaud icard



André Warnier a écrit le 26/08/2010 14:14:



arnaud icard wrote:

httpd is stopped.

Here is what I have done in the /opt/tomcat/conf/server.xml :

   /Engine name=Catalina defaultHost=tomcat00c
   ...
Host name=tomcat00c  appBase=webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

Valve className=org.apache.catalina.valves.AccessLogValve
   directory=/var/log/tomcat/hosts/
   prefix=tomcat00c_access_log. suffix=.log
   pattern=common resolveHosts=false/
/Host

Host name=cas  appBase=/home/tomcat/hosts/cas/webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

Valve className=org.apache.catalina.valves.AccessLogValve
   directory=/var/log/tomcat/hosts/
   prefix=cas_access_log. suffix=.log
   pattern=common resolveHosts=false/
/Host

Host name=appli1  appBase=/home/tomcat/hosts///appli1///webapps
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false

Valve className=org.apache.catalina.valves.AccessLogValve
   directory=/var/log/tomcat/hosts/
   prefix=//appli1//_access_log. suffix=.log
   pattern=common resolveHosts=false/
/Host
/Engine/

When connecting to appli1.test.fr, I am redirected to the default 
ROOT content (which means to the tomcat00c host).


I am a little lost now in this tomcat jungle. No black smoke so far 
hopefully :)




It is very simple, really :

1) The defaultHost (as named in the Engine tag) is the one which will 
serve the request (any request), when Tomcat is unable to match the 
request's hostname *exactly* with one of the Host tags' name attribute.
In your case, you have a Host with name=appli1, but the request says 
appli1.test.fr. That does not match (appli1 != appl1.test.fr). 
So Tomcat defaults to the defaultHost tomcat00c.


(Under Apache httpd, the default VirtualHost is the first one named, 
from top to bottom.
In Tomcat, the order does not matter, since you explicitly say which 
one is the defaultHost, in the Engine tag.)


2) something similar would happen with the application's name :
A request for http://appli1.test.fr/appli1; would normally be mapped 
to the Context /appli1 in the Host named appli11.test.fr.  But 
instead (see (1)), it gets mapped to the defaultHost.  And this 
defaultHost does not have an application named appli1, so the 
request gets mapped to the default application (ROOT) in the 
defaultHost (tomcat00c), inside which Tomcat will be looking for a 
subdirectory (catalina_base)/webapps/ROOT/appli1, and probably not 
find it.




Yes this is where I made a mistake.
The parameters name and defaultHost must be the FULL name (i.e. 
hostname.domain)


3) you have far too many repeated // in your Host appli1.  I am 
quite sure that the prefix for the access log will not work as shown.




These // does not come from my server.xml
Copy/Paste or mail server problem.

Thus no big deal but thanks for the comment.




-
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-26 Thread André Warnier

arnaud icard wrote:
...


Yes this is where I made a mistake.
The parameters name and defaultHost must be the FULL name (i.e. 
hostname.domain)



No. I mean no, it is not exactly that.

For the defaultHost, it does not matter very much, because it is the default and anything 
that does not match exactly will end up there anyway.


But for the others, as far as I know, the point is that the Host name attribute *must 
match the Host: header in the HTTP request, exactly*.
If requests can come in with a Host: header being just appli1, then you need to have, in 
the corresponding Host tag,

- either the name attribute = appli1
- or an Aliasappli1/Alias tag inside the Host section.

For example:

 Host name=appli1.test.fr
   Aliasappli1/Alias
   ...
 /Host


Unless Tomcat itself does a double reverse DNS lookup to make appli1 equivalent to 
appli1.test.fr, but this would surprise me.




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



How to list registered Servlets (Servlet 3.0 spec)

2010-08-26 Thread Thiago Locatelli da Silva

Hello everybody.

Since servlet 3.0 spec, servlets/listeners/filters can be registered 
inside the context not only thru the web.xml, but also with @WebServlet 
annotation and with META-INF/web-fragment.xml file. I need to create a 
page that lists the current registered servlets/filters/listeners in the 
context. Is there a way to achieve this?


Many Thanks


*Thiago Locatelli da Silva*
/Analista de Sistemas/
/SIC - TDI - Tecnologia em Desenvolvimento de Interfaces/

*DÍGITRO TECNOLOGIA*
*E-mail:* thiago.si...@digitro.com.br mailto:thiago.si...@digitro.com.br
*Fone:* +55 48 3281-7000* Ramal:* 7726
*Fax:* +55 48 3281-7299
*Site:* www.digitro.com http://www.digitro.com

-
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-26 Thread arnaud icard

I think I understand what you're explaining.

I keep that in mind if I encounter in the future some strange behaviours 
from the non-default applications.


Thanks,
arnaud.

André Warnier a écrit le 26/08/2010 14:40:

arnaud icard wrote:
...


Yes this is where I made a mistake.
The parameters name and defaultHost must be the FULL name (i.e. 
hostname.domain)



No. I mean no, it is not exactly that.

For the defaultHost, it does not matter very much, because it is the 
default and anything that does not match exactly will end up there 
anyway.


But for the others, as far as I know, the point is that the Host name 
attribute *must match the Host: header in the HTTP request, exactly*.
If requests can come in with a Host: header being just appli1, then 
you need to have, in the corresponding Host tag,

- either the name attribute = appli1
- or an Aliasappli1/Alias tag inside the Host section.

For example:

Host name=appli1.test.fr
Aliasappli1/Alias
   ...
/Host


Unless Tomcat itself does a double reverse DNS lookup to make appli1 
equivalent to appli1.test.fr, but this would surprise me.




-
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-26 Thread Pid
On 26/08/2010 13:40, André Warnier wrote:
 arnaud icard wrote:
 ...

 Yes this is where I made a mistake.
 The parameters name and defaultHost must be the FULL name (i.e.
 hostname.domain)

 No. I mean no, it is not exactly that.
 
 For the defaultHost, it does not matter very much, because it is the
 default and anything that does not match exactly will end up there anyway.
 
 But for the others, as far as I know, the point is that the Host name
 attribute *must match the Host: header in the HTTP request, exactly*.
 If requests can come in with a Host: header being just appli1, then
 you need to have, in the corresponding Host tag,
 - either the name attribute = appli1
 - or an Aliasappli1/Alias tag inside the Host section.
 
 For example:
 
  Host name=appli1.test.fr
Aliasappli1/Alias
...
  /Host

This reverse must be valid:

  Host name=appli1
Aliasappli1.test.fr/Alias
...
  /Host

or the following would not work:

  Host name=appli1.test.fr
Aliasappli1.test.de/Alias
...
  /Host


p


 
 
 Unless Tomcat itself does a double reverse DNS lookup to make appli1
 equivalent to appli1.test.fr, but this would surprise me.
 
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 



0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: How to list registered Servlets (Servlet 3.0 spec)

2010-08-26 Thread Pid
On 26/08/2010 13:45, Thiago Locatelli da Silva wrote:
 Hello everybody.
 
 Since servlet 3.0 spec, servlets/listeners/filters can be registered
 inside the context not only thru the web.xml, but also with @WebServlet
 annotation and with META-INF/web-fragment.xml file. I need to create a
 page that lists the current registered servlets/filters/listeners in the
 context. Is there a way to achieve this?
 
 Many Thanks

Please start a new thread for this message, rather than editing 
replying to an existing message, which is called thread-hijacking and is
frowned upon.


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


How to list registered Servlets (Servlet 3.0 spec)

2010-08-26 Thread Thiago Locatelli da Silva

Hello everybody, sorry for the previous email. Thanks Pid for the advice

Since servlet 3.0 spec, servlets/listeners/filters can be registered 
inside the context not only thru the web.xml, but also with @WebServlet 
annotation and with META-INF/web-fragment.xml file. I need to create a 
page that lists the current registered servlets/filters/listeners in the 
context. Is there a way to achieve this?


Many Thanks


*Thiago Locatelli da Silva*
/
/

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



Re: another UTF-8 problem

2010-08-26 Thread Tim-Christian Mundt
Thanks for your responses. The problem was not the response from the web 
service. Something must have been completely mixed up. I set the Java 
option -Dfile.encoding to utf-8 which solved the write to file problem 
and also put this in the code:


if (req.getCharacterEncoding() == null)
   req.setCharacterEncoding(UTF-8);
res.setContentType(text/html; charset=UTF-8);
res.setCharacterEncoding(UTF-8);

Which solved the encoding of the response I got from the servlet.

Best
Tim

Christopher Schultz schrieb:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tim,

On 8/24/2010 9:06 AM, Tim-Christian Mundt wrote:
  

I've encountered a UTF-8 problem and yes, URIEncoding=UTF-8 is set.



If you're connecting-out to a SOAP service, then the URIEncoding setting
doesn't matter.

  

I'm connecting to a web service which returns UTF-8 encoded data. If I
do so from a plain, regular, self-contained Java application everything
is fine. However, if I run the same classes in tomcat (and trigger the
action with a http request instead of a main() method in the
application) I get latin-1 encoded characters. For instance when I make
a call and receive a response which contains Łódź I finally get ?ód?
(console, file, whatever output).



Are you sure it isn't the encoding to your console/file/whatever that
isn't set properly?

If you are getting a response that contains non-ASCII characters, they
ought to be encoded using the declared XML document's encoding. What is
that? Are the bytes correct in the response (before your SOAP client
parses them)? Does your SOAP client parse them correctly? You may have
to use a profiler to verify that the characters in memory are what you
expect them to be.

  

Actually the URIEncoding option should not have anything to do with
this, because I'm not sending a request to my application, but my
application is issuing a SOAP call to a web service. Are there any other
options to consider? Same response from the web service (checked with
Wireshark) but different outputs. I've no idea. Any hint is welcome.



So, when you use your own command-line app as a client, you get a
different response from the SOAP server than when you use Tomcat as the
client? You should look at the requests that are being sent. Perhaps
there is a bad accept-charset header or something (although that
probably shouldn't affect the XML response, since an XML parser is
pretty much required to support UTF-8).

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

iEYEARECAAYFAkxz7SoACgkQ9CaO5/Lv0PCNOQCeLLBz/6e3QNsPyQtw4Ggfnh7R
sYsAn3PNB9UqJDunLDeMyQrz6a3Edbao
=/0N2
-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: How to list registered Servlets (Servlet 3.0 spec)

2010-08-26 Thread Caldarale, Charles R
 From: Thiago Locatelli da Silva [mailto:thiago.si...@digitro.com.br] 
 Subject: How to list registered Servlets (Servlet 3.0 spec)

 I need to create a page that lists the current registered 
 servlets/filters/listeners in the context.

Look at the 3.0 API; ServletContext now includes the getServletRegistrations() 
and getFileterRegistrations() methods.  Listeners, unfortunately, don't seem to 
be available through the registration mechanism.

 - 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 list registered Servlets (Servlet 3.0 spec)

2010-08-26 Thread Thiago Locatelli da Silva

Many Thanks for you reply Chuck, i will take a lot at the servlet 3.0 spec!

thiago

Caldarale, Charles R escreveu:
From: Thiago Locatelli da Silva [mailto:thiago.si...@digitro.com.br] 
Subject: How to list registered Servlets (Servlet 3.0 spec)



  
I need to create a page that lists the current registered 
servlets/filters/listeners in the context.



Look at the 3.0 API; ServletContext now includes the getServletRegistrations() 
and getFileterRegistrations() methods.  Listeners, unfortunately, don't seem to 
be available through the registration mechanism.

 - Chuck

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


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

.

  


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



Access StandardContext in WebappClassLoader

2010-08-26 Thread Chefo
Hi guys,

I'm using tomcat 6.0.18 adapted to osgi environment and I would like to make
the WebappClassLoader configurable so that it does not load certain packages
directly through the system class loader but use the class loader hierarchy
instead. In order to do that I have extended the standard webapp class
loader and configured the container to use the new one in the base
context.xml. I want to configure the packages through a context parameter
(separately for each webapp) or eventually through an env-entry. However I
cannot find a way to access the StandardContext instance in my
WebappClassLoader. This is probably a very simple thing to do but I'm not
really well familiar with catalina API and this is kinda driving me crazy.
Any help/suggestion is more than welcome.

Thanks in advance
Stefan


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

2010-08-26 Thread André Warnier

Pid wrote:

On 26/08/2010 13:40, André Warnier wrote:

arnaud icard wrote:
...

Yes this is where I made a mistake.
The parameters name and defaultHost must be the FULL name (i.e.
hostname.domain)


No. I mean no, it is not exactly that.

For the defaultHost, it does not matter very much, because it is the
default and anything that does not match exactly will end up there anyway.

But for the others, as far as I know, the point is that the Host name
attribute *must match the Host: header in the HTTP request, exactly*.
If requests can come in with a Host: header being just appli1, then
you need to have, in the corresponding Host tag,
- either the name attribute = appli1
- or an Aliasappli1/Alias tag inside the Host section.

For example:

 Host name=appli1.test.fr
   Aliasappli1/Alias
   ...
 /Host


This reverse must be valid:

  Host name=appli1
Aliasappli1.test.fr/Alias
...
  /Host

or the following would not work:

  Host name=appli1.test.fr
Aliasappli1.test.de/Alias
...
  /Host



Pid, I don't get what you mean above.

Example :

To put DNS aside for a moment, suppose I have this in my local hosts file (which is 
consulted by the local resolver before DNS gets involved) :


212.85.38.176 mira  mira.wissensbank.com

(and, at this IP address, is a host with a Tomcat server listening on port 80)

So, as far as my local workstation is concerned, both mira and mira.wissensbank.com 
are aliases of eachother, in the sense that they both resolve to the same IP address.


A) Then, I start a browser and request :
http://mira/

- the browser calls the local resolver to resolve mira into an IP address
- the local resolver looks up mira in the local hosts file, finds it, and returns the IP 
address 212.85.38.176

- the browser now establishes a TCP connection with IP address 212.85.38.176
- when the TCP connection is obtained, the browser sends the following request over that 
TCP connection :


GET / HTTP/1.1
Host: mira
...

- the Tomcat at this IP address gets the Host: header's value (mira), and looks up to 
find a Host in its configuration, which has either

- the Host attribute name=mira
- or an Aliasmira/Alias

If it does not find such, the request is passed to the default Host

B) If instead, the request which I type in the browser's URL bar is
http://mira.wissensbank.com
then

- the browser calls the local resolver to resolve mira.wissensbank.com into 
an IP address
- the local resolver looks up mira.wissensbank.com in the local hosts file, finds it, 
and returns the IP address 212.85.38.176

- the browser now establishes a TCP connection with IP address 212.85.38.176
- when the TCP connection is obtained, the browser sends the following request over that 
TCP connection :

GET / HTTP/1.1
Host: mira.wissensbank.com
...

- the Tomcat at this IP address gets the Host: header's value (mira.wissensbank.com), 
and looks up to find a Host in its configuration, which has either

- the Host attribute name=mira.wissensbank.com
- or an Aliasmira.wissensbank.com/Alias

and if it does not find such, the request will be passed to the defaultHost.

All the above remains true even if there is nothing in the local hosts file, and the above 
translations to IP address are made via a DNS lookup.



So, let's say that this Tomcat only has the following (non-default) Host tag :
Host name=mira.wissensbank.com
/Host

then any request addressed by my browser to
http://mira

will end up being served by the defaultHost.


As long as the browser /can/ resolve the hostname into an IP address, it will always make 
the connection to that IP address and send the request over it.
But the content of the Host: header will be the hostname as indicated in the request 
URL, as is, and not necessarily translated to its canonical form.


Whether Tomcat itself would attempt to do some kind of DNS lookup for a partial name, in 
order to canonicise it, is besides the point really, because even if it would - which 
would surprise me - there is no certainty that it would be able to translate mira into 
mira.wissensbank.com.


It is very frequent in intranets to have a mixture of links floating around, some 
referring only to the hostname, some with the full FQDN.  If you want Tomcat to respond 
properly to both kinds of links, you must have both names referenced inside the Host 
section, whether as the host name, or as an Alias.
It does not matter which one of them you use for the Host attribute or the Alias, but they 
must both be there, or some requests will end up with the defaultHost.



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



Re: Best practices for deployment on cluster environment

2010-08-26 Thread Luca Gervasi
On Wed, 2010-08-25 at 10:50 -0300, Fernando Morgenstern wrote:
 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
 

In such enviroment i think that you should deploy once in the NAS/SAN (i
mean, unpack the war) and use the shared filesystem in ro in each
istance.

Btw i'm pretty interested in more answers :)

See Ya


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



Re: Best practices for deployment on cluster environment

2010-08-26 Thread André Warnier

Luca Gervasi wrote:

On Wed, 2010-08-25 at 10:50 -0300, Fernando Morgenstern wrote:

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



In such enviroment i think that you should deploy once in the NAS/SAN (i
mean, unpack the war) and use the shared filesystem in ro in each
istance.

Btw i'm pretty interested in more answers :)


And I believe that this is bad advice (but I am also willing to be 
contradicted).
Suppose you do this, and one Tomcat notices and starts redeploying the 
application.
What about the other ones which are in the process of serving requests, and would suddenly 
find a missing or changed servlet under their nose ?
At least, you would need some kind of mechanism to tell all Tomcats : wait a minute, do 
not process any more requests to this application while it is being redeployed, no ?



-
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-26 Thread Pid
On 26/08/2010 14:52, André Warnier wrote:
 Pid wrote:
 On 26/08/2010 13:40, André Warnier wrote:
 arnaud icard wrote:
 ...
 Yes this is where I made a mistake.
 The parameters name and defaultHost must be the FULL name (i.e.
 hostname.domain)

 No. I mean no, it is not exactly that.

 For the defaultHost, it does not matter very much, because it is the
 default and anything that does not match exactly will end up there
 anyway.

 But for the others, as far as I know, the point is that the Host name
 attribute *must match the Host: header in the HTTP request, exactly*.
 If requests can come in with a Host: header being just appli1, then
 you need to have, in the corresponding Host tag,
 - either the name attribute = appli1
 - or an Aliasappli1/Alias tag inside the Host section.

 For example:

  Host name=appli1.test.fr
Aliasappli1/Alias
...
  /Host

 This reverse must be valid:

   Host name=appli1
 Aliasappli1.test.fr/Alias
 ...
   /Host

 or the following would not work:

   Host name=appli1.test.fr
 Aliasappli1.test.de/Alias
 ...
   /Host

 
 Pid, I don't get what you mean above.

I misread what you were saying.  I thought you were saying that the
host.name attribute must match the relevant headers.host value, rather
than an Alias.


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: Best practices for deployment on cluster environment

2010-08-26 Thread Paolo Santarsiero
Hi, I think the best way is to share a central repository (local or net
mounted) for webapps and create for each one and for each tomcat the right
context with the right path.
regards

On 26 August 2010 16:03, André Warnier a...@ice-sa.com wrote:

 Luca Gervasi wrote:

 On Wed, 2010-08-25 at 10:50 -0300, Fernando Morgenstern wrote:

 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


 In such enviroment i think that you should deploy once in the NAS/SAN (i
 mean, unpack the war) and use the shared filesystem in ro in each
 istance.

 Btw i'm pretty interested in more answers :)

  And I believe that this is bad advice (but I am also willing to be
 contradicted).
 Suppose you do this, and one Tomcat notices and starts redeploying the
 application.
 What about the other ones which are in the process of serving requests, and
 would suddenly find a missing or changed servlet under their nose ?
 At least, you would need some kind of mechanism to tell all Tomcats : wait
 a minute, do not process any more requests to this application while it is
 being redeployed, no ?



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




Re: Best practices for deployment on cluster environment

2010-08-26 Thread Pid
On 26/08/2010 15:03, André Warnier wrote:
 Luca Gervasi wrote:
 On Wed, 2010-08-25 at 10:50 -0300, Fernando Morgenstern wrote:
 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


 In such enviroment i think that you should deploy once in the NAS/SAN (i
 mean, unpack the war) and use the shared filesystem in ro in each
 istance.

 Btw i'm pretty interested in more answers :)

 And I believe that this is bad advice (but I am also willing to be
 contradicted).

Nope.  You're right, it's a really bad idea.
Hosts, let alone servers, should not share an appBase.


p

 Suppose you do this, and one Tomcat notices and starts redeploying the
 application.
 What about the other ones which are in the process of serving requests,
 and would suddenly find a missing or changed servlet under their nose ?
 At least, you would need some kind of mechanism to tell all Tomcats :
 wait a minute, do not process any more requests to this application
 while it is being redeployed, no ?
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 



0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


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

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

Jason,

On 8/25/2010 4:06 PM, Jason Britton wrote:
 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

Any reason not to have this under revision control?

 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.

Sounds good.

 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.

So it's just the static content that needs to be modified by the
designers? Okay, how do they typically place their files after they're
ready? Samba? WebDAV? FTP? Do they drop them straight into production,
or is there a staging area? I'm wondering if you can integrate staging
with subversion and then always build from subversion.

I highly recommend always building from your repository... that way, you
always know what versions of files are out there.

 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.

Be careful: some versions of Tomcat will effectively do an 'rm -rf'
/across/ symlinks that live within deployment directories. Make sure
Tomcat's euid doesn't have rights to delete your stuff.

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

iEYEARECAAYFAkx2eCEACgkQ9CaO5/Lv0PAX/QCfU9r4lXbHcEnYHyqAYopuXjwb
aiMAoKgw6iSoPB/3t4YZEsHfTxvKXqdi
=VfWA
-END PGP SIGNATURE-

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



Re: Best practices for deployment on cluster environment

2010-08-26 Thread Wesley Acheson
An ant deploy perhaps? Through the manager thats what we intend to move to.



On Thu, Aug 26, 2010 at 4:17 PM, Pid p...@pidster.com wrote:
 On 26/08/2010 15:03, André Warnier wrote:
 Luca Gervasi wrote:
 On Wed, 2010-08-25 at 10:50 -0300, Fernando Morgenstern wrote:
 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


 In such enviroment i think that you should deploy once in the NAS/SAN (i
 mean, unpack the war) and use the shared filesystem in ro in each
 istance.

 Btw i'm pretty interested in more answers :)

 And I believe that this is bad advice (but I am also willing to be
 contradicted).

 Nope.  You're right, it's a really bad idea.
 Hosts, let alone servers, should not share an appBase.


 p

 Suppose you do this, and one Tomcat notices and starts redeploying the
 application.
 What about the other ones which are in the process of serving requests,
 and would suddenly find a missing or changed servlet under their nose ?
 At least, you would need some kind of mechanism to tell all Tomcats :
 wait a minute, do not process any more requests to this application
 while it is being redeployed, no ?


 -
 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: TCP clustering without multicast

2010-08-26 Thread Pid
On 23/08/2010 16:51, Bob Smith wrote:
 
 
 Hey all,
 
 
 Can someone point me to a sample config file showing a simple two node tomcat 
 6 
 cluster communicating via TCP not using multicast at all?  I'm having trouble 
 finding detailed documentation on this subject.  I searched the archives but 
 didn't see much.

You can set static node members at startup.

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


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: Best practices for deployment on cluster environment

2010-08-26 Thread Pid
On 25/08/2010 14:50, Fernando Morgenstern wrote:
 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?

Scripting your deployment process is a Good Idea.  It will also mean
that it happens the same every time, according to whatever your scripted
procedure is.

Upload them separately to each server, check integrity and then run a
local script to finish the process and deploy them to appBase  do
server restarts if needed.

If you're deploying to production servers with auto-deployment enabled,
make sure the upload occurs to a separate temp location, before copying
it into the appBase.

You could SCP files up to a location on the server, using a user account
configured with a password-free key pair.

SSH will let you limit a given key to specific commands, so the account
could be configured solely for uploading the files  then running the
local deployment script.


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: Access StandardContext in WebappClassLoader

2010-08-26 Thread Pid
On 26/08/2010 14:38, Chefo wrote:
 Hi guys,
 
 I'm using tomcat 6.0.18 adapted to osgi environment and I would like to make
 the WebappClassLoader configurable so that it does not load certain packages
 directly through the system class loader but use the class loader hierarchy
 instead. In order to do that I have extended the standard webapp class

 loader and configured the container to use the new one in the base
 context.xml. I want to configure the packages through a context parameter
 (separately for each webapp) or eventually through an env-entry. However I
 cannot find a way to access the StandardContext instance in my
 WebappClassLoader. This is probably a very simple thing to do but I'm not
 really well familiar with catalina API and this is kinda driving me crazy.
 Any help/suggestion is more than welcome.

The public parts, (and arguably some other bits), of WebappClassLoader
are accessible to any code calling Thread.getContextClassLoader() with a
simple cast.

Simple access to the underlying StandardContext which circumvented the
ServletContext interface would be a bit pointless  somewhat dangerous.

Why do you need the StandardContext?


p



0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: Access StandardContext in WebappClassLoader

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

Chefo,

On 8/26/2010 9:38 AM, Chefo wrote:
 I'm using tomcat 6.0.18 adapted to osgi environment and I would like to make
 the WebappClassLoader configurable so that it does not load certain packages
 directly through the system class loader but use the class loader hierarchy
 instead.

What ClassLoader hierarchy?

 In order to do that I have extended the standard webapp class
 loader and configured the container to use the new one in the base
 context.xml.

Ok.

 I want to configure the packages through a context parameter
 (separately for each webapp) or eventually through an env-entry. However I
 cannot find a way to access the StandardContext instance in my
 WebappClassLoader.

That's because these two classes have no relationship to one another.

 This is probably a very simple thing to do but I'm not
 really well familiar with catalina API and this is kinda driving me crazy.
 Any help/suggestion is more than welcome.

The WebappClassLoader is just a ClassLoader that loads down instead of
up like traditional ClassLoaders. It's not really webapp or
context-specific in it's code... it's just that the servlet spec says
that webapps need to load classes locally before looking up the
ClassLoader tree, so this class was written to do just that.

The WebappClassLoader isn't tied to the webapp/context other than it's
the one that's been assigned to the context as it's ClassLoader.

Instead of trying to reach-down from the ClassLoader to the
StandardContext, why not do the reverse: register a
ServletContextListener that configures the (already-created)
ClassLoader. Something like this:

public class CrazyClassLoaderConfigrationListener
  implements ServletContextListener
{
  public void contextInitialized(ServletContextEvent e)
  {
ClassLoader cl = this.getClass().getClassLoader();

if(!(cl instanceof CrazyClassLoader))
  cl = Thread.currentThread().getContextClassLoader();

if(cl instanceof CrazyClassLoader)
{
  ((CrazyClassLoader)cl)
   .configure(e.getServletContext()
   .getInitParameter(packages));
}
else
{
  e.getServletContext().log(Could not configure CrazyClassLoader);
}
  }
}

That's a little late to be setting the ClassLoader configuration, but it
will happen before your servlets are loaded.

Of course, you could also just use a .properties file to configure your
ClassLoader.

The real question is: what is it that you're really trying to do?

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

iEYEARECAAYFAkx2fYgACgkQ9CaO5/Lv0PAs0ACgtV8J5d+y8n+CbxlNZpYJZndA
qckAn2P0c45ioh8O7SyUsKfiYQfK3TPU
=4TUr
-END PGP SIGNATURE-

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



Re: Access StandardContext in WebappClassLoader

2010-08-26 Thread Chefo
Hi again

and thanks for the quick responses.

What bothers me in the WebappClassLoader is the fact that before it checks
its repositories (lib folder and classes) and asks its parent class loader,
it will first attempt to load a class from the system class loader - from
the jvm. This is not standard classloader logic but sth done on purpose in
the webapp class loader. I want to prevent that for certain packages and I
want it to be configurable for each web application. That's why I wrote my
WebappClassLoader and configured its usage in the default context.xml
(Loader loaderClass=org.chefo.OSGiWebappClassLoader/ in catalina
home/conf/context/xml). I figured the easiest way to configure a list of
packages that should not be loaded through the system class loader is with a
parameter in the context of the web application, thus I need to access a
context parameter in my webapp class loader. I thought it would be normal
for the webapp class loader to be able to access the context that is
associated with it...

Hope that makes it a bit clearer...

Thanks,
Chefo


On Thu, Aug 26, 2010 at 5:43 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Chefo,

 On 8/26/2010 9:38 AM, Chefo wrote:
  I'm using tomcat 6.0.18 adapted to osgi environment and I would like to
 make
  the WebappClassLoader configurable so that it does not load certain
 packages
  directly through the system class loader but use the class loader
 hierarchy
  instead.

 What ClassLoader hierarchy?

  In order to do that I have extended the standard webapp class
  loader and configured the container to use the new one in the base
  context.xml.

 Ok.

  I want to configure the packages through a context parameter
  (separately for each webapp) or eventually through an env-entry. However
 I
  cannot find a way to access the StandardContext instance in my
  WebappClassLoader.

 That's because these two classes have no relationship to one another.

  This is probably a very simple thing to do but I'm not
  really well familiar with catalina API and this is kinda driving me
 crazy.
  Any help/suggestion is more than welcome.

 The WebappClassLoader is just a ClassLoader that loads down instead of
 up like traditional ClassLoaders. It's not really webapp or
 context-specific in it's code... it's just that the servlet spec says
 that webapps need to load classes locally before looking up the
 ClassLoader tree, so this class was written to do just that.

 The WebappClassLoader isn't tied to the webapp/context other than it's
 the one that's been assigned to the context as it's ClassLoader.

 Instead of trying to reach-down from the ClassLoader to the
 StandardContext, why not do the reverse: register a
 ServletContextListener that configures the (already-created)
 ClassLoader. Something like this:

 public class CrazyClassLoaderConfigrationListener
  implements ServletContextListener
 {
  public void contextInitialized(ServletContextEvent e)
  {
ClassLoader cl = this.getClass().getClassLoader();

if(!(cl instanceof CrazyClassLoader))
  cl = Thread.currentThread().getContextClassLoader();

if(cl instanceof CrazyClassLoader)
{
  ((CrazyClassLoader)cl)
   .configure(e.getServletContext()
   .getInitParameter(packages));
}
else
{
  e.getServletContext().log(Could not configure CrazyClassLoader);
}
  }
 }

 That's a little late to be setting the ClassLoader configuration, but it
 will happen before your servlets are loaded.

 Of course, you could also just use a .properties file to configure your
 ClassLoader.

 The real question is: what is it that you're really trying to do?

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

 iEYEARECAAYFAkx2fYgACgkQ9CaO5/Lv0PAs0ACgtV8J5d+y8n+CbxlNZpYJZndA
 qckAn2P0c45ioh8O7SyUsKfiYQfK3TPU
 =4TUr
 -END PGP SIGNATURE-

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




Re: Access StandardContext in WebappClassLoader

2010-08-26 Thread Rainer Jung

On 26.08.2010 17:24, Chefo wrote:

Hi again

and thanks for the quick responses.

What bothers me in the WebappClassLoader is the fact that before it checks
its repositories (lib folder and classes) and asks its parent class loader,
it will first attempt to load a class from the system class loader - from
the jvm. This is not standard classloader logic but sth done on purpose in
the webapp class loader. I want to prevent that for certain packages and I
want it to be configurable for each web application. That's why I wrote my
WebappClassLoader and configured its usage in the default context.xml
(Loader loaderClass=org.chefo.OSGiWebappClassLoader/  incatalina
home/conf/context/xml). I figured the easiest way to configure a list of
packages that should not be loaded through the system class loader is with a
parameter in the context of the web application, thus I need to access a
context parameter in my webapp class loader. I thought it would be normal
for the webapp class loader to be able to access the context that is
associated with it...

Hope that makes it a bit clearer...


You can configure your loader by extending WebappLoader (not only 
WebappClassLoader) and then using attributes in the loader element you 
added to context.xml (and corresponding setters in the loader 
implementation).


For an example see

http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/loader/VirtualWebappLoader.html

Regards,

Rainer

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



Re: Access StandardContext in WebappClassLoader

2010-08-26 Thread Chefo
Great idea. I'll give it a try immediately!

Thanks a lot,
Chefo

On Thu, Aug 26, 2010 at 6:43 PM, Rainer Jung rainer.j...@kippdata.dewrote:

 On 26.08.2010 17:24, Chefo wrote:

 Hi again

 and thanks for the quick responses.

 What bothers me in the WebappClassLoader is the fact that before it checks
 its repositories (lib folder and classes) and asks its parent class
 loader,
 it will first attempt to load a class from the system class loader - from
 the jvm. This is not standard classloader logic but sth done on purpose in
 the webapp class loader. I want to prevent that for certain packages and I
 want it to be configurable for each web application. That's why I wrote my
 WebappClassLoader and configured its usage in the default context.xml
 (Loader loaderClass=org.chefo.OSGiWebappClassLoader/  incatalina
 home/conf/context/xml). I figured the easiest way to configure a list of
 packages that should not be loaded through the system class loader is with
 a
 parameter in the context of the web application, thus I need to access a
 context parameter in my webapp class loader. I thought it would be normal
 for the webapp class loader to be able to access the context that is
 associated with it...

 Hope that makes it a bit clearer...


 You can configure your loader by extending WebappLoader (not only
 WebappClassLoader) and then using attributes in the loader element you added
 to context.xml (and corresponding setters in the loader implementation).

 For an example see


 http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/loader/VirtualWebappLoader.html

 Regards,

 Rainer


 -
 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-26 Thread Paul Bourget
Server.xml inline below.  There is also a server.working.xml

Paul Bourget
Isabella Products
 

-Original Message-
From: Pid [mailto:p...@pidster.com] 
Sent: Thursday, August 26, 2010 4:25 AM
To: Tomcat Users List
Subject: Re: java.net.BindException: Address already in use

On 25/08/2010 15:17, Paul Bourget wrote:
 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
 

Please make a backup of your server.xml.
Remove all of the comments and any passwords from it.
Post it (inline) here.

?xml version='1.0' encoding='utf-8'?
Server debug=0 port=8606 shutdown=SHUTDOWN
  Service debug=0 name=Tomcat-Standalone

!-- http connector, not used, using ajp connector --
!--Connector
className=org.apache.catalina.connector.http.HttpConnector
acceptCount=10 address=216.205.49.171 allowChunking=true
bufferSize=2048 connectionTimeout=6 debug=1
enableLookups=true maxProcessors=75 minProcessors=5 port=8680
proxyPort=0 redirectPort=8643 scheme=http secure=false
tcpNoDelay=true URIEncoding=UTF-8
  Factory
className=org.apache.catalina.net.DefaultServerSocketFactory/
/Connector--

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

Engine debug=0 defaultHost=216.205.49.171 name=Catalina
jvmRoute=netomat
  Host appBase=webapps autoDeploy=false debug=0
deployXML=false liveDeploy=true name=216.205.49.171
unpackWARs=false

Valve className=org.apache.catalina.valves.AccessLogValve
debug=1 directory=/log/tomcat/ pattern=%h %l %u %t quot;%rquot;
%s %b prefix=216.205.49.171_access_log. resolveHosts=false
rotatable=true suffix=.txt/

  /Host
  Realm className=org.apache.catalina.realm.MemoryRealm debug=0
pathname=conf/tomcat-users.xml validate=true/
/Engine
  /Service
/Server

p

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



Re: Access StandardContext in WebappClassLoader

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

Chefo,

On 8/26/2010 11:24 AM, Chefo wrote:
 What bothers me in the WebappClassLoader is the fact that before it checks
 its repositories (lib folder and classes) and asks its parent class loader,
 it will first attempt to load a class from the system class loader - from
 the jvm.

That's supposed to be how it's done: webapps aren't supposed to be able
to subvert the JVM by loading their own definitions for, say,
java.lang.Object.

 I want to prevent that for certain packages and I
 want it to be configurable for each web application.

Can you give me an example of when this would be a good idea?

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

iEYEARECAAYFAkx2pEMACgkQ9CaO5/Lv0PCQiQCgrrlP1MmzO7zfg+db81i+h82D
4eAAn3I5g/Vb1JPpaC24jzfGLNhqMwT7
=uIHX
-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-26 Thread Paul Bourget
Sorry, disregard the last email that file is from a different server
(which is running fine).  Here is the file from the server that is not
working.

Paul Bourget
Isabella Products
 

-Original Message-
From: Pid [mailto:p...@pidster.com] 
Sent: Thursday, August 26, 2010 4:25 AM
To: Tomcat Users List
Subject: Re: java.net.BindException: Address already in use

On 25/08/2010 15:17, Paul Bourget wrote:
 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
 

Please make a backup of your server.xml.
Remove all of the comments and any passwords from it.
Post it (inline) here.

?xml version='1.0' encoding='utf-8'?
Server debug=0 port=8606 shutdown=SHUTDOWN
  Service debug=0 name=Tomcat-Standalone


Connector protocol=AJP/1.3 acceptCount=100 bufferSize=2048
connectionTimeout=5000 debug=0 disabl
eUploadTimeout=false enableLookups=false maxProcessors=75
minProcessors=1 port=8209 proxyPort=0 red
irectPort=8643 scheme=http secure=false tcpNoDelay=true
useURIValidationHack=false useBodyEncodingFor
URI=true URIEncoding=UTF-8/Connector

Engine debug=0 defaultHost=192.168.30.19 name=Catalina
jvmRoute=netomat
  Host appBase=webapps autoDeploy=false debug=0
deployXML=false liveDeploy=true name=192.168.30
.19 unpackWARs=false

Valve className=org.apache.catalina.valves.AccessLogValve
debug=0 directory=/log/tomcat/ pattern
=%h %l %u %t quot;%rquot; %s %b prefix=192.168.30.19_access_log.
resolveHosts=false rotatable=true su
ffix=.txt/

  /Host
  Realm className=org.apache.catalina.realm.MemoryRealm debug=0
pathname=conf/tomcat-users.xml valid
ate=true/
/Engine
  /Service
/Server

p

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



Re: pick load

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

Rainer,

On 8/26/2010 3:25 AM, Rainer Jung wrote:
 On 26.08.2010 03:28, Alexandre Chapellon wrote:
 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:
 
 Take thread dumps of the Tomcat JVM and check what your applicaion is
 actually doing (like waiting for locks or externals components).

+1

My money is on a database connection pool with maxActive=20.

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

iEYEARECAAYFAkx2qmkACgkQ9CaO5/Lv0PAE3gCeInJO94S/ZIOjyt+qjKAOPwR1
LiIAoKzELwrWGTMmG5ZwWtBkcn1kg1Tz
=aHsu
-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-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Paul,

On 8/26/2010 1:30 PM, Paul Bourget wrote:
 Sorry, disregard the last email that file is from a different server
 (which is running fine).  Here is the file from the server that is not
 working.

Your configuration looks fine to me: only one Connector and the
shutdown port is distinct from that.

The only thing I can think of is that you are starting that same Tomcat
instance twice.

Perhaps you have more than one Tomcat instance configured with the same
ports?

If you've added a network interface, is it possible that Tomcat is
trying to bind to 0.0.0.0:8206 instead of 10.0.0.5:8206?

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

iEYEARECAAYFAkx2qg4ACgkQ9CaO5/Lv0PCoHACdE/L4ccgNs0IoOnm+cdPi0Qei
23gAn3bpeCifaBMj/94IKP/hdvUi7HIt
=9Ss0
-END PGP SIGNATURE-

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



A little trouble with SSL

2010-08-26 Thread Andrea Freire

I install tomcat 6 and all works without problem, but I had to install ssl then 
the problems started. 
I tried to configure using the module that connect tomcat6 with apache mod_jk, 
but 
send me the 
request was apparently not the apache server just redirects me what is 
going to port 80, when I put on port 443 I get that not on the server 
once I came out about the certificate but I redirected I
 get forgiven, then try to implement it directly in tomcat using a 
certificate using openssl, then use the keytool tool to generate the 
first time you use it if I generate a certificate but I put it in jks 
but It put me in another that beginning with g, the second time I 
said that already exists error code or a malformed key, keytool error: 
java.security.KeyStoreException: Alias [tomcat] already exists and DOES 
NOT IDENTIFY a Key Entry, I try with the jdk keytool to install but followed
 me out the same mistakes in some cases moved the keys to rebuilding the
 certificates and keys in the folder that I assign $ path $ / keys but I 
got the error malformed key. 

  

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

2010-08-26 Thread Caldarale, Charles R
 From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
 Subject: Re: java.net.BindException: Address already in use

 Your configuration looks fine to me:

Not to me; it looks like it's been carried over from some ancient version of 
Tomcat.  There are numerous attributes (e.g., debug, minProcessors, 
maxProcessors) included that haven't been part of a valid configuration for 
many years.  There are also numerous Listener elements missing that are part 
of a standard Tomcat 5.5 configuration; not sure what happens when those are 
left out.

I'd suggest that the OP start with the 5.5 server.xml that ships with Tomcat, 
and modify that to suite the site needs, rather than carrying forward one from 
the dim, dark past.

 - 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: Best practices for deployment on cluster environment

2010-08-26 Thread Mark Eggers
I haven't tried this in production (yet) so your mileage may vary.

In the cluster setup, there's a FarmDeployer element that can be used to deploy 
across the cluster.

The host that does the deploying:

Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer
  tempDir=${catalina.base}/temp-dir/
  deployDir=${catalina.base}/webapps/
  watchDir=${catalina.base}/watch-dir/
  processDeployFrequency=4
  watchEnabled=true/

And the hosts that get the web application:

Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer
  tempDir=${catalina.base}/temp-dir/
  deployDir=${catalina.base}/webapps/
  watchDir=${catalina.base}/watch-dir/
  processDeployFrequency=4
  watchEnabled=false/


For large web applications and frequent deployments, this might generate a lot 
of network traffic.

Also, it's not intuitive (to me) how processDeployFrequency works, but I need 
to 
look at the code. In any case, you might have the Tomcat doing the deploying 
not 
actually serving content.

I found out that you can use ${variable.name} in configuration files, so it's 
now much easier to clone installations and just edit setenv.sh(bat) as 
appropriate.

Hope this helps.

. . . just my two cents.

/mde/



- Original Message 
From: Pid p...@pidster.com
To: Tomcat Users List users@tomcat.apache.org
Sent: Thu, August 26, 2010 7:36:15 AM
Subject: Re: Best practices for deployment on cluster environment

On 25/08/2010 14:50, Fernando Morgenstern wrote:
 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?

Scripting your deployment process is a Good Idea.  It will also mean
that it happens the same every time, according to whatever your scripted
procedure is.

Upload them separately to each server, check integrity and then run a
local script to finish the process and deploy them to appBase  do
server restarts if needed.

If you're deploying to production servers with auto-deployment enabled,
make sure the upload occurs to a separate temp location, before copying
it into the appBase.

You could SCP files up to a location on the server, using a user account
configured with a password-free key pair.

SSH will let you limit a given key to specific commands, so the account
could be configured solely for uploading the files  then running the
local deployment script.


p



  


-
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-26 Thread Paul Bourget
Hi Chris,

Thanks for looking at this. Wouldn't the first instance have open ports
(indicated by netstat)?  Or some httpd tasks (ps -ef).

Here is the beginning of the log file.  If there are 2 tomcats running,
one of them is not writing to the log (from what I can tell).

[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

Paul Bourget
Isabella Products
 

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Thursday, August 26, 2010 1:53 PM
To: Tomcat Users List
Subject: Re: java.net.BindException: Address already in use

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Paul,

On 8/26/2010 1:30 PM, Paul Bourget wrote:
 Sorry, disregard the last email that file is from a different server
 (which is running fine).  Here is the file from the server that is not
 working.

Your configuration looks fine to me: only one Connector and the
shutdown port is distinct from that.

The only thing I can think of is that you are starting that same Tomcat
instance twice.

Perhaps you have more than one Tomcat instance configured with the same
ports?

If you've added a network interface, is it possible that Tomcat is
trying to bind to 0.0.0.0:8206 instead of 10.0.0.5:8206?

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

iEYEARECAAYFAkx2qg4ACgkQ9CaO5/Lv0PCoHACdE/L4ccgNs0IoOnm+cdPi0Qei
23gAn3bpeCifaBMj/94IKP/hdvUi7HIt
=9Ss0
-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: java.net.BindException: Address already in use

2010-08-26 Thread Caldarale, Charles R
From: Paul Bourget [mailto:paul.bour...@isabellaproducts.com] 
Subject: RE: java.net.BindException: Address already in use

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

That's pretty explicit evidence that 8606 is already in use.  What does netstat 
-ano show when this message appears but before you shut down Tomcat?

 - Chuck


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


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



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

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

Paul,

On 8/26/2010 2:19 PM, Paul Bourget wrote:
 Thanks for looking at this. Wouldn't the first instance have open ports
 (indicated by netstat)?  Or some httpd tasks (ps -ef).

Yes, I would expect that. How are you launching Tomcat?

I'm wondering if you're somehow launching Tomcat twice at once. Then
again, one of them should succeed and the other should fail. Take the
suggestions from others to modify your 'netstat' invocation to avoid
showing service names instead of port numbers.

Chuck has a good point: your server.xml looks like it's got some really
old stuff in it. It's very possible that you've been dragging a
server.xml from previous Tomcat versions around with you.

Consider starting over with the server.xml that ships with Tomcat: just
modify the shutdown port, AJP connector port, disable the HTTP
connector, tweak the Host settings, and re-enable your AccessLogValve.

It's unlikely to fix anything, but it will definitely clean things up.

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

iEYEARECAAYFAkx2s08ACgkQ9CaO5/Lv0PBEpgCfTBKbtPqe2c+iDAOmoEaKLYJg
RDYAn3KdPkwWWH+cQIqQMl/cn+B8Qfre
=vFka
-END PGP SIGNATURE-

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



Re: pick load

2010-08-26 Thread Alexandre Chapellon
ab doesn't says much... except the requests completed  and most of them
did in less than 5 seconds:

###
Server Software:Apache
Server Hostname:blablablabla.hostname
Server Port:443
SSL/TLS Protocol:   TLSv1/SSLv3,DHE-RSA-AES256-SHA,1024,256

Document Path:  /path/to/Login.jsp
Document Length:5576 bytes

Concurrency Level:  50
Time taken for tests:   81.949 seconds
Complete requests:  1648
Failed requests:0
Write errors:   0
Total transferred:  9752864 bytes
HTML transferred:   9189248 bytes
Requests per second:20.11 [#/sec] (mean)
Time per request:   2486.315 [ms] (mean)
Time per request:   49.726 [ms] (mean, across all concurrent
requests)
Transfer rate:  116.22 [Kbytes/sec] received

Connection Times (ms)
  min  mean[+/-sd] median   max
Connect:   29   55 114.8 351425
Processing:74 2392 377.9   22893589
Waiting:   73 2390 377.8   22863587
Total:128 2447 363.8   23304256

Percentage of the requests served within a certain time (ms)
  50%   2330
  66%   2498
  75%   2596
  80%   2688
  90%   2892
  95%   3075
  98%   3421
  99%   3520
 100%   4256 (longest request)

Not sure it helps... It's the jkmanger that shows 20req/s as max

thx

Le jeudi 26 août 2010 à 07:56 +0200, Domenico Briganti a écrit :

 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
 




Re: pick load

2010-08-26 Thread Alexandre Chapellon
Le jeudi 26 août 2010 à 09:25 +0200, Rainer Jung a écrit :

 On 26.08.2010 03:28, Alexandre Chapellon wrote:
  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.
 
 Take thread dumps of the Tomcat JVM and check what your applicaion is 
 actually doing (like waiting for locks or externals components).
 


This sounds an excellent idea indeed, and it's surely what I would have
done if I new it was possible and how I could do it :)
What's the way to do it?


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




Re: pick load

2010-08-26 Thread Rainer Jung

On 26.08.2010 21:00, Alexandre Chapellon wrote:

Le jeudi 26 août 2010 à 09:25 +0200, Rainer Jung a écrit :


On 26.08.2010 03:28, Alexandre Chapellon wrote:

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.


Take thread dumps of the Tomcat JVM and check what your applicaion is
actually doing (like waiting for locks or externals components).




This sounds an excellent idea indeed, and it's surely what I would have
done if I new it was possible and how I could do it :)
What's the way to do it?


http://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_my_running_webapp_.3F

Regards,

Rainer

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



Re: Best practices for deployment on cluster environment

2010-08-26 Thread Pid
On 26/08/2010 19:14, Mark Eggers wrote:
 I haven't tried this in production (yet) so your mileage may vary.
 
 In the cluster setup, there's a FarmDeployer element that can be used to 
 deploy 
 across the cluster.

FarmWarDeployer would certainly benefit from more production usage.  I'm
not sure the reverse is true.


p

 The host that does the deploying:
 
 Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer
   tempDir=${catalina.base}/temp-dir/
   deployDir=${catalina.base}/webapps/
   watchDir=${catalina.base}/watch-dir/
   processDeployFrequency=4
   watchEnabled=true/
 
 And the hosts that get the web application:
 
 Deployer className=org.apache.catalina.ha.deploy.FarmWarDeployer
   tempDir=${catalina.base}/temp-dir/
   deployDir=${catalina.base}/webapps/
   watchDir=${catalina.base}/watch-dir/
   processDeployFrequency=4
   watchEnabled=false/
 
 
 For large web applications and frequent deployments, this might generate a 
 lot 
 of network traffic.
 
 Also, it's not intuitive (to me) how processDeployFrequency works, but I need 
 to 
 look at the code. In any case, you might have the Tomcat doing the deploying 
 not 
 actually serving content.
 
 I found out that you can use ${variable.name} in configuration files, so it's 
 now much easier to clone installations and just edit setenv.sh(bat) as 
 appropriate.
 
 Hope this helps.
 
 . . . just my two cents.
 
 /mde/
 
 
 
 - Original Message 
 From: Pid p...@pidster.com
 To: Tomcat Users List users@tomcat.apache.org
 Sent: Thu, August 26, 2010 7:36:15 AM
 Subject: Re: Best practices for deployment on cluster environment
 
 On 25/08/2010 14:50, Fernando Morgenstern wrote:
 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?
 
 Scripting your deployment process is a Good Idea.  It will also mean
 that it happens the same every time, according to whatever your scripted
 procedure is.
 
 Upload them separately to each server, check integrity and then run a
 local script to finish the process and deploy them to appBase  do
 server restarts if needed.
 
 If you're deploying to production servers with auto-deployment enabled,
 make sure the upload occurs to a separate temp location, before copying
 it into the appBase.
 
 You could SCP files up to a location on the server, using a user account
 configured with a password-free key pair.
 
 SSH will let you limit a given key to specific commands, so the account
 could be configured solely for uploading the files  then running the
 local deployment script.
 
 
 p
 
 
 
   
 
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 



0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: How to convert WAR application into console application (Making Unicorn has console application)

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

Ranjith,

On 8/20/2010 7:49 AM, Ranjith wrote:
 Unicorn just provide a URI and push the button. It will call a
 series of validation services and report the results.
 
 It works fine in apache-tomcat, what I want is how to make the
 unicorn as console application.

I think you're looking for the console-users mailing list ;)

 The input should passed through
 command line arguments and output should displayed at console itself
 I don`t want to use any web server to deploy it.

I think you should go back and look at the source code to Unicorn. I
recently leafed-through it, because I was interested in how it was
implemented. It appears to be a client /only/. Yes, there is a web
interface for it, but is (evidently) sends everything to the central
Unicorn service for actual validation.

Try reading the source: there's not much of it. In fact, start with the
servlets themselves (there are only one or two). You ought to be able to
figure out how to duplicate the Unicorn client calls in a non-servlet
environment.

But I suspect nobody will ever read this post, so maybe we'll never know.

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

iEYEARECAAYFAkx23AYACgkQ9CaO5/Lv0PA0AgCdHerGhHFwrbHWtb0cZqQOy1q6
sdkAoIt4+BBP92FpbupHZEwaGlskRiUb
=xARl
-END PGP SIGNATURE-

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



Re: Is there a better way to disable JSESSIONID in the URLs?

2010-08-26 Thread Wesley Acheson
On Sat, Aug 21, 2010 at 12:12 PM, Pid p...@pidster.com wrote:
 On 20/08/2010 22:40, Wesley Acheson wrote:
 I'm a bit lost with this thread. Are people suggesting I should submit a
 patch. I really wouldn't know where to begin looking.

 That's where the discussion was heading.

 Tomcat is Open Source.  The first place to look would be SVN.

  http://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk/


 p

Hi everyone,

I've done this and was naturally quite nervous about it having never
contributed to anything in this way.  Would It be too much to ask to
get some feedback if you have time?  I'd really appreciate it.
Feedback about anything from the code changes to if you feel the
bugzilla report was adaquate.

I do honestly appreciate that you are all busy but It could go a long
way to encouraging new users to help chip in if they felt there was
adaquate feedback. Much better to be honest though than to pamper to
them. If anythings wrong with what I did I'd love to know but If it
was okay I'd like to know also.

If this is a subject for the dev mail list then I'd appreciate being
told that too. I didn't want to interrupt the dev mail list as it
seems pretty busy with svn commits and bugzilla reports.

In case your not in a threaded email client the link was
https://issues.apache.org/bugzilla/show_bug.cgi?id=49811 again.

Regards,

Wesley Acheson

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



Re: pick load

2010-08-26 Thread Alexandre Chapellon
Thanks.
I got the dump of the running JVM (only the benchmark is running at dump
time).
I tried to take a look at it, but as am not familiar with java, I prefer
talk about it here.

-first I noticed the number of TP-Processor is twice the number of
concurrent resquests send by ab (why twice? i don't know).
About half of them are in Object.wait state

TP-Processor40 daemon prio=1 tid=0xdef53168 nid=0x646f in
Object.wait() [0xda729000..0xda7291b8]
at java.lang.Object.wait(Native Method)
- waiting on 0xe17bc808 (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
at java.lang.Object.wait(Object.java:429)
at org.apache.tomcat.util.threads.ThreadPool
$ControlRunnable.run(ThreadPool.java:661)
- locked 0xe17bc808 (a
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable)
at java.lang.Thread.run(Thread.java:534)

and the other half is waiting for a monitor entry.

TP-Processor34 daemon prio=1 tid=0xdef3edc0 nid=0x6469 waiting for
monitor entry [0xdaa28000..0xdaa291b8]
at java.sql.DriverManager.getConnection(DriverManager.java:158)
- waiting to lock 0xeff0b350 (a java.lang.Class)
at
com.mana.oc.DBConnection.getConnectionCRM(DBConnection.java:155)
at org.apache.jsp.Login_jsp._jspService(Login_jsp.java:192)
..

And only 5 runnable processors.

To me this sounds like a pool of database connection that is full but
I'm not sure of it and I don't really know how/where to deal with it.

If someone has the kind willing to take a look at the full dump here it
is: http://pastebin.com/2v3PVTDm

Regards

Le jeudi 26 août 2010 à 21:36 +0200, Rainer Jung a écrit :

 On 26.08.2010 21:00, Alexandre Chapellon wrote:
  Le jeudi 26 août 2010 à 09:25 +0200, Rainer Jung a écrit :
 
  On 26.08.2010 03:28, Alexandre Chapellon wrote:
  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.
 
  Take thread dumps of the Tomcat JVM and check what your applicaion is
  actually doing (like waiting for locks or externals components).
 
 
 
  This sounds an excellent idea indeed, and it's surely what I would have
  done if I new it was possible and how I could do it :)
  What's the way to do it?
 
 http://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_my_running_webapp_.3F
 
 Regards,
 
 Rainer
 
 -
 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-26 Thread Shaun Senecal
Currently the only content in the HTML file is a script tag, since I
am using GWT for the UI.  I dont think there is any way I can set a
class/id on a script tag, so I went with the empty DIV and put a known
id on it.  You're right though, I could have reused an existing
element for this purpose as well.



On Thu, Aug 26, 2010 at 5:17 PM, Pid p...@pidster.com wrote:
 On 26/08/2010 02:14, Shaun Senecal wrote:
 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!

 If you're using client-side scripting, why not just set a class or id on
 the body for each type, instead of the hidden div?


 p


 Thanks

 Shaun


 On Wed, Aug 25, 2010 at 10:17 PM, Christopher Schultz
 ch...@christopherschultz.net wrote:
 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

 -
 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: pick load

2010-08-26 Thread Caldarale, Charles R
 From: Alexandre Chapellon [mailto:alexandre.chapel...@mana.pf] 
 Subject: Re: pick load

 To me this sounds like a pool of database connection
 that is full

It's not a full connection pool - you're not using one.  It's also likely that 
your database is a bit sluggish in establishing connections.  That version of 
the JVM sets a global lock while creating a connection, with the expectation 
that it will occur fairly quickly, allowing the next connection to be 
established.  Note that this has nothing to do with Tomcat.

 I don't really know how/where to deal with it.

Fix your DB, and configure a connection pool rather than calling 
com.mana.oc.DBConnection.getConnectionCRM directly, so each request doesn't 
have to acquire a new connection.  Also upgrade to supported versions of 
things, since both the level of Tomcat you're on and the JVM have been 
unsupported for quite some time.  The most recent JVMs do not keep that 
particular global lock up on the connection request to the DB, so moving to 
Java 6 might help.

 If someone has the kind willing to take a look at the 
 full dump here it is: http://pastebin.com/2v3PVTDm

A brief look showed only one thread having an active DB connection, with all of 
the rest stuck on the global lock trying to get a connection in order to 
authenticate the client or else just waiting for something to do.  Since you're 
not using a connection pool for the authentications, you're serializing the 
requests, so it's no wonder your throughput is terrible.  Even the greatly 
improved performance of newer Tomcat and JVM versions won't overcome bad webapp 
design.

 - 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: pick load

2010-08-26 Thread Alexandre Chapellon
Le jeudi 26 août 2010 à 22:04 -0500, Caldarale, Charles R a écrit :

  From: Alexandre Chapellon [mailto:alexandre.chapel...@mana.pf] 
  Subject: Re: pick load
 
  To me this sounds like a pool of database connection
  that is full
 
 It's not a full connection pool - you're not using one.  It's also likely 
 that your database is a bit sluggish in establishing connections.  That 
 version of the JVM sets a global lock while creating a connection, with the 
 expectation that it will occur fairly quickly, allowing the next connection 
 to be established.  Note that this has nothing to do with Tomcat.
 
  I don't really know how/where to deal with it.
 
 Fix your DB, and configure a connection pool rather than calling 
 com.mana.oc.DBConnection.getConnectionCRM directly, so each request doesn't 
 have to acquire a new connection.  Also upgrade to supported versions of 
 things, since both the level of Tomcat you're on and the JVM have been 
 unsupported for quite some time.  The most recent JVMs do not keep that 
 particular global lock up on the connection request to the DB, so moving to 
 Java 6 might help.
 
  If someone has the kind willing to take a look at the 
  full dump here it is: http://pastebin.com/2v3PVTDm
 
 A brief look showed only one thread having an active DB connection, with all 
 of the rest stuck on the global lock trying to get a connection in order to 
 authenticate the client or else just waiting for something to do.  Since 
 you're not using a connection pool for the authentications, you're 
 serializing the requests, so it's no wonder your throughput is terrible.  
 Even the greatly improved performance of newer Tomcat and JVM versions won't 
 overcome bad webapp design.
 
  - Chuck
 


Thank you Chuck I'm so glad to hear this!

 
 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.
 




Tomcat 5.5 and Windows 7

2010-08-26 Thread Marcos Molina
Hi there,
 
I only wanna know if i can run Tomcat 5.5 on windows 7  ???
And if i have to take any considerations to do it.
Thanks for yours answers.

Regards
Marcos.

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