CometFilter getAuthType() returns null

2011-08-29 Thread Sudeep Pradhan
Hi,

I am using Tomcat 6.0.33. I have a CometProcessor Servlet and CometFilter. I 
use curl as http client and send username/password with basic authentication. 
The curl trace shows that the authentication type is basic. I have HTTPS in 
place. I try to get the AuthType and Principal in CometFilter but both are 
null.  I have the following code in place:

HttpServletRequest request = 
event.getHttpServletRequest();
HttpServletResponse response = 
event.getHttpServletResponse();

System.out.println(Auth Type :  + 
request.getAuthType());
System.out.println(User Principal:  + 
request.getUserPrincipal());

Can you tell me what needs to be done in order to get this working?

Thanks,
Sudeep


RE: Tomocat 6.0.20 Comet END Event *NOT RAISED* when connection is terminated

2011-08-01 Thread Sudeep Pradhan
Stale as in, It gives me response which was suppose to be given for the 
previous request (it gives me xml(previous) response instead of json(current)). 
I am not seeing this behavior for HTTP. It occurs only for HTTPS. 

*Though the problem of END event not being raise still happens for HTTP even 
with Tomcat 6.0.32.*

Is this a bug?

Thanks,
Sudeep

-Original Message-
From: Pid [mailto:p...@pidster.com] 
Sent: Saturday, July 30, 2011 2:00 PM
To: Tomcat Users List
Subject: Re: Tomocat 6.0.20 Comet END Event *NOT RAISED* when connection is 
terminated

On 29/07/2011 18:33, Sudeep Pradhan wrote:
 Pid,
 
 I tried Tomcat 6.0.32.. no luck yet. Even ERROR event is not raised.

Can you provide a simple example which exhibits this behaviour?

 Also, I am seeing something weird (may not be related to this problem, but 
 think its worth mentioning). I am seeing stale response on a new connection 
 from curl. I validated this by changing the Accept Header from 
 application/xml to application/json, I get 1 response in xml format and then 
 the connection hangs. Then I do a Ctrl-C and re-try with json. I get the json 
 response. Are the request response object not recycled properly? What can be 
 the possible reason for this?

What is stale?

Take a thread dump when it hangs to see what the app is doing.


p

 Thanks,
 Sudeep 
 
 
 -Original Message-
 From: Pid [mailto:p...@pidster.com] 
 Sent: Friday, July 29, 2011 12:32 AM
 To: Tomcat Users List
 Subject: Re: Tomocat 6.0.20 Comet END Event *NOT RAISED* when connection is 
 terminated
 
 On 28/07/2011 20:42, Sudeep Pradhan wrote:
 Hi,

 I have a CometProcessor Servlet which is used for streaming system events  
 to a http client. I have SSL enabled on the server. I use *curl* as the http 
 client. I get streaming events on the console. But when I do a Ctrl-C on the 
 console there no End event is raised and hence the connection is not cleaned 
 up (I have connection registry for keeping track of clients).  What can be 
 the explanation for this scenario?

 Thanks,
 Sudeep
 
 
 Are you able to upgrade to 6.0.32?  There have been many fixes to the
 NIO connector since 6.0.20 - not that this is necessarily your problem.
 
 Does the ERROR event fire when curl stops?
 
 
 p
 
 -
 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: Tomocat 6.0.20 Comet END Event *NOT RAISED* when connection is terminated

2011-07-29 Thread Sudeep Pradhan
Pid,

I tried Tomcat 6.0.32.. no luck yet. Even ERROR event is not raised.

Also, I am seeing something weird (may not be related to this problem, but 
think its worth mentioning). I am seeing stale response on a new connection 
from curl. I validated this by changing the Accept Header from application/xml 
to application/json, I get 1 response in xml format and then the connection 
hangs. Then I do a Ctrl-C and re-try with json. I get the json response. Are 
the request response object not recycled properly? What can be the possible 
reason for this?

Thanks,
Sudeep 


-Original Message-
From: Pid [mailto:p...@pidster.com] 
Sent: Friday, July 29, 2011 12:32 AM
To: Tomcat Users List
Subject: Re: Tomocat 6.0.20 Comet END Event *NOT RAISED* when connection is 
terminated

