Re: Comet in tomcat

2007-03-22 Thread Peter Kennard
Curious - with Comet I assume you can now have multiple servlet requests share a single thread if they are written cooperatively? I have just written a client side that does this with NIO. I am working on a system were a lot of small requests and body chunks are being processed. PK At

Re: Custom error page on Tomcat 6

2007-03-20 Thread Peter Kennard
A refinement on this question I am interested in, that isn't so googleable :) Can one make a class that spits out the error page that recieves the code number as input, (and/or maybe an Exception handle if the servelet threw an exception which caused the error) and an OutputStream to write

RE: Custom error page on Tomcat 6

2007-03-20 Thread Peter Kennard
At 16:58 3/20/2007, you wrote: From: Peter Kennard [mailto:[EMAIL PROTECTED] Subject: Re: Custom error page on Tomcat 6 Can one make a class that spits out the error page that recieves the code number as input, (and/or maybe an Exception handle if the servelet threw an exception which

Re: Explicit header definition

2007-03-18 Thread Peter Kennard
Does no commnent on this mean: This is not possible? or: Of course, it is obvious you can, as stated *here*? PK At 15:24 3/16/2007, you wrote: If I want to remove or alter headers that are the default for a specific servlet, webapp or instance of tomcat, how might I? Either

Re: Explicit header definition

2007-03-18 Thread Peter Kennard
It might mean don't hi-jack threads. Mark ??? I thought I created a new one for this question. (different Subject:) At 10:57 3/18/2007, you wrote: Peter Kennard wrote: Does no commnent on this mean: This is not possible? or: Of course, it is obvious you can, as stated *here

Re: Explicit header definition

2007-03-18 Thread Peter Kennard
Thanks - is there a good doc around on howto write a tomcat filter :) ? It sure would be nice to have default headers defined in web.xml :) PK At 16:55 3/18/2007, you wrote: for each servlet / jsp where you want to change the default headers, write a filter, which changes the headers, include it

Re: Explicit header definition

2007-03-18 Thread Peter Kennard
I found this: http://www.javaworld.com/javaworld/jw-06-2001/jw-0622-filters.html - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: Explicit header definition

2007-03-18 Thread Peter Kennard
It looks like a Filter receives the same ServletResponse object as what is passed back from the servlet. Are their methods on that that allow you to access the Date: and Server: headers (or the whole big header string)? PK At 16:55 3/18/2007, you wrote: for each servlet / jsp where you

Explicit header definition

2007-03-16 Thread Peter Kennard
If I want to remove or alter headers that are the default for a specific servlet, webapp or instance of tomcat, how might I? Either programmtically or in a config file. ie: - remove or replace the Date: header. - remove or replace the Server: header. The reasoning is for servicing a

Re: Is better one or more Tomcat instances per machine

