tomcat calls StandardContext.stop() from StandardContext.start()

2008-05-02 Thread Sebastiaan van Erk
Hi, I'm having a problem I've never had before, and I can't for the life of me figure out what's going on. My web application is calling StandardContext.stop() from StandardContext.start() (6.0.16). Below is the full trace. If any other information is needed, please let me know. (I'm

Re: tomcat calls StandardContext.stop() from StandardContext.start()

2008-05-02 Thread Sebastiaan van Erk
Hi, It turns out I forgot to fill in the context name in the project properties of the sysdeo plugin and it was using context name . Ooops! I would of course prefer an error message instead of the strange behavior described below. :-) Regards, Sebastiaan Sebastiaan van Erk wrote: Hi

getRemotePort() returns -1 sometimes

2008-04-02 Thread Sebastiaan van Erk
Hi, I have a tomcat servlet set up in Tomcat 6.0.16 behind Apache 2.2.4 with mod_proxy and a ProxyPass with ajp:// to a servlet. Now it sometimes happens to me that a call of request.getRemotePort() in the doPost() method of the servlet returns -1. When this happens it keeps happening until

Re: Tomcat freezes up

2007-08-16 Thread Sebastiaan van Erk
It seems very unlikely to me that the problem is in the Tomcat code. It is very widely deployed and any deadlocks would be found relatively quickly unless you use a very obscure setup. Did you do any standard deadlock debugging? E.g., thread dumps and deadlock analysis when the freeze occurs,

Re: Unsubscribe me please

2007-08-06 Thread Sebastiaan van Erk
Yes, somebody can. In fact, that somebody is YOU! In every single email from this list there is a header telling you how to unsubscribe. Even better, when you go to the Tomcat home page, there is a link Mailing Lists, and it too tells you how to unsubscribe! Regards, Sebastiaan [EMAIL

Re: COMET - Delays in output

2007-07-30 Thread Sebastiaan van Erk
would send them. With firefox the tamper data plugin allows you to see the exact request (so you can try it outside of a browser). Regards, Sebastiaan Sebastiaan van Erk wrote: What kind of environment are you testing in? Does the servlet run on your local development machine or over the network

Re: COMET - Delays in output

2007-07-27 Thread Sebastiaan van Erk
What kind of environment are you testing in? Does the servlet run on your local development machine or over the network. Are there possibly transparent proxies between the two endpoints? You could try testing with network tools such as netcat to debug what's happening. Regards, Sebastiaan

Re: COMET with Tomcat 6.0.13 causes 405 Error

2007-07-25 Thread Sebastiaan van Erk
Check to make sure that it's really running the Http11NioProtocol, it should say so in the logs when tomcat starts. Furthermore, what kind of environment are your running in? Make sure that the CometProcessor class is not in your classpath twice, This can be caused by build tools which use

read data/infinite loop problem with comet

2007-06-26 Thread Sebastiaan van Erk
Hi, I'm having a problem reading data in my Comet servlet. In the BEGIN event I have the following loop: while (request.getInputStream().available() 0) { // log that in read loop, log available() // read some data } // log that read loop is done, log available()

Re: read data/infinite loop problem with comet

2007-06-26 Thread Sebastiaan van Erk
Hi Christopher, Thanks for the reply. :-) Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sebastiaan, Sebastiaan van Erk wrote: I'm having a problem reading data in my Comet servlet. In the BEGIN event I have the following loop: while (request.getInputStream

Re: read data/infinite loop problem with comet

2007-06-26 Thread Sebastiaan van Erk
don't know why) of the error, and the Poller goes in an infinite loop. Does anybody know how I can solve this problem? Regards, Sebastiaan Sebastiaan van Erk wrote: Hi, I'm having a problem reading data in my Comet servlet. In the BEGIN event I have the following loop: while

Re: read data/infinite loop problem with comet

2007-06-26 Thread Sebastiaan van Erk
adequately clear for others. Regards, Sebastiaan Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sebastiaan, Sebastiaan van Erk wrote: Thanks for the reply. :-) Okay, this is what I get for responding to a question about Comet, something about which I have

Re: read data/infinite loop problem with comet