On 28/07/2011 20:42, Sudeep Pradhan wrote:
 Hi,
 
 I have a CometProcessor Servlet which is used for streaming system events  to 
 a http client. I have SSL enabled on the server. I use *curl* as the http 
 client. I get streaming events on the console. But when I do a Ctrl-C on the 
 console there no End event is raised and hence the connection is not cleaned 
 up (I have connection registry for keeping track of clients).  What can be 
 the explanation for this scenario?
 
 Thanks,
 Sudeep


Are you able to upgrade to 6.0.32?  There have been many fixes to the
NIO connector since 6.0.20 - not that this is necessarily your problem.

Does the ERROR event fire when curl stops?


p

-
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



Tomocat 6.0.20 Comet END Event *NOT RAISED* when connection is terminated

2011-07-28 Thread Sudeep Pradhan
Hi,

I have a CometProcessor Servlet which is used for streaming system events  to a 
http client. I have SSL enabled on the server. I use *curl* as the http client. 
I get streaming events on the console. But when I do a Ctrl-C on the console 
there no End event is raised and hence the connection is not cleaned up (I have 
connection registry for keeping track of clients).  What can be the explanation 
for this scenario?

Thanks,
Sudeep



Comet: How to send *Chunked* response

2011-07-25 Thread Sudeep Pradhan
Hi,

I am using CometProcessor to stream event notifications from server to client. 
The events are generated at random.  I want to send the notification with 
Transfer Encoding as chunked so that I can use Apache's ChunkedInputStream to 
parse the output.

I get the PrintWriter from the ServletResponse using the getWriter() and I 
write the event notification on this writer. I want this to be in chunk format 
of length-payload. Currently I do the following:

PrintWriter writer = connection.getWriter();
for (int j = 0; j  pendingEvents.length; j++) {
String eventString = 
converter.convert(pendingEvents[j]);
eventString.concat(\r\n);
final String length = 
Integer.toHexString(eventString.length());
writer.print(\r\n + length + \r\n);
writer.print(eventString);
//logger.info(Writing: + eventString);
}

But this generates a Bad Chunk size exception on client.

Thanking you in anticipation.

Sudeep


RE: Comet: How to send *Chunked* response

2011-07-25 Thread Sudeep Pradhan
Mark,

I tried just writing to the PrintWriter. I do not see the chunking in the 
response. Can you spot any obvious mistake here?

private HttpServletResponse connection; // Set in 
constructor

PrintWriter writer = connection.getWriter();
for (int j = 0; j  pendingEvents.length; j++) {
String eventString = 
converter.convert(pendingEvents[j]);
eventString = eventString + \r\n;
writer.print(eventString);
writer.flush();
}

Thanks,
Sudeep

-Original Message-
From: Mark Thomas [mailto:ma...@apache.org] 
Sent: Monday, July 25, 2011 12:37 PM
To: Tomcat Users List
Subject: Re: Comet: How to send *Chunked* response

On 25/07/2011 19:23, Sudeep Pradhan wrote:
 Hi,
 
 I am using CometProcessor to stream event notifications from server to 
 client. The events are generated at random.  I want to send the notification 
 with Transfer Encoding as chunked so that I can use Apache's 
 ChunkedInputStream to parse the output.
 
 I get the PrintWriter from the ServletResponse using the getWriter() and I 
 write the event notification on this writer. I want this to be in chunk 
 format of length-payload. Currently I do the following:
 
 PrintWriter writer = connection.getWriter();
 for (int j = 0; j  pendingEvents.length; j++) {
 String eventString = 
 converter.convert(pendingEvents[j]);
 eventString.concat(\r\n);
 final String length = 
 Integer.toHexString(eventString.length());
 writer.print(\r\n + length + \r\n);
 writer.print(eventString);
 //logger.info(Writing: + eventString);
 }
 
 But this generates a Bad Chunk size exception on client.

Just write and flush the content. Tomcat will handle the chunking for you.

Mark



-
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: Comet over HTTPS: END event recieved immeidately for the first few times

2011-07-13 Thread Sudeep Pradhan
Hi Filip,

Thanks for the reply.

I don't think that I am using BIO connector for SSL. I don't see any such 
option in the server.xml. The connector is as follows:

Connector 
protocol=org.apache.coyote.http11.Http11NioProtocol
port=8443 minSpareThreads=5 maxSpareThreads=75
enableLookups=true disableUploadTimeout=true 
  acceptCount=100  maxThreads=200
scheme=https secure=true SSLEnabled=true
keystoreFile=/path/to/file/keystore
keystorePass=**
clientAuth=false sslProtocol=TLS/

Also, It does *work sometimes*. I get a proper streaming output of the weather 
feeds when it works.

Hope this helps you understand the scenario better.

Thanks,
Sudeep



-Original Message-
From: Filip Hanik - Dev Lists [mailto:devli...@hanik.com] 
Sent: Wednesday, July 13, 2011 1:43 PM
To: Tomcat Users List
Subject: Re: Comet over HTTPS: END event recieved immeidately for the first few 
times

is it possible that when you turn on SSL, you are using the regular BIO 
connector when you use SSL and Comet is not supported by that connector.
best
Filip

On 7/11/2011 11:05 AM, Sudeep Pradhan wrote:
 Hi Filip,

 I have tried the app with tomcat 6.0.32 and 7.0.16, and the result is the 
 same. I am not able to get it working with https. Http works just fine.

 The use case I am trying to address is that, I want to send 
 notifications/events from a webapp to another webapp asynchronously. The 2 
 webapps communicate using REST call for other things. I want to have the same 
 model for notifications. The client webapp will send a Https GET request and 
 the server webapp will push the notifications asynchronously as a response. 
 The client can be anything not just a webapp, I will be using curl as the 
 client for testing.

 Please let me know if you want to know more.

 Thanks,
 Sudeep

 -Original Message-
 From: Filip Hanik - Dev Lists [mailto:devli...@hanik.com]
 Sent: Sunday, July 10, 2011 8:12 PM
 To: Tomcat Users List
 Subject: Re: Comet over HTTPS: END event recieved immeidately for the first 
 few times

 try the latest version of Tomcat 6, if that doesn't work, provide a test case 
 so we can take a look at it

 On 7/8/2011 4:07 PM, Sudeep Pradhan wrote:
 Any insights on this?

 -Original Message-
 From: Sudeep Pradhan [mailto:pradh...@vmware.com]
 Sent: Wednesday, June 29, 2011 4:54 PM
 To: users@tomcat.apache.org
 Subject: Comet over HTTPS: END event recieved immeidately for the first few 
 times

 Hello,

 I am  using Tomcat 6.0.20 on Ubuntu 10.04 and have written a simple 
 TomcatWeatherServlet as presented in 
 http://www.ibm.com/developerworks/web/library/wa-cometjava/ I modified the 
 servlet to stream weather feed to multiple curl clients. I am using curl 
 7.21.6 as my client.

 When I run curl -i -k -v -trace 
 https://IP_Addr:8443/Weatherhttps://%3cIP_Addr%3e:8443/Weather   from 
 the command-line I get the following response for the first few times:

 code
 $ curl -i -k -v -trace https://IP_Addr:8443/Weather
 * About to connect() toIP_Addr   port 8443 (#0)
 *   TryingIP_Addr... connected
 * Connected toIP_Addr   (IP_Addr) port 8443 (#0)
 * successfully set certificate verify locations:
 *   CAfile: none
 CApath: /etc/ssl/certs
 * SSLv3, TLS handshake, Client hello (1):
 * SSLv3, TLS handshake, Server hello (2):
 * SSLv3, TLS handshake, CERT (11):
 * SSLv3, TLS handshake, Server key exchange (12):
 * SSLv3, TLS handshake, Server finished (14):
 * SSLv3, TLS handshake, Client key exchange (16):
 * SSLv3, TLS change cipher, Client hello (1):
 * SSLv3, TLS handshake, Finished (20):
 * SSLv3, TLS change cipher, Client hello (1):
 * SSLv3, TLS handshake, Finished (20):
 * SSL connection using DHE-RSA-AES256-SHA
 * Server certificate:
 *  subject: 
 *  start date: 2009-02-23 23:07:18 GMT
 *  expire date: 2019-02-21 23:07:18 GMT
 *  common name: XX (does not match 'IP_Addr')
 *  issuer: XX
 *  SSL certificate verify result: self signed certificate (18), 
 continuing anyway.
 GET /Weather HTTP/1.1
 User-Agent: curl/7.21.6 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k 
 zlib/1.2.3.3 libidn/1.15
 Host:IP_Addr:8443
 Accept: */*

HTTP/1.1 200 OK
 HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
 Server: Apache-Coyote/1.1
Content-Length: 0
 Content-Length: 0
Date: Wed, 29 Jun 2011 23:40:17 GMT
 Date: Wed, 29 Jun 2011 23:40:17 GMT

 
 * Connection #0 to hostIP_Addr   left intact
 * Closing connection #0
 * SSLv3, TLS alert, Client hello (1):
 /code

 Observe that Content-Length is 0 in the response. Also when I do get the 
 expected response which is,

 code
 GET /Weather HTTP/1.1
 User-Agent: curl/7.21.6 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k 
 zlib/1.2.3.3 libidn/1.15
 Host:IP_Addr:8443
 Accept: */*

HTTP/1.1 200 OK
 HTTP/1.1 200 OK

RE: Comet over HTTPS: END event recieved immeidately for the first few times

2011-07-11 Thread Sudeep Pradhan
Hi Filip,

I have tried the app with tomcat 6.0.32 and 7.0.16, and the result is the same. 
I am not able to get it working with https. Http works just fine.

The use case I am trying to address is that, I want to send 
notifications/events from a webapp to another webapp asynchronously. The 2 
webapps communicate using REST call for other things. I want to have the same 
model for notifications. The client webapp will send a Https GET request and 
the server webapp will push the notifications asynchronously as a response. The 
client can be anything not just a webapp, I will be using curl as the client 
for testing.

Please let me know if you want to know more. 

Thanks,
Sudeep

-Original Message-
From: Filip Hanik - Dev Lists [mailto:devli...@hanik.com] 
Sent: Sunday, July 10, 2011 8:12 PM
To: Tomcat Users List
Subject: Re: Comet over HTTPS: END event recieved immeidately for the first few 
times

try the latest version of Tomcat 6, if that doesn't work, provide a test case 
so we can take a look at it

On 7/8/2011 4:07 PM, Sudeep Pradhan wrote:
 Any insights on this?

 -Original Message-
 From: Sudeep Pradhan [mailto:pradh...@vmware.com]
 Sent: Wednesday, June 29, 2011 4:54 PM
 To: users@tomcat.apache.org
 Subject: Comet over HTTPS: END event recieved immeidately for the first few 
 times

 Hello,

 I am  using Tomcat 6.0.20 on Ubuntu 10.04 and have written a simple 
 TomcatWeatherServlet as presented in 
 http://www.ibm.com/developerworks/web/library/wa-cometjava/ I modified the 
 servlet to stream weather feed to multiple curl clients. I am using curl 
 7.21.6 as my client.

 When I run curl -i -k -v -trace 
 https://IP_Addr:8443/Weatherhttps://%3cIP_Addr%3e:8443/Weather  from the 
 command-line I get the following response for the first few times:

 code
 $ curl -i -k -v -trace https://IP_Addr:8443/Weather
 * About to connect() toIP_Addr  port 8443 (#0)
 *   TryingIP_Addr... connected
 * Connected toIP_Addr  (IP_Addr) port 8443 (#0)
 * successfully set certificate verify locations:
 *   CAfile: none
CApath: /etc/ssl/certs
 * SSLv3, TLS handshake, Client hello (1):
 * SSLv3, TLS handshake, Server hello (2):
 * SSLv3, TLS handshake, CERT (11):
 * SSLv3, TLS handshake, Server key exchange (12):
 * SSLv3, TLS handshake, Server finished (14):
 * SSLv3, TLS handshake, Client key exchange (16):
 * SSLv3, TLS change cipher, Client hello (1):
 * SSLv3, TLS handshake, Finished (20):
 * SSLv3, TLS change cipher, Client hello (1):
 * SSLv3, TLS handshake, Finished (20):
 * SSL connection using DHE-RSA-AES256-SHA
 * Server certificate:
 *  subject: 
 *  start date: 2009-02-23 23:07:18 GMT
 *  expire date: 2019-02-21 23:07:18 GMT
 *  common name: XX (does not match 'IP_Addr')
 *  issuer: XX
 *  SSL certificate verify result: self signed certificate (18), 
 continuing anyway.
 GET /Weather HTTP/1.1
 User-Agent: curl/7.21.6 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k 
 zlib/1.2.3.3 libidn/1.15
 Host:IP_Addr:8443
 Accept: */*

   HTTP/1.1 200 OK
 HTTP/1.1 200 OK
   Server: Apache-Coyote/1.1
 Server: Apache-Coyote/1.1
   Content-Length: 0
 Content-Length: 0
   Date: Wed, 29 Jun 2011 23:40:17 GMT
 Date: Wed, 29 Jun 2011 23:40:17 GMT

 
 * Connection #0 to hostIP_Addr  left intact
 * Closing connection #0
 * SSLv3, TLS alert, Client hello (1):
 /code

 Observe that Content-Length is 0 in the response. Also when I do get the 
 expected response which is,

 code
 GET /Weather HTTP/1.1
 User-Agent: curl/7.21.6 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k 
 zlib/1.2.3.3 libidn/1.15
 Host:IP_Addr:8443
 Accept: */*

   HTTP/1.1 200 OK
 HTTP/1.1 200 OK
   Server: Apache-Coyote/1.1
 Server: Apache-Coyote/1.1
   Transfer-Encoding: chunked
 Transfer-Encoding: chunked
   Date: Wed, 29 Jun 2011 23:46:18 GMT
 Date: Wed, 29 Jun 2011 23:46:18 GMT

 
 h2Conditions for San Jose, CA at 3:52 pm PDT/h2
 img src=http://l.yimg.com/a/i/us/we/52/30.gif/br /
 bCurrent Conditions:/bbr /
 Partly Cloudy, 68 FBR /
 BR /bForecast:/bBR /
 Wed - Mostly Clear. High: 70 Low: 55br /
 Thu - Partly Cloudy. High: 77 Low: 57br /
 br /
 a 
 href=http://us.rd.yahoo.com/dailynews/rss/weather/San_Jose__CA/*http://weather.yahoo.com/forecast/USCA0993_f.html;Full
  Forecast at Yahoo! Weather/aBR/BR/
 (provided bya href=http://www.weather.com;The Weather Channel/a)br/
 br

 /code
 I get Transfer-Encoding as chunked and no Content-Length.

 On Server logs I get for the error are:
 16:40:16.916  INFO http-8443-exec-3 TomcatWeatherServlet:41 - Begin for 
 session: BDD6B1808161F1DA99D5D3207F1A719B
 16:40:16.959  INFO http-8443-exec-4 TomcatWeatherServlet:48 - End for 
 session: BDD6B1808161F1DA99D5D3207F1A719B
 16:40:17.033  INFO http-8443-exec-4 TomcatWeatherServlet:48 - End for 
 session: BDD6B1808161F1DA99D5D3207F1A719B

 This was working when I was on HTTP. I have tried

RE: Comet over HTTPS: END event recieved immeidately for the first few times

2011-07-08 Thread Sudeep Pradhan
Any insights on this? 

-Original Message-
From: Sudeep Pradhan [mailto:pradh...@vmware.com] 
Sent: Wednesday, June 29, 2011 4:54 PM
To: users@tomcat.apache.org
Subject: Comet over HTTPS: END event recieved immeidately for the first few 
times

Hello,

I am  using Tomcat 6.0.20 on Ubuntu 10.04 and have written a simple 
TomcatWeatherServlet as presented in 
http://www.ibm.com/developerworks/web/library/wa-cometjava/ I modified the 
servlet to stream weather feed to multiple curl clients. I am using curl 7.21.6 
as my client.

When I run curl -i -k -v -trace 
https://IP_Addr:8443/Weatherhttps://%3cIP_Addr%3e:8443/Weather from the 
command-line I get the following response for the first few times:

code
$ curl -i -k -v -trace https://IP_Addr:8443/Weather
* About to connect() to IP_Addr port 8443 (#0)
*   Trying IP_Addr... connected
* Connected to IP_Addr (IP_Addr) port 8443 (#0)
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server key exchange (12):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using DHE-RSA-AES256-SHA
* Server certificate:
*  subject: 
*  start date: 2009-02-23 23:07:18 GMT
*  expire date: 2019-02-21 23:07:18 GMT
*  common name: XX (does not match 'IP_Addr')
*  issuer: XX
*  SSL certificate verify result: self signed certificate (18), 
continuing anyway.
 GET /Weather HTTP/1.1
 User-Agent: curl/7.21.6 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k 
 zlib/1.2.3.3 libidn/1.15
 Host: IP_Addr:8443
 Accept: */*

 HTTP/1.1 200 OK
HTTP/1.1 200 OK
 Server: Apache-Coyote/1.1
Server: Apache-Coyote/1.1
 Content-Length: 0
Content-Length: 0
 Date: Wed, 29 Jun 2011 23:40:17 GMT
Date: Wed, 29 Jun 2011 23:40:17 GMT


* Connection #0 to host IP_Addr left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
/code

Observe that Content-Length is 0 in the response. Also when I do get the 
expected response which is,

code
 GET /Weather HTTP/1.1
 User-Agent: curl/7.21.6 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k 
 zlib/1.2.3.3 libidn/1.15
 Host: IP_Addr:8443
 Accept: */*

 HTTP/1.1 200 OK
HTTP/1.1 200 OK
 Server: Apache-Coyote/1.1
Server: Apache-Coyote/1.1
 Transfer-Encoding: chunked
Transfer-Encoding: chunked
 Date: Wed, 29 Jun 2011 23:46:18 GMT
Date: Wed, 29 Jun 2011 23:46:18 GMT


h2Conditions for San Jose, CA at 3:52 pm PDT/h2
img src=http://l.yimg.com/a/i/us/we/52/30.gif/br /
bCurrent Conditions:/bbr /
Partly Cloudy, 68 FBR /
BR /bForecast:/bBR /
Wed - Mostly Clear. High: 70 Low: 55br /
Thu - Partly Cloudy. High: 77 Low: 57br /
br /
a 
href=http://us.rd.yahoo.com/dailynews/rss/weather/San_Jose__CA/*http://weather.yahoo.com/forecast/USCA0993_f.html;Full
 Forecast at Yahoo! Weather/aBR/BR/
(provided by a href=http://www.weather.com; The Weather Channel/a)br/
br

/code
I get Transfer-Encoding as chunked and no Content-Length.

On Server logs I get for the error are:
16:40:16.916  INFO http-8443-exec-3 TomcatWeatherServlet:41 - Begin for 
session: BDD6B1808161F1DA99D5D3207F1A719B
16:40:16.959  INFO http-8443-exec-4 TomcatWeatherServlet:48 - End for session: 
BDD6B1808161F1DA99D5D3207F1A719B
16:40:17.033  INFO http-8443-exec-4 TomcatWeatherServlet:48 - End for session: 
BDD6B1808161F1DA99D5D3207F1A719B

This was working when I was on HTTP. I have tried to debug this for a lot of 
time w/o success. Also I get two END events instead of one as seen in the Logs. 
 Any insights will be helpful.

Thanks,
Sudeep

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



Comet over HTTPS: END event recieved immeidately for the first few times

2011-06-29 Thread Sudeep Pradhan
Hello,

I am  using Tomcat 6.0.20 on Ubuntu 10.04 and have written a simple 
TomcatWeatherServlet as presented in 
http://www.ibm.com/developerworks/web/library/wa-cometjava/ I modified the 
servlet to stream weather feed to multiple curl clients. I am using curl 7.21.6 
as my client.

When I run curl -i -k -v -trace 
https://IP_Addr:8443/Weatherhttps://%3cIP_Addr%3e:8443/Weather from the 
command-line I get the following response for the first few times:

code
$ curl -i -k -v -trace https://IP_Addr:8443/Weather
* About to connect() to IP_Addr port 8443 (#0)
*   Trying IP_Addr... connected
* Connected to IP_Addr (IP_Addr) port 8443 (#0)
* successfully set certificate verify locations:
*   CAfile: none
  CApath: /etc/ssl/certs
* SSLv3, TLS handshake, Client hello (1):
* SSLv3, TLS handshake, Server hello (2):
* SSLv3, TLS handshake, CERT (11):
* SSLv3, TLS handshake, Server key exchange (12):
* SSLv3, TLS handshake, Server finished (14):
* SSLv3, TLS handshake, Client key exchange (16):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSLv3, TLS change cipher, Client hello (1):
* SSLv3, TLS handshake, Finished (20):
* SSL connection using DHE-RSA-AES256-SHA
* Server certificate:
*  subject: 
*  start date: 2009-02-23 23:07:18 GMT
*  expire date: 2019-02-21 23:07:18 GMT
*  common name: XX (does not match 'IP_Addr')
*  issuer: XX
*  SSL certificate verify result: self signed certificate (18), 
continuing anyway.
 GET /Weather HTTP/1.1
 User-Agent: curl/7.21.6 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k 
 zlib/1.2.3.3 libidn/1.15
 Host: IP_Addr:8443
 Accept: */*

 HTTP/1.1 200 OK
HTTP/1.1 200 OK
 Server: Apache-Coyote/1.1
Server: Apache-Coyote/1.1
 Content-Length: 0
Content-Length: 0
 Date: Wed, 29 Jun 2011 23:40:17 GMT
Date: Wed, 29 Jun 2011 23:40:17 GMT


* Connection #0 to host IP_Addr left intact
* Closing connection #0
* SSLv3, TLS alert, Client hello (1):
/code

Observe that Content-Length is 0 in the response. Also when I do get the 
expected response which is,

code
 GET /Weather HTTP/1.1
 User-Agent: curl/7.21.6 (x86_64-pc-linux-gnu) libcurl/7.19.7 OpenSSL/0.9.8k 
 zlib/1.2.3.3 libidn/1.15
 Host: IP_Addr:8443
 Accept: */*

 HTTP/1.1 200 OK
HTTP/1.1 200 OK
 Server: Apache-Coyote/1.1
Server: Apache-Coyote/1.1
 Transfer-Encoding: chunked
Transfer-Encoding: chunked
 Date: Wed, 29 Jun 2011 23:46:18 GMT
Date: Wed, 29 Jun 2011 23:46:18 GMT


h2Conditions for San Jose, CA at 3:52 pm PDT/h2
img src=http://l.yimg.com/a/i/us/we/52/30.gif/br /
bCurrent Conditions:/bbr /
Partly Cloudy, 68 FBR /
BR /bForecast:/bBR /
Wed - Mostly Clear. High: 70 Low: 55br /
Thu - Partly Cloudy. High: 77 Low: 57br /
br /
a 
href=http://us.rd.yahoo.com/dailynews/rss/weather/San_Jose__CA/*http://weather.yahoo.com/forecast/USCA0993_f.html;Full
 Forecast at Yahoo! Weather/aBR/BR/
(provided by a href=http://www.weather.com; The Weather Channel/a)br/
br

/code
I get Transfer-Encoding as chunked and no Content-Length.

On Server logs I get for the error are:
16:40:16.916  INFO http-8443-exec-3 TomcatWeatherServlet:41 - Begin for 
session: BDD6B1808161F1DA99D5D3207F1A719B
16:40:16.959  INFO http-8443-exec-4 TomcatWeatherServlet:48 - End for session: 
BDD6B1808161F1DA99D5D3207F1A719B
16:40:17.033  INFO http-8443-exec-4 TomcatWeatherServlet:48 - End for session: 
BDD6B1808161F1DA99D5D3207F1A719B

This was working when I was on HTTP. I have tried to debug this for a lot of 
time w/o success. Also I get two END events instead of one as seen in the Logs. 
 Any insights will be helpful.

Thanks,
Sudeep