2007-03-14 Thread Peter Kennard
Heh - ask Murphy about that :) just spawn a thread set priority high and loop forever. At 10:23 3/14/2007, you wrote: On 14/03/2007, at 3:17 PM, Peter Crowther wrote: From: Leon Rosenberg [mailto:[EMAIL PROTECTED] There is no real advantage in multi-instancing. A minor advantage is that if

Stalled Servlet Handling?

2007-03-14 Thread Peter Kennard
Curious with the talk about reliability. Socket timouts will abort waiting on reads and writes that take too long. But if lets say a servlet takes an overly long time to process something without reading or writing, is there a high priority watchdog thread in tomcat which will monitor how

Re: Rationale for makeing Invoker harder to user

2007-03-14 Thread Peter Kennard
I am a newbee here but as a work around, I would think you could have a master servlet and it could scan and load all the servlets in the directory into a map, and then dispatch requests to them from /* (having them properly initialized in another question) I would be interested in the

Re: Rationale for makeing Invoker harder to user

2007-03-14 Thread Peter Kennard
At 20:38 3/14/2007, you wrote: http://tomcat.apache.org/faq/misc.html#evil -Tim All very good points escpecially since it will load classes outside the webapps sandbox. Definately evil. What I would probably do in the large # of servlets situation for a single webapp during development is

RE: Can one map a servlet to a specific connctor?

2007-03-13 Thread Peter Kennard
Thanks - I assume any way you want would include the port? I'll have to dive more into Filters. At 01:15 3/13/2007, you wrote: From: Peter Kennard [mailto:[EMAIL PROTECTED] Subject: Can one map a servlet to a specific connctor? On a stand alone tomcat with more than one connector (port

RE: Can one map a servlet to a specific connctor?

2007-03-13 Thread Peter Kennard
Damn! I missed that :) Thanks. I assume this is taking it from where the hit arrives in at the server and not the HTTP headers passed in (which could be anything) At 01:32 3/13/2007, you wrote: From: Peter Kennard [mailto:[EMAIL PROTECTED] Subject: Re: Can one map a servlet to a specific

RE: Can one map a servlet to a specific connctor?

2007-03-13 Thread Peter Kennard
wrote: Damn! I missed that :) Thanks. I assume this is taking it from where the hit arrives in at the server and not the HTTP headers passed in (which could be anything) At 01:32 3/13/2007, you wrote: From: Peter Kennard [mailto:[EMAIL PROTECTED] Subject: Re: Can one map a servlet

RE: Can one map a servlet to a specific connctor?

2007-03-13 Thread Peter Kennard
This could be the ticket! At 11:53 3/13/2007, you wrote: You could configure proxyPort in your Connector to some value that you could use as a flag for your particular environment. This will override the header value returned by getServerPort(). Don't know if there would be any undesirable

RE: Can one map a servlet to a specific connctor?

2007-03-13 Thread Peter Kennard
Try ServletRequest.getLocalPort() rather than getServerPort(). Yes exactly, thanks - that is an addition to the api after the book I read :) eclipse auto-complete and the sun website is your friend :) * Part of all these questions is I am looking to implement a servlet subclass which

Re: BUG? - Mysterious chunked behavior

2007-03-12 Thread Peter Kennard
Aaack - I really REALLY have to oppolgize. One of the people I manange gave me the dumper client, and I went through it and the problem is there :| I'm really really sorry if I caused any flamage and wasted anyone's time. I respect you people for hammering on me about it. I'll try to audit

Re: BUG? - Mysterious chunked behavior

2007-03-12 Thread Peter Kennard
Not that anyone cares, but the apparent lost chunk problem was caused by the header scanner in the dumper client. He created an InputStreamReader() and it apparently reads exactly two lines ahead into it's buffer. Since my test case was one line per chunk it would reliably drop (have in its

Re: Keep Alive handling

2007-03-12 Thread Peter Kennard
Does Tomcat support Keep Alive, as a stand alone server, for multiple Client POST requests to different servlet paths where both request and response are Transfer-Encoding: chunked? Is there a definition somewhere of when tomcat will drop a connection when keep-alive is specified? Thanks.

Re: Keep Alive handling

2007-03-12 Thread Peter Kennard
Anyway - I answered my own question. I wrote a test, Keep Alive works fine with chunked content. If anyone wants the test code let me know. (should I post it?) It is small - about 150 lines worth, all java. PK Does Tomcat support Keep Alive, as a stand alone server, for multiple Client

Re: Keep Alive handling

2007-03-12 Thread Peter Kennard
I answered my own question here: The client must send the *complete* sequence \r\n0\r\n\r\n or tomcat *will* hang attempting to read the last \r\n after the last zero length chunk No one including myself caught this. PK -

Can one map a servlet to a specific connctor?

2007-03-12 Thread Peter Kennard
On a stand alone tomcat with more than one connector (port) Is it possible to map a servlet to only one or a subset of connectors? Thanks PK - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail:

Re: Can one map a servlet to a specific connctor?

2007-03-12 Thread Peter Kennard
I guess a corrollary question to this would be. Can I determine the connector port connected to for a request from service() I don't see it in the servlet API but am willing to access somthing tomcat specific. PK At 21:57 3/12/2007, you wrote: On a stand alone tomcat with more than one

Re: BUG? - Mysterious chunked behavior

2007-03-11 Thread Peter Kennard
That is not an error, the last item in the (for(;;here)) is executed after the loop code is executed - the side effect only has effect within the for statement. (;;(side effect only visible inside statment in here)) ie: for(;;++i) ad for(;;i++) are equivalent ie: for(;;val = ++i) ad

Re: Keep Alive handling

2007-03-11 Thread Peter Kennard
What if you use a non-chunked request? You asked already and the response was that TC basically doesn't handle chunked requests. TC handles chunked requests in all ways except that it doesn't have a methodology in the servlet API (EOFException etc) for notifying you if you try to read

Re: BUG? - Mysterious chunked behavior

2007-03-11 Thread Peter Kennard
If you file a bug for this, or for the issue you describe in your other thread, I will immediately resolve them as invalid, obviously. Curious you mean by this? What is obvious? Tomcat 5.5 and 6 do make chunked replys to HTTP1.1 requests that do not explicitly set content-length if one

Re: BUG? - Mysterious chunked behavior

2007-03-11 Thread Peter Kennard
allocating a huge buffer, one would want to use the chunked response. PK At 15:13 3/11/2007, you wrote: Hi! Yes ofcourse, you are right, I was to hasty. Does it work if you add an os.flush() before the loop? /Per Jonsson Peter Kennard skrev: That is not an error, the last item in the (for(;;here

Re: BUG? - Mysterious chunked behavior

2007-03-11 Thread Peter Kennard
3/11/2007, you wrote: On 3/12/07, Peter Kennard [EMAIL PROTECTED] wrote: Unless dropping the first data filled chunk is defined as proper and documented, and supported, behavior, I would consider this a bug. As I said in my previous post, so far, none of your claims correspond to the actual

Keep Alive handling

2007-03-10 Thread Peter Kennard
for HTTP1.1 (in tomcat 6) Does tomcat handle keep alive (ie: keeping a connection open for subsequent requests) If so under what circumstances is the connection closed (or kept open)? Sending chunked content, with a terminal \r\n0\r\n will cause the connection to be disconnected. As does

BUG? - Mysterious chunked behavior

2007-03-10 Thread Peter Kennard
I have some real mysterious behavior, it seems the first chunk just doesn't make it into the output. Doesn't matter how long or short it is. Seems like a BUG unles I'm doing something wrong. /* in my real tiny test servlet */ public void service( ServletRequest req,

Re: Keep Alive handling

2007-03-10 Thread Peter Kennard
and is the default value if no header is supplied. As expected this has no (different) effect. -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Peter, Peter Kennard wrote: for HTTP1.1 (in tomcat 6) Does tomcat handle keep alive (ie: keeping a connection open for subsequent requests) If so under

RE: Multiple Instances on one Machine

2007-03-09 Thread Peter Kennard
I have a related issue. (should the be a separate thread?) I had two instances of Tomcat5.5 on a windows XP Pro Workstation. And I had a batch file I got off the web to launch the second instance using a shared CATALINA_HOME but each with a different CATALINA_BASE When I upgraded to Tomcat6

Re: Is APR worth it (for me?)

2007-03-08 Thread Peter Kennard
after heavy traffic may hve opened more than configured. Anyway that is what I would do ;^ If by multiplexing you thought interleaving routed packets for simultaneous hits on one pipe I didn't mean that. PK At 02:41 3/8/2007, you wrote: Peter Kennard wrote: Doesn't AJP multiplex traffic

Console Logging

2007-03-07 Thread Peter Kennard
I have been looking about :) I have a simple tomcat instance with one webapp in it. I want to turn on high level - type logging to the console for internal debugging messages so I know what is happening. I gather I have to put a log4j.properties file in common/classes I put one I

Re: Console Logging

2007-03-07 Thread Peter Kennard
I did what it says here http://minaret.biz/tips/log4j.html but no results. I havn't found other decent instructions yet. PK - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: Console Logging

2007-03-07 Thread Peter Kennard
Thanks will check out after lunch. I definately want to use the log4j for our apps. I am assuming the Tomcat internals have very good debug log info like why sockets are closed or timed out etc (If I can get them activated :) I dread finding out it might be a windows sockets bug :| PK At

RE: Console Logging

2007-03-07 Thread Peter Kennard
to the configured settings when you're done. I can send you (or anyone else who is interested) the sources and/or war. PM me off-list. Tim -Original Message- From: Peter Kennard [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 07, 2007 10:59 AM To: Tomcat Users List Subject: Re

Re: Console Logging

2007-03-07 Thread Peter Kennard
BTW found the bug it wasn't in tomcat ;^ but in the client :) In any case the logger info was very helpful! PK At 13:18 3/7/2007, you wrote: I did what it says here http://minaret.biz/tips/log4j.html but no results. I havn't found other decent instructions yet. PK try this one:

Re: Location to override global error-page

2007-03-07 Thread Peter Kennard
I would actually LOVE to have errors directed to a servlet like interface to reply to the client. In my case we are going to be routing requests from a lot of mobile devices using a compressed form for traffic. PK At 14:05 3/7/2007, you wrote: This seems basic, but apparently not. A

Re: Is APR worth it (for me?)

2007-03-07 Thread Peter Kennard
Doesn't AJP multiplex traffic, that is queued up requests are serialized through one connection that remains connected and it switches between servlets on the receiving end? and recycles the execution thread? At 19:19 3/7/2007, you wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Rémy,

Re: Detecting terminal HTTP chunk

2007-03-05 Thread Peter Kennard
At 04:53 3/5/2007, you wrote: Peter Kennard wrote: At 23:07 3/4/2007, you wrote: But since you can't send the response without finishing the reading of the input stream - the entire question doesn't seem to make sense. If the input pipe is slow (ie: cellphone with slow pipe) and you

Re: Detecting terminal HTTP chunk

2007-03-05 Thread Peter Kennard
typo, if anyone read it, I meant IPV6 :) PK - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Detecting terminal HTTP chunk