2007-06-26 Thread Sebastiaan van Erk
-Original Message- From: Sebastiaan van Erk [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 26, 2007 6:53 PM To: Tomcat Users List Subject: Re: read data/infinite loop problem with comet Hi all, I looked in the Tomcat source code (6.0.13), and I really do not understand how I'm supposed

Tomcat, Comet and Apache

2007-06-23 Thread Sebastiaan van Erk
pages (php, etc) from Apache? My preferred solution however would leave Apache as the main server since the sheer number of useful modules for apache (rewrite, etc.) makes it very nice to have it in front of Tomcat. Any tips or ideas are welcome! Thanks, Sebastiaan van Erk

Re: Tomcat, Comet and Apache

2007-06-23 Thread Sebastiaan van Erk
, Sebastiaan |Filip Hanik - Dev Lists wrote: my only guess would be to turn off buffering in mod_proxy, if that is possible Filip Sebastiaan van Erk wrote: Hi all, I wrote a Comet servlet for Tomcat, and am ready to deploy it. However, my normal mode of deployment, namely Apache + mod_jk

Re: NIOSelector busy wait

2007-06-08 Thread Sebastiaan van Erk
at least until a stable JDK is released which fixes the bug; APR uses native selection, does it not? Regards, Sebastiaan Sebastiaan van Erk wrote: Filip Hanik - Dev Lists wrote: Sebastiaan van Erk wrote: Hi, Filip Hanik - Dev Lists wrote: it will return 0 after the timeout has expired

Re: NIOSelector busy wait

2007-06-01 Thread Sebastiaan van Erk
this problem consistently: the Tomcat poller thread goes into a busy loop with the selector returning 0. Could be I'm forgetting to do something which causes this, but I haven't found a way to solve the problem yet. Regards, Sebastiaan Filip Sebastiaan van Erk wrote: Hi, I have a problem

tomcat 6.0.13 and maven 2

2007-05-15 Thread Sebastiaan van Erk
Hi, I noticed the tomcat web pages are updated and the 6.0.13 version is available. With maven I was able to use 6.0.10 with the following repository: repository idtomcat-repository/id urlhttp://tomcat.apache.org/dev/dist/m2-repository//url /repository

Re: multiple Tomcat on one host with multiple IPs using the same port

2007-05-10 Thread Sebastiaan van Erk
The shutdown listener binds hardcoded on 127.0.0.1. Make sure they're on a different port for each tomcat instance. Regards, Sebastiaan Hassan Schroeder wrote: On 5/10/07, Ran Li [EMAIL PROTECTED] wrote: The problem I have now is once I started the first Tomcat I could not start any of

Re: NIOSelector busy wait

2007-05-04 Thread Sebastiaan van Erk
or email and destroy the original message without making a copy. Thank you. - Original Message - From: Sebastiaan van Erk [EMAIL PROTECTED] To: Tomcat Users List users@tomcat.apache.org Sent: Thursday, May 03, 2007 1:07 PM Subject: NIOSelector busy wait Hi, I have a problem

comet: async close exceptions

2007-05-04 Thread Sebastiaan van Erk
Hi, Due to the latest changes (r535030) to the Comet code I'm getting the AsyncCloseExceptions again, meaning that my synchronization which worked before is not correct anymore. What I am doing is synchronizing all access to the response output stream and synchronizing with the same lock

Re: comet: async close exceptions

2007-05-04 Thread Sebastiaan van Erk
Filip Hanik - Dev Lists wrote: Filip Hanik - Dev Lists wrote: Sebastiaan van Erk wrote: Hi, Due to the latest changes (r535030) to the Comet code I'm getting the AsyncCloseExceptions again, meaning that my synchronization which worked before is not correct anymore. What I am doing

Re: comet: async close exceptions

2007-05-04 Thread Sebastiaan van Erk
Hi, I seemed to have forgotten to synchronize a single event.close() which triggered the problem (but only after yesterday's changes). It is actually working again now... Regards, Sebastiaan Sebastiaan van Erk wrote: Filip Hanik - Dev Lists wrote: Filip Hanik - Dev Lists wrote

Re: Comet: problem with request.getParameter() in Comet POST requests

2007-05-03 Thread Sebastiaan van Erk
Hi, I am working on a scenario with browsers as clients. The client does requests with JavaScript code like this: req = new XMLHttpRequest(); req.onreadystatechange = handler; req.open(post, /somecontext/somecometservlet/somerequest?param1=val1param2=val2 ); req.send(null); We

NIOSelector busy wait

2007-05-03 Thread Sebastiaan van Erk
Hi, I have a problem that sometimes the NIO selector goes into a busy wait loop. In line 1430 the code of NIOEndpoint.java, keyCount = selector.select(selectorTimeout); select keeps returning 0 without waiting. I'm running on the latest trunk version of tomcat 6,

Re: NIOSelector busy wait

2007-05-03 Thread Sebastiaan van Erk
, Sebastiaan so far I haven't seen the behavior you've explained. Filip Sebastiaan van Erk wrote: Hi, I have a problem that sometimes the NIO selector goes into a busy wait loop. In line 1430 the code of NIOEndpoint.java, keyCount = selector.select(selectorTimeout

Re: Comet: problem with request.getParameter() in Comet POST requests

2007-05-02 Thread Sebastiaan van Erk
Hi, Wouldn't every application which isn't as dumb as the chat example (which does not care about the content it reads but simply passes it back to it's clients) need to implement it's own mechanism to check whether there is enough input available to start parsing a chunk of data? Either

Re: Comet: problem with request.getParameter() in Comet POST requests

2007-05-02 Thread Sebastiaan van Erk
Hi, How about not arguing about everything ? It is your fault when parameters are not processed. Tomcat will process parameters with comet. No, Comet will not process parameters in POST requests if you call getParameter() in the BEGIN event and the request body has not yet arrived.

Re: Comet: problem with request.getParameter() in Comet POST requests

2007-05-02 Thread Sebastiaan van Erk
Hi, I have no problem to get POST parameter with NIO Connector at my begin.event. With APR connector I also have POST parameter problems. Strange! A my first request I get the POST parameter. The POST message close the event and I got an exception after the end event. It's a race

How can I share an object between an application and its embedded tomcat?

2007-05-01 Thread Sebastiaan van Erk
Hi, I have an application which needs to start an embedded Tomcat en share an object instance with a servlet which will run in the embedded tomcat servlet container. One solution is to use a static field of a class, but I prefer a direct way to do this, without using static fields.

Re: Exception with Comet in Tomcat with high load

2007-05-01 Thread Sebastiaan van Erk
method calls either in stream either in comet event) So, the question is: Is this a bug or simply I have reached the scalability limit for my box? Cheers, Martin On 4/30/07, Sebastiaan van Erk [EMAIL PROTECTED] wrote: Hi, I had the same problems. It was a synchronization issue with me. What I

Re: Comet and Async Servlets - Architecture Question

2007-05-01 Thread Sebastiaan van Erk
Praveen Balaji wrote: The last few days I have been evaluating using CometProcessor to work like an Async Servlet for me. I pick up the CometEvent object on BEGIN event and process the whole request asynchronously. When I am done, I close the I/O stream. I would like to know what the Tomcat

Re: Exception with Comet in Tomcat with high load

2007-04-30 Thread Sebastiaan van Erk
Hi, I had the same problems. It was a synchronization issue with me. What I did was make a synchronized output stream wrapper (see attached file) which wraps all access to the output stream, and I synchronized on this output stream whenever I called event.close() on the Comet event

Re: how to close a comet request outside of an event?

2007-04-28 Thread Sebastiaan van Erk
Hi, The request, wait, async response + close pattern seems to be a pretty common use case though, especially with server side push (AJAX), so it would still be good to have a solution that works well allways. Yes, and for this you don't need Comet, you need Asynchronous Servlets they are

Re: how to close a comet request outside of an event?

2007-04-27 Thread Sebastiaan van Erk
Hi, I've been thinking about this a bit more, and I understand why normally the response.close() should not go to the TCP layer: I'd forgotten all about request pipelining. However, in my case, the request has an explicit Connection: close header. Would not this case warrent an immediate

Re: how to close a comet request outside of an event?

2007-04-27 Thread Sebastiaan van Erk
Hi, * Is it possible, somehow, to end a request asynchronously (that is, outside the event method)? Because I keep getting Out of file descriptor errors since the END events come so terribly late after I do the close(). you'd still get too many open files errors even if it did close since

how to close a comet request outside of an event?

2007-04-26 Thread Sebastiaan van Erk
Hi, I the following Comet question; due to a server event (not a comet event), I want to write some data to a client request and finish the request. Currently I write the data and then call OutputStream.close() on the response output stream. This seems to work, except that it takes a long

Re: how to close a comet request outside of an event?

2007-04-26 Thread Sebastiaan van Erk
with events. Also, it may have a clue I'm missing. http://issues.apache.org/bugzilla/show_bug.cgi?id=42198 Also, check with the trunk to make sure you're able to reproduce your defect. Praveen -Original Message- From: Sebastiaan van Erk [mailto:[EMAIL PROTECTED] Sent: Thursday, April 26

comet: missing initial READ event?

2007-04-26 Thread Sebastiaan van Erk
Hi, The CometProcessor seems to sometimes miss the initial READ event. THE OBSERVED BEHAVIOR: The client sends a request to the server. This request (a POST request) is sent in the initial TCP packet. The initial packet also contains some data (a boundary, Content-Disposition: form-data

Re: comet: missing initial READ event?

2007-04-26 Thread Sebastiaan van Erk
Rémy Maucherat wrote: On 4/26/07, Sebastiaan van Erk [EMAIL PROTECTED] wrote: The http://tomcat.apache.org/tomcat-6.0-doc/aio.html documentation clear states that I am not allowed to read from the input stream outside of the READ event; thus I'm not allowed to read in the BEGIN event. So

Re: comet: missing initial READ event?

2007-04-26 Thread Sebastiaan van Erk
, as the documentation suggests it should be. Regards, Sebastiaan Sebastiaan van Erk wrote: Rémy Maucherat wrote: On 4/26/07, Sebastiaan van Erk [EMAIL PROTECTED] wrote: The http://tomcat.apache.org/tomcat-6.0-doc/aio.html documentation clear states that I am not allowed to read from the input stream

Re: comet: missing initial READ event?

2007-04-26 Thread Sebastiaan van Erk
Rémy Maucherat wrote: On 4/26/07, Sebastiaan van Erk [EMAIL PROTECTED] wrote: Note that there really IS a bug here: request.getInputStream().available() returns 0 in the BEGIN event, so I cannot test if the data is already available there. However, the API seems cleaner to me anyway if you only

Re: comet: missing initial READ event?

2007-04-26 Thread Sebastiaan van Erk
that, as it is the same as a servlet doing a read during the service method. Filip Sebastiaan van Erk wrote: Hi, The CometProcessor seems to sometimes miss the initial READ event. THE OBSERVED BEHAVIOR: The client sends a request to the server. This request (a POST request) is sent in the initial TCP

Re: how to close a comet request outside of an event?

2007-04-26 Thread Sebastiaan van Erk
, they are a little hard to read :) Filip Sebastiaan van Erk wrote: Hi, The reason I get the exceptions on the Tomcat server side seems to be because I close the socket on the client at the same time I try to close it on the server, causing two unsynchronized closes on the OutputStream. I don't really

Comet: problem with request.getParameter() in Comet POST requests

2007-04-26 Thread Sebastiaan van Erk
Hi, If the body of the POST request is not present at the time of the getParameter() call, it returns null even if the parameter value is set. How to reproduce: 1) Send the headers of a POST request to the CometProcessor. 2) in the event() method of the CometProcessor use getParameter(); it

Re: Comet: problem with request.getParameter() in Comet POST requests

2007-04-26 Thread Sebastiaan van Erk
Rémy Maucherat wrote: On 4/26/07, Sebastiaan van Erk [EMAIL PROTECTED] wrote: Hi, If the body of the POST request is not present at the time of the getParameter() call, it returns null even if the parameter value is set. Things don't work like this, obviously. Parameter parsing only occurs

Re: how to close a comet request outside of an event?

2007-04-26 Thread Sebastiaan van Erk
Rémy Maucherat wrote: On 4/26/07, Sebastiaan van Erk [EMAIL PROTECTED] wrote: I don't understand why the client does not get an immediate -1 (EOF) on the read() as soon as I do this. The socket itself does not need to be closed, but the output stream close should flush the output stream

Comet problem when writing a lot of data to the OutputStream

2007-04-25 Thread Sebastiaan van Erk
Hi, I have the following problem with Comet. I have a long request, and I asynchronously write data to the output stream of the response while the request is between the BEGIN and END/ERROR events. However, the writes do NOT occur while IN a READ request, but are triggered by other events on

Re: Comet problem when writing a lot of data to the OutputStream

2007-04-25 Thread Sebastiaan van Erk
-Dorg.apache.tomcat.util.net.NioSelectorShared=false to your command line Filip Filip Hanik - Dev Lists wrote: definitely a bug, I will work on a fix right away. Filip Sebastiaan van Erk wrote: Hi, I have the following problem with Comet. I have a long request, and I asynchronously write data to the output stream of the response

Re: Comet problem when writing a lot of data to the OutputStream

2007-04-25 Thread Sebastiaan van Erk
Hi, The fixes seem to work well, thanks again! :-) Regards, Sebastiaan Sebastiaan van Erk wrote: Hi, Thanks for the quick action. I'll test the new version right away. :-) Regards, Sebastiaan Filip Hanik - Dev Lists wrote: Sebastian, I have checked in a fix to SVN. You can also work

NullPointerException after approx 3000 comet requests

2007-04-18 Thread Sebastiaan van Erk
Hi, I'm running Tomcat 6.0.10 on Linux Ubuntu Feisty on Java 5. I have a CometProcessor which handles a large number of requests in a very short time, and after about 3000 requests I consistently get the following two errors: Apr 18, 2007 12:09:19 PM

Another Comet 6.0.10 question

2007-04-04 Thread Sebastiaan van Erk
Hi, The pages on Comet say the following about the read event: EventType.READ: This indicates that input data is available, and that one read can be made without blocking. The available and ready methods of the InputStream or Reader may be used to determine if there is a risk of blocking:

Re: Another Comet 6.0.10 question

2007-04-04 Thread Sebastiaan van Erk
Sebastiaan van Erk wrote: Hi, The pages on Comet say the following about the read event: EventType.READ: This indicates that input data is available, and that one read can be made without blocking. The available and ready methods of the InputStream or Reader may be used to determine

Re: Another Comet 6.0.10 question

2007-04-04 Thread Sebastiaan van Erk
in the same way that it would normally behave after handling a read event and there being no more data, i.e., do ERROR/TIMOUT events until the event is closed or new data arrives (which in this case can't happen)? Regards, Sebastiaan Rémy Maucherat wrote: On 4/4/07, Sebastiaan van Erk [EMAIL

Re: Another Comet 6.0.10 question

2007-04-04 Thread Sebastiaan van Erk
Hi, thanks very much for the replies. Rémy Maucherat wrote: On 4/4/07, Sebastiaan van Erk [EMAIL PROTECTED] wrote: Ok, so I get a -1 on a read. Now what do I do? If I just return from the event handler I immediately get another read :-(. If I close the event I can't do output anymore. Since

Re: Tomcat 6.0.10 Comet question

2007-04-03 Thread Sebastiaan van Erk
Hi, Thanks again for the reply. I can't reproduce the END event so probably I was mistaken, sorry about that. It is indeed the ERROR/TIMEOUT event. If an exception occurs during the handling of this event (an unforseen runtime exception for example), then tomcat calls the event method again

Re: Tomcat 6.0.10 Comet question

2007-04-03 Thread Sebastiaan van Erk
Hi, Another reason that I need to be able to throw the exception in the BEGIN event is because for some requests there is no input, only output, so I might never actually get a READ event (GET requests for long pieces of data for example). However I do want to write output to the client as it

Re: Tomcat 6.0.10 Comet question

2007-04-03 Thread Sebastiaan van Erk
wrote: On 4/3/07, Sebastiaan van Erk [EMAIL PROTECTED] wrote: Hi, Thanks again for the reply. I can't reproduce the END event so probably I was mistaken, sorry about that. It is indeed the ERROR/TIMEOUT event. If an exception occurs during the handling of this event (an unforseen runtime

Re: Tomcat 6.0.10 Comet question

2007-04-02 Thread Sebastiaan van Erk
Hi, Thanks for the response. To get these adjustments, do I need to download tomcat from a subversion (or CVS) repository? I was also just discovered that in the 6.0.10 version that an exception in the END event causes the END event to called again; this means that an uncaught

Tomcat 6.0.10 Comet question

2007-03-30 Thread Sebastiaan van Erk
Hi, I'm trying to use Comet in tomcat 6.0.10, and have the following test class: public class CometServlet extends HttpServlet implements CometProcessor { public void event(final CometEvent event) throws IOException, ServletException { final HttpServletRequest request =