Re: problems faced in deploying servlet

2013-04-09 Thread Jason Brittain
Hi all.

On Tue, Mar 19, 2013 at 4:43 PM, Mark Eggers its_toas...@yahoo.com wrote:

 On 3/19/2013 1:05 PM, Christopher Schultz wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256


[snip]


 Go get a copy of Tomcat: The Definitive Guide by Jason Brittain (who
 happens to lurk on this list, FYI)


Yep.  :)


 and Ian Darwin. It's targeted at
 Tomcat 6.x but not much has changed (with old features) since its
 publication. There's plenty of new, exciting stuff but the basics will
 be well-covered by T:TDG.


 +1

 This is a great book for Tomcat.


Very glad that it can still be useful, and still isn't fundamentally out of
date 5 1/2 years after it was published..  Tomcat has certainly advanced
quite a bit in that time, so there are new features, better performance,
better security, and more.  But, the fundamentals (and most of the details)
in the book are still just about all valid, at least for Tomcat 7.

It would be great to hear from you Tomcat users what else about Tomcat
you'd like to see documented.. What have you found missing (either from the
Apache Tomcat online docs or Tomcat books)?  What Tomcat docs do you wish
existed?

Here's one from me: I have often wished there were better docs about how
JULI logging works in Tomcat, including a more comprehensive set of useful
logging.properties examples, and text describing the full syntax.  Not real
exciting to write, but it would sure help in some cases.

I also recommend the following book for learning Servlets, JSP, etc.

 Head First Servlets and JSP, 2nd Edition
 By Bryan Basham, Kathy Sierra, Bert Bates

 It's an enjoyable read even for us old farts who come from traditional
 programming backgrounds. It manages to cover both the standards (2.5) and
 some best practices at the same time.


Nice.  I'll have to have a look at it..  Thanks for the recommendation.

--
Jason


Tomcat Seminar in San Francisco, January 27th

2011-01-24 Thread Jason Brittain
For those who are in or near San Francisco, California, and are using Apache
Tomcat or developing web applications that may run on Apache Tomcat,
MuleSoft invites you to join us for a free Tomcat seminar.  The seminar will
feature two presentations:

* Tomcat Webapp Security, presented by Jason Brittain
* Tcat Server Demonstration: Enterprise Tomcat Made Easy, presented by Dan
Diephouse

Come learn more about Tomcat security, web application security, and discuss
Tomcat with other Tomcat users and experts.

Pizza and beer and soft drinks will be provided, sponsored by Mulesoft.

When: This Thursday evening, January 27th, 2010 at (5:00 Pizza and
gathering) 5:30 first presentation
Where: The MuleSoft office: 30 Maiden Lane Suite 500, San Francisco
415-229-2010 (About one block away from 3rd and Market)

Please RSVP here:
http://www.mulesoft.com/free-apache-tomcat-seminar-san-francisco

See you there.
--
Jason Brittain
Mulesoft


Re: tomcat 7 in debian/ubuntu

2010-12-03 Thread Jason Brittain
Hi Rodrigo.

As far as I am aware, there is currently no Tomcat 7 debian package tree
being worked on, nor am I currently working on one.  I have recently been
discussing the possibility of working on a Tomcat 7 package that goes across
both deb and RPM formats (in an attempt to merge lots of duplicate efforts,
and to promote more Tomcat compatibility across Linux distributions), but as
of now that's just an idea I bounced off of a couple of people.  I do agree
that Tomcat 7 packages are needed now.

Cheers.
--
Jason Brittain
MuleSoft http://www.mulesoft.com


On Fri, Dec 3, 2010 at 10:21 AM, Rodrigo Asensio rasen...@gmail.com wrote:

 anyone knows when debian/ubuntu is getting the package for tomcat 7 ??



Re: Tomcat Consultant

2010-09-28 Thread Jason Brittain
Hi Chris.

I'm surprised you hadn't heard of it yet.  Disclaimer: I work for MuleSoft.
Just so you know (in case our web pages don't clearly state this), Tcat is
about trying to make it easier to use open source Tomcat in production
enterprise environments.  It's not, in any way, trying to replace open
source Tomcat, nor is it a Java EE app server.  By making it easier to
monitor and manage the open source Tomcat instances people already run in
production via our Tcat Server console, we're helping Tomcat to be easier to
use, more stable, and to perform better in production due to increased
stability and visibility.  In case you want to try it, it's free (as in
beer) to download.  You get the full version.  If you like it enough to
deploy and use it in your production environment, that's when it begins to
cost, but it's free for use in your development environment, test
environment, and staging.  It hooks up to any Tomcat 5.5.x, 6.0.x, and 7.0.x
beta.  We'd like to know what you think of it once you've tried it.