2007-03-04 Thread Peter Kennard
Hmm - when reading HTTP1.1 chunked data, is there a way of detecting reciept of the terminal 0 chunk in a servlet ? Googling about, Apparently this does not report an EOD exception (as I would expect) because some people have been using post last chunk data for server internal out-of band

Re: Detecting terminal HTTP chunk

2007-03-04 Thread Peter Kennard
I guess the general form of this question is, with HTTP1.1 chunked input, how do I read a chunk at a time, which requires I know the length of the chunk before calling read() so if I attempt to read more than the length of the chunk so I can process it immediately instead of waiting for

Re: Detecting terminal HTTP chunk

2007-03-04 Thread Peter Kennard
without finishing the reading of the input stream - the entire question doesn't seem to make sense. -Tim Peter Kennard wrote: I guess the general form of this question is, with HTTP1.1 chunked input, how do I read a chunk at a time, which requires I know the length of the chunk before calling

Re: Detecting terminal HTTP chunk

2007-03-04 Thread Peter Kennard
At 23:07 3/4/2007, you wrote: But since you can't send the response without finishing the reading of the input stream - the entire question doesn't seem to make sense. If the input pipe is slow (ie: cellphone with slow pipe) and you are sending a transaction where the first part of it

Writing My Own Connector

2007-03-02 Thread Peter Kennard
I want to write my own protocol handler which I can configure as a connector. I want it to do something along the lines of AJP - packet hits in, servlet hits out. Connector port=x protocol=com.mydom.mypackage.MyProtocolHandler / A - should I be posting this to a dev list? B - I want