MuleSoft also offers training and consulting on Tomcat, though we're mainly
focused on Tcat and the Mule open source ESB.

Cheers.
--
Jason Brittain
Co-Author, Tomcat: The Definitive Guide (O'Reilly)


On Fri, Sep 24, 2010 at 12:26 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:


 Brian,

 On 9/24/2010 2:29 PM, Brian wrote:
  This company LOOKS like specialists:
 http://www.mulesoft.com/tomcat-support

 I've never heard of Tcat, supposedly the Apache Tomcat app server for
 the enterprise. Beware.

 - -chris



Re: httpd vs. Tomcat performance

2010-03-25 Thread Jason Brittain
Very entertaining reading!  Thanks Chris and Mark for re-benchmarking,
explaining, and giving your opinions on the results.  I'm not entirely sure
how I missed Chris' benchmark results email, almost exactly one year ago
now.  Chris: there are no units on your results numbers, and I'm not seeing
any procedure you used, nor any configurations you used, so I'm not sure how
to interpret the numbers.  It would be great to get more information about
how the benchmark was conducted, which HTTP client was used, and what server
hardware was used.

I tried to write my benchmark such that it is fully documented and
repeatable all the way down to the configuration used on both the client and
the server, etc.  I also wanted to be completely clear and up front about
the specific scenarios I was benchmarking -- there are many more that I
wasn't -- so I wrote the explanations into the text as well.  The results
are, of course, only about the kinds of requests we're benchmarking, and
also about the configuration(s) used.  I did try to think up and benchmark
the most likely use cases for serving typical webapp content, but anyone can
say their webapp isn't like that.  :)  Plus, I tried to write my benchmark
to both inspire others to conduct and publish more benchmarks, and also to
show a detailed example of one that others could modify and re-use.  I was
hoping to see more published benchmarks by now, but each one I find is
really entertaining.

I'm happy to see that Chris' independent benchmark numbers help to show that
it is indeed a myth that Tomcat needs HTTPD in front of it in order to get
good performance serving static files.  And, it's great to see benchmark
results for file sizes that I wasn't able to benchmark.

Mark: I like your text about some of the other reasons people want to use
HTTPD -- it is spot on, and in fact there are so many modules out there for
it, there are countless logical reasons to use it.  Thanks for the
additional analysis.  It helps.

-- 
Jason


On Wed, Mar 24, 2010 at 5:50 PM, Mark Thomas ma...@apache.org wrote:

 On 25/03/2010 00:26, Hassan Schroeder wrote:
  Just to get this into the archives for the next time it comes up
 
  
 http://tomcatexpert.com/blog/2010/03/24/myth-or-truth-one-should-always-use-apache-httpd-front-apache-tomcat-improve-perform
 
 
  because I don't know if the author (a certain mthomas) will mention
  it here.   :-)
 
  (via @springsource on Twitter)

 Chris deserves a lot of the credit. Without his figures, it is just
 opinion.

 I'll have to see if I can get the graph to display as well. It is nice
 to have the hard figures but the graph gives you a quicker handle on the
 data.

 Mark




Re: Centralize settings...

2010-03-02 Thread Jason Brittain
Yes, using Tcat Server profiles is another way.  Create a new profile that
contains
all of the Tomcat configuration you want, and any files you want to add into
your
Tomcat installation (binary or text), and you can apply the profile to any
number
of regular Tomcat installations, potentially across multiple machines.  The
console
allows you a central point of administration of the server profile.  See
this page
for some more details:

http://blogs.mulesoft.org/saving-time-using-tcat-servers-centralized-configuration-management

Tcat Server is commercial software, but it is free for pre-production use.

There are other ways of centrally administering a set of configuration files
for
doing what you're asking about, though I think they're more time consuming,
or they involve some custom programming, or both.  Some examples include:
1. Writing your own Ant build files that use the SSH task to scp files to
the machines
  that should have the files.  This works fine, but involves lots of custom
  programming.
2. Writing a shell script that uses rsync or SSH, which ends up very similar
to #1.
3. Using a more complex configuration management tool such as SystemImager
   http://systemimager.org but it isn't as simple to get it working, it
makes some
   assumptions about what you're trying to do that probably aren't correct,
and it
   doesn't provide any Tomcat specific features, such as server diagnostics,
   webapp deployment, or server restarts.  SystemImager is only for imaging
   whole machines.

I hope this helps.
--
Jason Brittain
Mulesoft http://www.mulesoft.com


On Tue, Mar 2, 2010 at 4:00 AM, co...@sapo.pt wrote:

 Thanks.
 any more suggestion? I red some interesting about Tcat Server Server
 Profiles.

 Best Regards

 Citando Pid p...@pidster.com:


  On 01/03/2010 16:47, co...@sapo.pt wrote:


 Hello!

 Actually we have a lot of different web applications with specific
 settings for each one, namelly: JNDI, SPRING, logging properties, JMS
 properties, etc...
 Some of these webapplication could be deployed in different TOMCAT
 instances. The centralization of these settings would be a major
 improvement to facilitate the setup task and minimize the setup time.

 What is the best way to implement a central file with all of these
 settings?


 Do it at build time.  So many different configuration requirements would
 be very difficult to do otherwise.

 Putting configuration files into a source repository and writing scripts
 to generate multiple outputs is sometimes recommended here.


 p


  Thanks a lot

 Best Regards
 C.o.u.v.a


 -
 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: Access Log /Filter/?

2010-03-02 Thread Jason Brittain
 count higher than 2^31 - 1?


The %b portion of the Combined Log Format is documented to be the size of
the object returned to the client, not including the response headers.
http://httpd.apache.org/docs/1.3/logs.html#common

Thanks.
--
Jason Brittain
Mulesoft http://www.mulesoft.com


Re: tomcat 6.0.24 ssl with windows 7

2010-02-18 Thread Jason Brittain
Roy,

You can try starting Tomcat with one of the following JVM startup switches,
and then inspect the logs after trying to connect to Tomcat via HTTPS to see
what isn't working:

-Djavax.net.debug=all
-Djavax.net.debug=ssl:handshake:data
-Djavax.net.debug=help -- to get a list of options

See this page for a more detailed explanation of these debug options:

http://java.sun.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html#Debug

--
Jason Brittain


On Thu, Feb 18, 2010 at 10:10 PM, Roy Nabel r...@rco.com wrote:

 With jdk1.6.0 and tomcat 6.0.10 ssl works great on windows 7 or windows
 2008 R1 .
 Server.xml ssl fragment
Connector port=443
  protocol=HTTP/1.1
   SSLEnabled=true
   maxThreads=150
   scheme=https
   secure=true
   clientAuth=false
   keystoreFile=C:\jdk1.6.0\bin\ domain_name.keystore
   SSLCertificateKeyFile=C:\jdk1.6.0\bin\ domain_name.keystore
   SSLCertificateFile=C:\jdk1.6.0\bin\domain_name.crt
   SSLCertificateChainFile=C:\jdk1.6.0\bin\ComodoEVSGCCA.crt
   keystorePass=***
   sslProtocol=TLS /
 When you replace tomcat 6.0.10 with tomcat 6.0.24 tomcat does not produce
 logs or connect.
 Any suggestions? Is there some new setting or procedure with 6.0.24?
 Thanks,
 Roy




-- 
Jason Brittain


Re: Trouble with CLIENT-CERT authentication method

2010-02-18 Thread Jason Brittain
Christopher:

Nope.  clientAuth=false means that the webapp's web.xml specifies which
resources require the client certificate.  See the Connector doc page's
description of the accepted values for the clientAuth attribute:

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

clientAuth is a rather confusing name for this attribute since a value of
false makes it appear as though client certs won't be used, which isn't
really how it works.  Less confusing names might be clientAuthChallenge or
clientAuthRequired with values such as always, want, and protected.

--
Jason Brittain


On Thu, Feb 18, 2010 at 1:29 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Kevin,

 On 2/17/2010 7:24 PM, Kevin Mills wrote:
  Sure thing - here is my Connector element:
 
  Connector port=8443 protocol=HTTP/1.1 SSLEnabled=true
 maxThreads=50 scheme=https secure=true
 keystoreFile=.../tomcat.keystore keystorePass=...
 clientAuth=false sslProtocol=TLS

 Stupid question: don't you want clientAuth=true?

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

 iEYEARECAAYFAkt9sR0ACgkQ9CaO5/Lv0PDsVgCgkR1Md/xdnO14MU3ZWMXQz13l
 gCAAniGMybkQIU3VghXUj4G0l0OfrE2w
 =m/Iy
 -END PGP SIGNATURE-

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




-- 
Jason Brittain


Re: Using Context/Manager with custom nested element

2010-01-28 Thread Jason Brittain
You're right that you would need to modify Tomcat's code to do that.
Commons-digester
would need to be told how to read a new nested element.  Without modifying
the code,
you may, however, be able to get away with something like:

Manager className=org.app.MyManager foo=foo bar=bar

.. where your custom MyManager class has String properties foo and bar.

--
Jason Brittain
Mulesoft http://www.mulesoft.com


On Thu, Jan 28, 2010 at 4:31 PM, Martin Grotzke 
martin.grot...@javakaffee.de wrote:

 Hi,

 is it somehow possible to have a custom nested element below the Manager
 element in server.xml/context.xml? E.g.

 Manager className=org.app.MyManager
  FooBar foo=bar/
 /Manager

 where the MyManager class has a property fooBar?

 AFAICS the ContextRuleSet defines what's possible in the Context element
 without any hook - so it seems that there's no possibility to achieve
 this.

 If someone could tell me that I'm wrong with this asumption I would be
 happy! :-)

 Thanx  cheers,
 Martin

 --
 Martin Grotzke
 http://www.javakaffee.de/blog/



Re: AccessLogValve calling order

2009-11-13 Thread Jason Brittain
Hi Chris.

Thanks for diagnosing this problem!  It appears you're right that it logs
only after the session is invalidated (after the request is complete) on a
logout request.  That bug has existed in the code for a very long time,
unnoticed.  The AccessLogValve was initially implemented to log only after
the request processing is complete so that the client never needs to wait
for the logging to complete.  With the new addition of asynchronous logging,
however, it's quite a bit less important to log only when the request is
complete.  It seems like it would help if the access logger could be
configurable to log either before or after handling the request (I'm not
sure logging both before and after makes sense).  Your ideas for %Sr and
%{methodName}rm both seem useful as well, though I think the %{methodName}rm
one has potential security  side effect issues.  So, I would suggest
implementing your first two ideas.  I'm also happy to help you with that, if
you'd like.

Cheers.
--
Jason Brittain
MuleSoft http://www.mulesoft.com


On Fri, Nov 13, 2009 at 2:22 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 All,

 Amazingly enough, I had my first need to use AccessLogValve today, and
 one of the things I wanted to print was the user's session id. No,
 problem: just add %S to the log pattern.

 Well, there is one problem: you can't spit-out the session id for logout
 requests because the logic for the AccessLogValve is:

 if(enabled)
   invoke next valve
   print log message
 else
   invoke next valve

 Note that the request has essentially completed when the log message is
 generated. This makes complete sense as you typically want to log
 /after/ the request so you can do things like find out how many bytes
 were sent, how long the request took, etc.

 In my case, I want to have access to the session id before the session
 is invalidated (which happens in the logout servlet).

 Another option would be to get the requested session id from the request
 (which can only be done with the current AccessLogValve if the client is
 using cookies), though that can be misleading because anyone can request
 anything... it's not guaranteed to use a useful value.

 Anyhow, I was wondering if anyone had any suggestions short of heavily
 modifying the AccessLogValve or developing something from scratch.

 I'd also be happy to provide a patch for the AccessLogValve that add any
 or all of the following capabilities:

 1. Allow log before or after request (or both?)
 2. Add requested session id to standard pattern options (%Sr?)
 or
 3. Add %{xxx}rm to call ServletRequest.xxx and print the result
   (allows ${getRequestedSessionId}rm

 Any comments?

 Thanks,
 - -chris



Re: multiple truststores

2009-10-16 Thread Jason Brittain
Hi Aron.

You do not need two separate Tomcat instances for this.  In your server.xml
file, you'll notice that your HTTPS Connector elements are nested within a
Service element.  Also nested within the Service element is an Engine
element that in turn contains your Host(s) and Context(s), like this
(simplified):

Server
  Service
Connector port=443/
Connector port=444/
Engine
  Host name=yourhostname
Context path=/webapp1/
Context path=/webapp2/
  /Host
/Engine
  /Service
/Server

Tomcat matches up the Connectors with the Engine and the Engine's Hosts and
Contexts.  Tomcat also supports having more than one Service element in
server.xml, which means you can change the structure so that only one
connector is able send requests to one webapp, like this:

Server
  Service name=Catalina
Connector port=443/
Engine
  Host name=yourhostname
Context path=/webapp1/
  /Host
/Engine
  /Service
  Service name=Catalina444
Connector port=444/
Engine
  Host name=yourhostname
Context path=/webapp2/
  /Host
/Engine
  /Service
/Server

--
Jason Brittain
MuleSoft http://www.mulesoft.com


On Fri, Oct 16, 2009 at 8:02 AM, tom...@ehome.hu wrote:

 Hi all,

 I am trying to get to work two web applications with client-side SSL
 Authentication.
 I have set up two connectors (port 443, 444) each with its own truststore.

 Everything works fine so far, only the last step is mising.

 People getting a connection through port 443 should only be able to use
 Web Application 1.
 People getting a connection through port 444 should only be able to use
 Web Application 2.
 How can i configure this?

 I hope I wont need to hae two tomcat instances running for this.

 Thank you and wish you nice WE,
 Aron Katona

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




Re: Accessing a database from a Valve

2009-10-01 Thread Jason Brittain
Sometimes, maybe infrequently, there's a decent reason to implement a small
amount of code outside of the webapp, in the container space.  There are
cases where either modifying the webapp is off limits, or where it would
simplify things to implement it in container space so that it's just always
running, regardless of which webapps are started, stopped, deployed,
undeployed, or redeployed.  Of course, if Tomcat allowed configuring Filters
everywhere it currently allows configuring Valves (as we previously
discussed), then these could be implemented as Filters -- right now Valves
are the only option for doing this.

--
Jason Brittain


On Wed, Sep 30, 2009 at 10:25 AM, shetc sh...@bellsouth.net wrote:


 The person paying me :-)

 I suggested a filter but he prefers a valve even though it ties that
 functionality to Tomcat.
 --
 View this message in context:
 http://www.nabble.com/Accessing-a-database-from-a-Valve-tp25673641p25685437.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


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




Re: Multiple instances using catalina.base

2009-10-01 Thread Jason Brittain
Does your CATALINA_BASE's catalina.properties file have completely stock
settings?  What is common.loader set to in there?  It appears that you
have it set up right, and your startup output shows good environment
variable and Java values.  You should not need to copy the CATALINA_HOME/lib
dir into your CATALINA_BASE.

--
Jason Brittain


On Thu, Oct 1, 2009 at 11:57 AM, Vinicius Carvalho
java.vinic...@gmail.comwrote:

 Hello there! I've followed the instructions on RUNNING.TXT and a great
 presentation by Mark Thomas and Filip Hanik I've found on the net. But
 after creating a directory structure:

 /tomcat-6.0.20 {catalina_home}
  - bin
  - conf
  - webapps
  -work
  - temp
  - lib
  - logs
  - instance-01 {catalina_base}
  -bin
  -logs
  -conf
  -webapps
  -temp
  -work

 I've just added server.xml and catalina.properties to conf, and
 setenv.sh to bin of my catalina_base instance.

 But after exporting the CATALINA_BASE and running startup.sh:


 Using CATALINA_BASE:   /home/vinicius/java/apache-tomcat-6.0.20/instance-01
 Using CATALINA_HOME:   /home/vinicius/java/apache-tomcat-6.0.20
 Using CATALINA_TMPDIR:
 /home/vinicius/java/apache-tomcat-6.0.20/instance-01/temp
 Using JRE_HOME:   /usr/lib/jvm/java-6-sun

 I get this at my catalina.out

 java.lang.ClassNotFoundException: org.apache.catalina.startup.Catalina
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:215)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:390)


 Can't figure out what am I doing wrong. I don't think I need to copy lib
 folder.

 Any ideas?

 Regards



Re: How to check if the client dropped the connection

2009-09-28 Thread Jason Brittain
Hi Andrea.

When the client disconnects, and your servlet tries to write to the output
stream, Tomcat will throw a ClientAbortException (you may have already seen
this):

http://tomcat.apache.org/tomcat-6.0-doc/api/org/apache/catalina/connector/ClientAbortException.html

Tomcat appears to only throw this exception when you either write some bytes
to the output stream or when you flush the output stream, and the client
already closed its end of the connection.  It appears that you could
periodically try flushing the output stream and see if doing so throws this
exception. You can flush after writing any number of bytes, including zero
bytes.  The first time you call flush, it will send the HTTP response
headers to the client, so you would need to first set the headers before
flushing.  That sounds difficult for you to do because you're writing an
image, and one of the headers would be Content-Length, which you probably
don't know until your image is generated.

--
Jason Brittain


On Mon, Sep 28, 2009 at 12:21 AM, aaime74 andrea.a...@gmail.com wrote:


 Hi,
 I'm working on the development of an open source application, GeoServer,
 implementing the Web Map Service specification.
 The specification allows a client to request maps using simple GET
 requests like:


 http://sigma.openplans.org:8080/geoserver/wms?WIDTH=431SRS=EPSG%3A4326LAYERS=tiger-nyHEIGHT=550STYLES=FORMAT=image%2FpngSERVICE=WMSVERSION=1.1.1REQUEST=GetMapEXCEPTIONS=application%2Fvnd.ogc.se_inimageBBOX=-74.01697805908182,40.69808217724622,-73.99567744140603,40.72526393994153

 and the client gets back a PNG with a map of the request area.
 No asynchronism is allowed, the protocol is standardized
 (http://portal.opengeospatial.org/files/?artifact_id=1058) and I have no
 controls over the clients (there are tens of them around, both open source
 and proprietary) which are free to make as many request as they like, in
 whatever order the like.

 By spec we're forced to use a plain request and response approach, but
 we're experiencing a problem with clients making lots of request as the
 user zooms/pans around: basically a request is made, but the user keeps
 on moving, the client drops the older requests (closing the connection in
 face of
 the server) and makes others.
 Unfortunately in the meantime the older requests are still running, drawing
 a map takes
 time and a lot of memory, for example the above request, which is a
 small one btw, allocates a BufferedImage of 700KB. The memory is
 consumed up until the image is encoded out to the stream, which is also
 the moment we finally figure out the client dropped the connection
 (since writing to the servlet output stream fails).

 This is very sub-optimal. Servers like Apache with cgi do kill the cgi
 process the moment the connection is dropped, significantly reducing the
 server load both in terms of CPU and memory consumption.

 Is there any way to check if the client connection is still open using
 only the standard servlet API?
 If not, is there any Tomcat specific approach that might work instead?

 If there is no solution that can be applied at the general servlet
 api level, do you know of any Tomcat specific approach one could use?
 e.g., casting the HttpServletResponse to some Tomcat specific class
 and get some connection information status there?

 Cheers
 Andrea
 --
 View this message in context:
 http://www.nabble.com/How-to-check-if-the-client-dropped-the-connection-tp25641481p25641481.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


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




-- 
Jason Brittain


Re: custom error page during client ssl

2009-09-25 Thread Jason Brittain
Which web browser in particular are you asking about, and what's the network
error it's saying?  And, what did the pop-up say?

My guess is that this is all client-side, and browser specific, so there is
likely no way to customize the message.

--
Jason Brittain


On Fri, Sep 25, 2009 at 8:58 AM, iam techat...@yahoo.com wrote:

 Is there a way to throw a custom error page/msg when the user cancels the
 certificate pop-up on the browser during client SSL ?

 Right now the browser just shows default network error.

 Any prompt help is appreciated.

 Thanks




Re: Problem with Tomcat 6 cluster

2009-09-17 Thread Jason Brittain
Sumedh:

We don't see any attachments on your emails.  You might want to try
attaching it again, but if it didn't come through on the first or second try
then the size of the attachment might have been too large.

Thanks.
--
Jason Brittain


On Wed, Sep 16, 2009 at 10:40 AM, Sumedh Sakdeo sumedhsak...@gmail.comwrote:

 Hi Filip,
 Did log files attached help?

 Thanks,
 Sumedh

 On Mon, Sep 14, 2009 at 2:38 PM, Sumedh Sakdeo sumedhsak...@gmail.com
 wrote:

  Hi Filip,
   Please find the logs in attached file.
 
  Thanks in advance,
  Sumedh
 
 
 
  On Wed, Sep 9, 2009 at 9:22 AM, Filip Hanik - Dev Lists 
  devli...@hanik.com wrote:
 
  what do your logs tell you?
 
  Filip
 
  On 09/08/2009 02:33 AM, Sumedh Sakdeo wrote:
 
  Hello All,
  I have a setup with two tomcat instances(AB). I have
  configured
  an apache web server 2.2 for load balancing and fail over. Setup looks
  fine
  as per the configurations suggested. Let tomcat A be handling some
  request
  at sometime. When tomcat instance(A) goes down, the session is
 replicated
  to
  another tomcat instance(B) successfully. Now tomcat instance B is
  handling
  those requests. Till this point everything goes fine, but when I bring
 up
  tomcat instance(A) and after that tomcat instance(B) goes down, the
  session
  is no longer replicated. What might be the issue? In status page of
  apache
  server I see even if node status is OK session is not replicated to
 fail
  over node for second time.
 
 
  Thanks in advance,
  Sumedh
 



Re: access log and Apache server

2009-09-17 Thread Jason Brittain
Hi Angelo.

I'm assuming you're using mod_proxy_http (you said port 80).  If so, then
there is indeed a way to make this work.

In your Apache HTTPD config, where you're configuring proxying the request,
make sure you add:

ProxyVia On

That will make HTTPD set the x-forwarded-for HTTP request header's value
to the IP address of the client.  This is passed to Tomcat when HTTPD
proxies the request.

Then, where you're configuring the AccessLogValve (usually in your
conf/server.xml file), change the default logging pattern to log the
x-forwarded-for header value, like this:

Host ...
Valve className=org.apache.catalina.valves.AccessLogValve
   directory=logs
   prefix=localhost_access_log.
   suffix=.txt
   pattern=%{x-forwarded-for}i %l %u %t %r %s %b
   resolveHosts=false/
/Host

With that configuration, AccessLogValve will log the x-forwarded-for header
value that is set by Apache HTTPD's mod_proxy, and the remainder of the
logging pattern will be the same as usual.

Cheers.
--
Jason Brittain


On Thu, Sep 17, 2009 at 6:01 AM, Angelo Chen angelochen...@yahoo.com.hkwrote:


 Hi,
 I run tomcat behind an Apache server, Apache will proxy to tomcat from port
 80, this works quite well, but the access log in tomcat shows only
 127.0.0.1, not the real IP:

 127.0.0.1 - - [17/Sep/2009:08:51:21 -0400] POST /sendmsg HTTP/1.1 302 -

 any idea how to have real IP in the log?

 Thanks,
 --
 View this message in context:
 http://www.nabble.com/access-log-and-Apache-server-tp25490807p25490807.html
 Sent from the Tomcat - User mailing list archive at Nabble.com.


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




Re: Maximum Number of processes Exceeded

2009-09-17 Thread Jason Brittain
Hi Sharath.

Can you tell us more about your environment?  For example:
- Your operating system brand and version.
- Your Tomcat version, where you initially got it, how you installed it.
- Your Java VM brand and version, and whether it is a JRE or JDK.
- Your Oracle version.
- Your Oracle JDBC driver version, where you got it, how you installed it.

Please give us as much of the above information as you can.

Thanks.
--
Jason Brittain


On Thu, Sep 17, 2009 at 7:22 PM, Sharath Babu S S S
sharath.b...@solix.comwrote:


 Hi,

   We are using Tomcat Server and oracle database. After running for a while
 we are getting this error in the log files.
Its taking both inactive and active processess. how to remove the
 inactive processess so that we dont have this error.

 Debug: makeConnection(Database)

 java.sql.SQLException: ORA-00020: maximum number of processes (300)
 exceeded



at
 oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:283)

at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:278)

at
 oracle.jdbc.driver.T4CTTIoauthenticate.receiveOsesskey(T4CTTIoauthenticate.java:294)

at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:357)

at
 oracle.jdbc.driver.PhysicalConnection.init(PhysicalConnection.java:439)

at oracle.jdbc.driver.T4CConnection.init(T4CConnection.java:165)

at
 oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35)

at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801)

at
 org.apache.tomcat.dbcp.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38)

at
 org.apache.tomcat.dbcp.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:294)

at
 org.apache.tomcat.dbcp.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:974)

at
 org.apache.tomcat.dbcp.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:84)

at
 org.apache.tomcat.dbcp.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:96)

at
 org.apache.tomcat.dbcp.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)

at utils.ConnectionBroker.makeConnection(ConnectionBroker.java:256)

at utils.ConnectionBroker.makeConnection(ConnectionBroker.java:76)

at beans.PurgeProcess_T.run(PurgeProcess_T.java:166)


 With Regards
 Sharat Babu Shravanam