Re: Writing My Own Connector

2007-03-02 Thread Peter Kennard
off to servlets. At 15:53 3/2/2007, David Delbecq wrote: Peter Kennard a écrit : I want to write my own protocol handler which I can configure as a connector. I want it to do something along the lines of AJP - packet hits in, servlet hits out. B - I want a good reference on what class I

Re: Writing My Own Connector

2007-03-02 Thread Peter Kennard
would definately be someting to do. one has to wade through a lot of stuff to get to that point :) I have to find out where what defines a connector is, how it is installed and configured ... So what people are saying is get the source and build it as step #1 ?? At 16:38 3/2/2007, you wrote:

Re: Writing My Own Connector

2007-03-02 Thread Peter Kennard
); mypool.reclaim(response); } At 23:03 3/2/2007, you wrote: Peter Kennard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] would definately be someting to do. one has to wade through a lot of stuff to get to that point :) I have to find out where what defines a connector is, how

Re: HTTP plus

2007-02-28 Thread Peter Kennard
Ok - continuing. Is it possible to use a GenricServlet to do basicly this. service(req,res) { for(;;) { readSome(req.getInputStream()); if(writeSome(req.getOutputStream()) { req.flushBuffer(); } else { break; } } } That

Re: HTTP plus

2007-02-28 Thread Peter Kennard
it. Peter K. At 06:36 2/28/2007, Georg Sauer-Limbach wrote: If you don't want to deal with HTTP, you should not use the Servlet API (which is the Java abstraction of HTTP) at all. You can do the indicated code with generic sockets, no need to mind about Servlets altogether. Georg Peter Kennard

Re: HTTP plus

2007-02-28 Thread Peter Kennard
Excuse the naivety but I thought you couldn't open a socket with J2EE. I was told (I think on this list) that you need to use a JCA to make the connection. If this is true I want to know about this. I am so far under the impression if you needed to connect with another protocol in a

Re: HTTP plus

2007-02-28 Thread Peter Kennard
Yes - I'm assuming J2ee facilities. At 06:57 2/28/2007, you wrote: That's certainly correct, raw socket communication is not J2EE. Peter didn't mention, however, that J2EE was a necessary precondition for his case. On the contrary, this communication with some binary messages sent over sockets

RE: HTTP plus

2007-02-28 Thread Peter Kennard
At 09:42 2/28/2007, you wrote: Back to the original issue: sounds like you really need to develop your own connector to handle your proprietary protocol, rather than trying to twist one of Tomcat's HTTP or AJP connectors into doing your bidding. What we do is to be determined. What I want to

Servlet Lifecycle

2007-02-28 Thread Peter Kennard
So if a servlet is lets say in a long transaction, sending a huge data set, and the manager is wanting to undeploy it, Does it get notified while the long lasting servlet thread is sending data so if one wants to abort it, you can truncate writing in a controlled way and clean up the mess

RE: HTTP plus

2007-02-28 Thread Peter Kennard
OK - persistance has paid off :) I now have a little client that with a small HTTP header will connect with a servlet, and run a persistent telnet like session with it until either someone times out or decides to quit. The only requirement is that you initiate the connection with HTTP

Re: HTTP plus

2007-02-27 Thread Peter Kennard
I guess I'll answer my own question here after some testing and research That is: If you override the service() method on servelet all you need is a service name and a path to the servlet followed by two newlines as the minimal header. ie: X /Z\n\n for the most minimal header. X being

HTTP plus

2007-02-26 Thread Peter Kennard
Was this last message of mine just too naive :) Should I break it into smaller parts? Still curious :) Peter K. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional