Re: How does Tomcat identify web socket endpoint in a war?

2015-04-24 Thread Ganesh Bms
I think, yes. That's why I went for programmatic endpoint.

On Fri, Apr 24, 2015 at 4:55 PM, Thusitha Thilina Dayaratne 
thusithathil...@gmail.com wrote:

 Hi,

 Could someone tell me how does Tomcat identify the websocket endpoints in
 .war file?
 Does it scan all the classes and looks for annotations?

 Thanks
 Best Regards

 --



Re: Info: WebSocket connection closed, Code: 1006 when try to run websocket sample

2015-04-24 Thread Thusitha Thilina Dayaratne
Hi,

Hi,

 Hi,

 I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket
 example and when I'm trying to run it in my server for all 4 examples
 (Echo, chat, etc..)
 I'm getting

 Info: WebSocket connection closed, Code: 1006


 In the console it prints

 WebSocket connection to 'ws://
 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
 during WebSocket handshake: Unexpected response code: 302


 This same war file is running perfectly on Tomcat distribution.

 Can someone tell me what could be the reason for this?

It looks like you haven't deployed the WebSocket examples correctly. My
guess is you are seeing the 302 redirect to
/examples/websocket/echoProgrammatic/ you'd get if this was being
handled as a static resource.
Thanks for quick response. But I think you misunderstood what I mean.
I'm not getting 10.100.7.26:9763/examples/websocket/echoProgrammatic'
failed: Error during WebSocket handshake: Unexpected response code: 302
I'm getting that for the echo sample programmatic API option.

For each and every websocket sample I'm getting Info: WebSocket
connection closed, Code: 1006
And in the console it says something like
WebSocket connection to ws://10.100.7.26:9763/examples/websocket/
http://10.100.7.26:9763/examples/websocket/echoProgrammatic... failed:
Error during WebSocket handshake: Unexpected response code: 302

When I tried to deploy the sample distributed with Tomcat it works fine
in my server.
Seems that I did something wrong while building the sample. Can someone
help me out?

Furthermore I've tried following things out and both options works without
issue.

   1. Running tomcat distributed examples in my server
   2. Running the war file that I built inside Tomcat

I've mistaken here. My war file doesn't run on Tomcat either.


When I used the following dependency to build the example webapp, instead
of 302 I'm getting 404 error.

dependency
groupIdjavax.websocket/groupId
artifactIdjavax.websocket-api/artifactId
version1.0/version
scopeprovided/scope
/dependency

Am I having wrong dependency here? If so what are the dependencies that I
should include when do the build?

Thanks
Best Regards


2015-04-24 11:13 GMT+05:30 Thusitha Thilina Dayaratne 
thusithathil...@gmail.com:

 Hi,

  Hi,
 
  I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket
  example and when I'm trying to run it in my server for all 4 examples
  (Echo, chat, etc..)
  I'm getting
 
  Info: WebSocket connection closed, Code: 1006
 
 
  In the console it prints
 
  WebSocket connection to 'ws://
  10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
  during WebSocket handshake: Unexpected response code: 302
 
 
  This same war file is running perfectly on Tomcat distribution.
 
  Can someone tell me what could be the reason for this?

 It looks like you haven't deployed the WebSocket examples correctly. My
 guess is you are seeing the 302 redirect to
 /examples/websocket/echoProgrammatic/ you'd get if this was being
 handled as a static resource.
 Thanks for quick response. But I think you misunderstood what I mean.
 I'm not getting 10.100.7.26:9763/examples/websocket/echoProgrammatic'
 failed: Error during WebSocket handshake: Unexpected response code: 302
 I'm getting that for the echo sample programmatic API option.

 For each and every websocket sample I'm getting Info: WebSocket
 connection closed, Code: 1006
 And in the console it says something like
 WebSocket connection to ws://10.100.7.26:9763/examples/websocket/
 http://10.100.7.26:9763/examples/websocket/echoProgrammatic... failed:
 Error during WebSocket handshake: Unexpected response code: 302

 When I tried to deploy the sample distributed with Tomcat it works fine
 in my server.
 Seems that I did something wrong while building the sample. Can someone
 help me out?

 Furthermore I've tried following things out and both options works without
 issue.

1. Running tomcat distributed examples in my server
2. Running the war file that I built inside Tomcat

 The only thing that doesn't work is when try to run the war file that I
 built in my server.

 2015-04-24 10:59 GMT+05:30 Thusitha Thilina Dayaratne 
 thusithathil...@gmail.com:

 Hi,

  Hi,
 
  I've embedded tomcat 8.0.20 and using that. I build the tomcat websocket
  example and when I'm trying to run it in my server for all 4 examples
  (Echo, chat, etc..)
  I'm getting
 
  Info: WebSocket connection closed, Code: 1006
 
 
  In the console it prints
 
  WebSocket connection to 'ws://
  10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
  during WebSocket handshake: Unexpected response code: 302
 
 
  This same war file is running perfectly on Tomcat distribution.
 
  Can someone tell me what could be the reason for this?

 It looks like you haven't deployed the WebSocket examples correctly. My
 guess is you are seeing the 302 redirect to
 /examples/websocket/echoProgrammatic/ you'd get if this was 

How does Tomcat identify web socket endpoint in a war?

2015-04-24 Thread Thusitha Thilina Dayaratne
Hi,

Could someone tell me how does Tomcat identify the websocket endpoints in
.war file?
Does it scan all the classes and looks for annotations?

Thanks
Best Regards

--


Re: Apache Tomcat jk connector 400 bad request

2015-04-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Razi,

On 4/22/15 9:41 PM, Razi wrote:
 -Original Message- From: Christopher Schultz Sent:
 Thursday, April 23, 2015 8:03 AM To: Tomcat Users List Subject: Re:
 Apache Tomcat jk connector 400 bad request
 
 Razi,
 
 On 4/22/15 6:39 PM, Razi Ansari wrote:
  Original message  From: Christopher Schultz 
 ch...@christopherschultz.net Date: 04/23/2015  6:15 AM 
 (GMT+08:00) To: Tomcat Users List users@tomcat.apache.org 
 Subject: Re: Apache Tomcat jk connector 400 bad request
 
 If you decide to change your timeout values (I don't see a
 reason to
 
 do so unless you are encountering some kind of related
 problem, and I
 
 don't consider this to be a related problem), make sure they
 are
 
 consistent between mod_jk and Tomcat's AJP connector.
 
 I tried inceasing the value of webserver KeepAliveTimeout to 15
 and i dont get the 400 bad request error in the test environment.
 But i really want to know the root cause before i move it to 
 production. In my httpwatch i see the request going without any 
 body ony header.
 
 Without the change in KeepAliveTimeout, can you reproduce this
 error in your test environment? I would honestly be surprised if 
 KeepAliveTimeout is the trouble, here. For the AJP connector, the 
 KeepAliveTimeout is not relevant because AJP is by definition 
 keep-alive. You can disable it if you think doing so will improve
 the situation, but I don't have any reason to suspect it would.
 
 It would be great to know whether the AJP connector or the HTTP 
 connector was the one failing. In Tomcat, the stack trace will
 include the thread identifier which includes the port number and
 protocol being used. Please include that with your stack traces
 when you find the m.
 
 It would also be great to know which (exact) version of Tomcat is 
 being used under the hood. Check the logs during startup to see
 what Tomcat says it is.
 
 -chris
 
 -

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

 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 Christopher,
 
 When KeepAliveTimeOut is 5, 12 , I get the error, when its 15 and 
 above I don't get the error.

That's ... weird. Are these particularly large requests? Are your
clients on particularly slow connections?

 The versions of Apahce and Mod_jk are as follows
 
 Apache 2.2.24 Mod_jk 1.2.37

There is a more resent version of mod_jk, but that one should be okay.
I'd upgrade if it's a possibility.

 I dont use Tomcat, my applicaton server is JBOSS EAP 6.1.0

I understand that. I can't remember when JBoss switched from using
Tomcat as its servlet container to using their own in-house container,
but older versions of JBoss use Tomcat internally, and that Tomcat has
a version number.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVOkQTAAoJEBzwKT+lPKRYY0IP/RdNIVopTKebt2G7L4S5xgh2
TQKDEhybN5pHuk4VI/xIttQaCVGIfH6tK0msLrD2GzcEqtQBDeXcjYuf6J3OStRW
5Xwm/3Pi2GPOcEiBYhbb0bhaqy7asmAIeuKXH4lwKJMl4JJQnIDy0Wp9dcLcODSv
2mTEE2jSLwdb8+j0DneB72oFNkAoKDEQkVqR+ajsFqicZCx4LBUAvkudGFgwuJzU
nqDMCUKiq9hMso4BbiVYcVN4mf5eeE964JU6vf7Bt9mlA4ZZeiLnC52BdpeU2u3i
MJHNHG6udDafupj10++wo3jvtWjBPtKiHbqFg0Fwl2cjm4fCAkEdj7VP80o7nrSY
rApnFOt6l049TyWmYX0nmRFVRQxNHELkfpU8ZdvjYv1e0Q1OvZPu667GtD+zpFdz
ar/bhcuni2CSOh9+zq5R03RPs2GdOVqiL1yHuHH4e+/diQKf7aJY0UJjczWoj2vS
QYKRRIckDDHrA60iEs5XkaC0gM5/bwlCcgnlMppEcntAN64fPv47R+3FtRua0s3R
Jo71pUiIK91cKG+sHXDd9DBSFVM82TU20BM7mdrK6kHdxo8h1cQrAdMwGxt0+iWR
gJqoBBRJ5IxwBMoYlnVpWKdaiaZRssm/jU9wiwLYun4ZmuGOMwnoHzejMWmiTvt2
OkeF6mIuNrPSXqZKCXWD
=ktm0
-END PGP SIGNATURE-

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



Re: [OT] Sending HTTP Trailers from a client (not servlet)

2015-04-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

All,

Bump.

Anyone?

- -chris

On 4/18/15 12:19 PM, Christopher Schultz wrote:
 All,
 
 I've got a perfect use-case for HTTP trailers but it doesn't seem
 like any existing client (e.g. HttpURLConnection, HttpClient) has
 support for them on the /sending/ side.
 
 HttpURLConnection doesn't have a way (that I can see) to fetch 
 trailing headers, but it may just be that you have to consume the 
 response and then check the headers (similar to what you'd do in a 
 Servlet when the client actually sends trailing headers to the
 server).
 
 HttpClient allows you to get the trailing headers from a response
 in a very awkward way by reading them from the ChunkedInputStream
 which is buried a few levels deep, evidently.
 
 But neither seem to have a way to actually *send* headers to the
 server.
 
 Has anyone ever actually done this from a Java-based client? I'm 
 currently using my own wrapper around HttpURLConnection (because 
 HttpClient seemed to heavy for my purposes) and it's been working 
 great for a few years. I'd like to support a streaming mode plus 
 trailer headers with it, and I'd prefer not to dump
 HttpURLConnection and replace it with low-level socket work because
 them I'll have to do a whole bunch of work to reproduce what
 HttpURLConnection is already providing (e.g. TLS, auto-redirects,
 etc.).
 
 Any ideas from the community?
 
 Thanks, -chris
 
 -

 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVOk4RAAoJEBzwKT+lPKRYLQUP/RtRPIVVhWQaFCDXV3PGwGqS
6Mm1mWndE+Ma1QpmQyHJtEDOI1r2dli/eUVclhlNtQyw4oc3vJssgmi0rfCmsJKJ
c0U5eFA+odNnJKGh06y3ItCR/KVYhwNzbMS7LGw537AAiFb4Ls7ZgdmJeMndL7zE
7ovalopWzqmATijOKZoWFIe3NEDvudGN+dYefOgBzQc5fTYyu1tsDJGUEF8BEULA
tW9aueeQztSJOG3+PgrdVOP3bGBYARorzcJgv5xF7wUEad2vbLcsrkphFZGVgsmH
NKOf7WVEqEWkAGap43Cb57j324nAcR/W1OqWMoUYlIhuR+r8YA9VM7Nm84xqsV2j
Fp5qQEzagkVAdGXibBBzEfa2neb1/HGtEOfNyH8O+zgC4+yJZH88lwY6FpnrUo5B
A3J0Pk0Gq2BW/CjjKUsfX97215BmZkM/I6BF7pZSshMdC4BHwNidtvh8X/acVc7+
8AZMTV+RyQUAZR4SagDUvaaATKBhC4K/SVvGOH9wAW+0HwDwE1luj4S9dkch0dzA
50CoJWaZLm/9Hk68xazvyxcHFLsu5cUf7CC9MvHZR8022kFX8fLHf2YNxZVv+jUO
UiXou9VKYIlPkhzDyHfl8HhWFRR+cO1D/nTzaDk7iqSQNKXr0PXTsvbUNCDjX8so
Tfkc7x6zoIuRGS0r3rAM
=BpMx
-END PGP SIGNATURE-

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



Re: Apache Tomcat jk connector 400 bad request

2015-04-24 Thread Razi

hi Christopher,

I checked up on the firewall, there is none between the webserver and the 
jboss application server.


I had enabled the trace in modjk.log and found the following entries, with 
KeepAliveTimeout set to 5


Apr21 15:31:53 2015 
[4023:140648883541760][trace]ajp_read_fully_from_server::jk_ajp_common.c(1399): 
enter


... a bunch of other requests.
...
Apr21 15:36:53 2015 
[4023:140648883541760][trace]ajp_read_fully_from_server::jk_ajp_common.c(1432): 
exit
Apr21 15:36:53 2015 
[4023:140648883541760][trace]ajp_read_into_msg_buff::jk_ajp_common.c(1487): 
exit
Apr21 15:36:53 2015 
[4023:140648883541760][debug]ajp_send_request::jk_ajp_common.c(1766): 
(worker12) browser stop sending data, no need to recover

unrecoverable error 400 , request failed
Consumed 0 bytes of remaining request data for worker
aborting connection for worker
attempting to map uri /error/http_bad_Request.html

There is no error in the Jboss application server logs.


Warm Regards
Razi A. Ansari
HP # 90625741
-Original Message- 
From: Razi

Sent: Thursday, April 23, 2015 9:41 AM
To: Tomcat Users List
Subject: Re: Apache Tomcat jk connector 400 bad request

Christopher,

When KeepAliveTimeOut is 5, 12 , I get the error, when its 15 and above I
don't get the error.

The versions of Apahce and Mod_jk are as follows

Apache 2.2.24
Mod_jk 1.2.37

I dont use Tomcat, my applicaton server is JBOSS EAP 6.1.0

I will get back to you with more logs. Thanks

Warm Regards
Razi A. Ansari

-Original Message- 
From: Christopher Schultz

Sent: Thursday, April 23, 2015 8:03 AM
To: Tomcat Users List
Subject: Re: Apache Tomcat jk connector 400 bad request

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Razi,

On 4/22/15 6:39 PM, Razi Ansari wrote:

 Original message  From: Christopher Schultz
ch...@christopherschultz.net Date: 04/23/2015  6:15 AM
(GMT+08:00) To: Tomcat Users List users@tomcat.apache.org
Subject: Re: Apache Tomcat jk connector 400 bad request


If you decide to change your timeout values (I don't see a reason
to

do so unless you are encountering some kind of related problem,
and I

don't consider this to be a related problem), make sure they are

consistent between mod_jk and Tomcat's AJP connector.


I tried inceasing the value of webserver KeepAliveTimeout to 15 and
i dont get the 400 bad request error in the test environment. But
i really want to know the root cause before i move it to
production. In my httpwatch i see the request going without any
body ony header.


Without the change in KeepAliveTimeout, can you reproduce this error
in your test environment? I would honestly be surprised if
KeepAliveTimeout is the trouble, here. For the AJP connector, the
KeepAliveTimeout is not relevant because AJP is by definition
keep-alive. You can disable it if you think doing so will improve the
situation, but I don't have any reason to suspect it would.

It would be great to know whether the AJP connector or the HTTP
connector was the one failing. In Tomcat, the stack trace will include
the thread identifier which includes the port number and protocol
being used. Please include that with your stack traces when you find the
m.

It would also be great to know which (exact) version of Tomcat is
being used under the hood. Check the logs during startup to see what
Tomcat says it is.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVODbWAAoJEBzwKT+lPKRYiBkP+QENinLAv9vXdjDi598Av56n
nin9n4jzkgVaMC7h/EpzM81w7rjVoNdfD9d3j472hQFyUY+x9iQwDxNRc25t7VHH
jwq21AZBqRDn6hNvLxxpXyKqVuLImZ08GFzI4PdelIQ0IuZ2WlRQwW1xNtcVZKgh
yq1/Az1zK82rzrIH8WJhu0frYNd5mqrrEEVCQfUs3pEJyqf0uQFM8buVVKScla3x
sb6qjo3+XCHGZ/KXFllr0t0E7fGlk7xP8NhRLzSO7AkDvUgk7SzAryN2VmwbTn3w
KbO3bzT7dQse+1ykj246L+TqIWJOsycooGagTRtH7kW/5jRXS6b8kLL08XhLY70z
Ybcfbd1gwIbihm29LsOaU54hWTyQYa5cSAzCXEaQsGUfaoDsuU4L69Uf+G40QcO6
c1cCvJImSFjpmVcoVtVitT+U6vDDK0kIcuyrb766GCyde2pRlFswCMho2GN2yT6L
2e9v9xqmLANZE0iaJpK2qUVE/efh1m+API/wFYXqnQhe2S5V8fXAGXM/rJdeOQNL
IXMZN4E1moVClbaKVn+TbtcexR9nmU6GPyaL+VoJauDJf5UV5Y31+wp+XgP1k13/
wQ0LoumpioPYp7QEbrSgNTUF5I2Q+Cp7VGtoO3PPDWzgcBH8eSiqHVnsC2da51k8
sjaBXvJn5/taUN49pEGo
=0W9M
-END PGP SIGNATURE-

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



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



Re: Apache Tomcat jk connector 400 bad request

2015-04-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Razi,

(What email program are you using? It doesn't seem to understand
mailing lists because your replies don't include the thread-id
required to properly-group mailing list threads. That's pretty
frustrating because all your messages look separate from the others in
the thread.)

On 4/24/15 8:10 AM, Razi wrote:
 I checked up on the firewall, there is none between the webserver
 and the jboss application server.
 
 I had enabled the trace in modjk.log and found the following
 entries, with KeepAliveTimeout set to 5

What is KeepAliveTimeout? Is that your setting on httpd? If so, that
only affects incoming requests from clients into httpd. It has no
effect on the connections between httpd and Tomcat.

 Apr21 15:31:53 2015 
 [4023:140648883541760][trace]ajp_read_fully_from_server::jk_ajp_common
.c(1399):

 
enter
  ... a bunch of other requests. ... Apr21 15:36:53 2015 
 [4023:140648883541760][trace]ajp_read_fully_from_server::jk_ajp_common
.c(1432):

 
exit
 Apr21 15:36:53 2015 
 [4023:140648883541760][trace]ajp_read_into_msg_buff::jk_ajp_common.c(1
487):

 
exit
 Apr21 15:36:53 2015 
 [4023:140648883541760][debug]ajp_send_request::jk_ajp_common.c(1766):

 
(worker12) browser stop sending data, no need to recover
 unrecoverable error 400 , request failed Consumed 0 bytes of
 remaining request data for worker aborting connection for worker 
 attempting to map uri /error/http_bad_Request.html
 
 There is no error in the Jboss application server logs.

Interesting. What about the access log? Does JBoss even admit to
accepting the request?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVOkHxAAoJEBzwKT+lPKRYrmAQAMBt4sgatAgrqHdSR9KxzYCo
lUbdUjuQ+lGi/nCc/HALcDjVRTtbagSMsTcJxl5uzpUn9JbAwUN/+ERCh8mSMLyH
jqIzrJD+lGJc+b5Eff6je3OFxZznpoieiN89oaodemVQzJW7oCSG5SNiYYqN6sBD
cE01OE+V6sSohmqRNQ3Ieh4Maz4X9/J6qD2sq9ax+r5b71jZHeA6BK9//XOgolyV
MeUSAuSC41ZnzdTMDozj8hrszilI5keBp4lWE0oIJJ7nHlkpqE0Zi13CN8NASUni
Z2QQRu+SjVf5EHY9Cjek+qdr5z2HGdjQyxBIz7RW2a1EKH8jCU5f5tlb3Mjl2++k
DywPlqfnJCeA03PPLuCnbiFW+M1M4JOoLrhKudwkKdsWz7SuURY1xy8G7ufue/ed
2d6hPINwVUb5Fr/FI7s2hj7ItZzx5IQ2DxSSCwdV3Ts0ePTK/acRKhu22lFfH0BH
YnshsMkLrja7LlV5SpZeB9oCyPZl0ecoPnCy3K8sBdnDDGOddwflnSn97jgLRK+/
j1Rr9CT+DXQLgiWeFnJZJ5Fq5HCG1EzoidZ4KBeMWQpxGr1ukmhxDbMkWMUE87X2
ycG+GGAZ0x+xA0R8xyeN65hP/7cS+07FMHdKdw7rZAmf6BWyxC5FxFerVWRM2hPY
IP4OKOfiXwivGBDwIgCC
=ZBL9
-END PGP SIGNATURE-

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



All Status is S Tomcat manager

2015-04-24 Thread Jian Wu
Hi,

I am running a website with a load balancer (software) and three web
servers, each of which deploys an instance of Tomcat 7. While the other two
web servers look OK, there is one web server which often gives me trouble
after restarting Tomcat.

Basically, the maxThread (2000) is reached and the server is almost not
accessible. When I open the server:8080/manager of that server, I found
that all the Stages under http-nio-8080 are S! The values of BSent
and BRecv are all 0 KB. What does that mean? To solve this problem, the
only way I know is to restart Tomcat, but after several days, the problem
emerges again.

These three servers are deployed in exactly the same way, so it is very
strange that one of them uses all 2000 theads, but the others use only less
than 300 threads! Currently, the load balancer distributes 3/7 traffic to
Server 1, 2/7 traffic to Server 2, and 2/7 traffic to Server 3.  The
problematic server is Server 2.

Thanks
Jian Wu


Re: [OT] Sending HTTP Trailers from a client (not servlet)

2015-04-24 Thread André Warnier

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

All,

Bump.

Anyone?



No, but I tried.  But everything I found seems to say that such trailers are really rarely 
used, and that's probably why you are not getting any echo.
I believe that initially you mentioned that you had found a perfectly good use case, but 
you never explained what it was...




- -chris

On 4/18/15 12:19 PM, Christopher Schultz wrote:

All,

I've got a perfect use-case for HTTP trailers but it doesn't seem
like any existing client (e.g. HttpURLConnection, HttpClient) has
support for them on the /sending/ side.

HttpURLConnection doesn't have a way (that I can see) to fetch 
trailing headers, but it may just be that you have to consume the 
response and then check the headers (similar to what you'd do in a 
Servlet when the client actually sends trailing headers to the

server).

HttpClient allows you to get the trailing headers from a response
in a very awkward way by reading them from the ChunkedInputStream
which is buried a few levels deep, evidently.

But neither seem to have a way to actually *send* headers to the
server.

Has anyone ever actually done this from a Java-based client? I'm 
currently using my own wrapper around HttpURLConnection (because 
HttpClient seemed to heavy for my purposes) and it's been working 
great for a few years. I'd like to support a streaming mode plus 
trailer headers with it, and I'd prefer not to dump

HttpURLConnection and replace it with low-level socket work because
them I'll have to do a whole bunch of work to reproduce what
HttpURLConnection is already providing (e.g. TLS, auto-redirects,
etc.).

Any ideas from the community?

Thanks, -chris

-



To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org

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


-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVOk4RAAoJEBzwKT+lPKRYLQUP/RtRPIVVhWQaFCDXV3PGwGqS
6Mm1mWndE+Ma1QpmQyHJtEDOI1r2dli/eUVclhlNtQyw4oc3vJssgmi0rfCmsJKJ
c0U5eFA+odNnJKGh06y3ItCR/KVYhwNzbMS7LGw537AAiFb4Ls7ZgdmJeMndL7zE
7ovalopWzqmATijOKZoWFIe3NEDvudGN+dYefOgBzQc5fTYyu1tsDJGUEF8BEULA
tW9aueeQztSJOG3+PgrdVOP3bGBYARorzcJgv5xF7wUEad2vbLcsrkphFZGVgsmH
NKOf7WVEqEWkAGap43Cb57j324nAcR/W1OqWMoUYlIhuR+r8YA9VM7Nm84xqsV2j
Fp5qQEzagkVAdGXibBBzEfa2neb1/HGtEOfNyH8O+zgC4+yJZH88lwY6FpnrUo5B
A3J0Pk0Gq2BW/CjjKUsfX97215BmZkM/I6BF7pZSshMdC4BHwNidtvh8X/acVc7+
8AZMTV+RyQUAZR4SagDUvaaATKBhC4K/SVvGOH9wAW+0HwDwE1luj4S9dkch0dzA
50CoJWaZLm/9Hk68xazvyxcHFLsu5cUf7CC9MvHZR8022kFX8fLHf2YNxZVv+jUO
UiXou9VKYIlPkhzDyHfl8HhWFRR+cO1D/nTzaDk7iqSQNKXr0PXTsvbUNCDjX8so
Tfkc7x6zoIuRGS0r3rAM
=BpMx
-END PGP SIGNATURE-

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





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



Re: Where are my non-persistent sessions stored ?

2015-04-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

David,

On 4/24/15 9:29 AM, David kerber wrote:
 On 4/24/2015 9:21 AM, Christopher Schultz wrote: Sreyan,
 
 On 4/23/15 9:24 AM, Sreyan Chakravarty wrote:
 I beg to differ but every time a new request is sent to the
 server, Tomcat creates a new session for it. So yes Tomcat
 creates a session even if the application does not ask for
 it.
 
 This is not true.
 
 If you can demonstrate that Tomcat is creating sessions that should
 be created, please provide a small example that does so.
 
 Did you mean ... sessions that should NOT be created...?

Er... absolutely! Thanks.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVOkuIAAoJEBzwKT+lPKRYDz4P/R4fUQwVT2OFSgD88IdIcifC
kDveNqhfYt4aEDMsLs7ooOvVnQssTAHh6BUJddlX66te8C0CL+ZbNOUpobV0lyKf
gszuI6v5+IB0APCPSvUqTu2t+BE04oB/rC0gbVfH0Ph6T+KGD40gysmdsRXnCLQn
nzebCrl6T8jfCriuqKUnZRq7jzv7vJDA50/Jt/ga16/N/r0SpsrlpNpSahSM74Ij
qHsWwYsk8YM2AbZGaOim8NzysG/HAd4suR8X/u7xrcK5N7wDeN+1XFxZRZKpco65
BmGA8OyPJXGwfMV45dTRq6DiJLe1Hzq1k9vT3YTDIkRqtevs96ghqHhvsvTvLIkj
ebfHunQ4fPs1ZHVdHBIcZ7oRFErJ770Rbqc1dEwb5XjDlXmrZ+bEh8qZbavB4xVi
l5T82UiVQ9GvObU3GbwDN1HXMexeBzj+3ioF3lCc+KYmtpZt/MB8BenkYQXNOm1C
p4RqYXip4Bom1sUaQ82zTaSDldBNivofSdQ3AHoh4uWAf7dan7njrQU9KldL0Ilu
a43bUJxyZufbDUFpnY5Ox4WiOJQNq3lAdWbPUySzxyWVa5SdDcjKUxEjNHeXH002
Dssc7wi/A6MfQyxfzxhSFiyTKQ8YD/qqhly7L4jl6YvAoiPlCroCQSfZwyES0JFr
nZTNie6fIQreL2Ig8UKx
=PXhp
-END PGP SIGNATURE-

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



Re: How does Tomcat identify web socket endpoint in a war?

2015-04-24 Thread Mark Thomas
On 24/04/2015 12:25, Thusitha Thilina Dayaratne wrote:
 Hi,
 
 Could someone tell me how does Tomcat identify the websocket endpoints in
 .war file?
 Does it scan all the classes and looks for annotations?

Yes, as required by the WebSocket 1.1 spec.

Mark


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



Re: Why is Class.forName required to load drivers in Tomcat 8 ?

2015-04-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Sreyan,

On 4/23/15 9:22 AM, Sreyan Chakravarty wrote:
 So what happens when I add something to the build path of a
 web-app?

The build path is an Eclipse concept that has no meaning after the
application has been built.

 The dependency is not registered?

What dependency? Where would it be registered? The only think Java
knows about is the current thread's context ClassLoader and what it
can see. And the DriverManager always uses the System classloader to
find drivers automatically. Have a look at the source code for
DriverManager. It should be in src.zip:java/sql/DriverManager.java.
The method you're looking for is loadInitialDrivers (at least in
Oracle's JRE.. it's not a public part of the API).

 Also does that mean that whatever dependency I need I will have to 
 put it in the /lib folder?

What other dependency?

 I just don't understand why it doesn't work if I add it to the
 Build Path from Eclipse like I do for a normal Java Application.

Because Tomcat does ClassLoading in a more complicated way than with a
standard Java application, where every library is just thrown into the
system classpath.

Tomcat does this to enforce certain security requirements, to provide
insulation against other components, to support embedded usage, and to
support plugability of certain features.

I'm sorry to say that you simply must call Class.forName to load your
driver. If you use either of Tomcat's built-in connection pools (one
based upon commons-dbcp, the other called tomcat-pool), you won't have
to call Class.forName because the pool will do that for you.

You don't have to put the JDBC driver into Tomcat's lib/ directory;
you can put it into your web application's WEB-INF/lib directory
instead, just like all the other libraries that your web application
requires. But be aware that *many* JDBC drivers are poorly-written,
and can cause all kinds of memory leaks when the application is
undeployed or re-loaded.

Hope that helps,
- -chris

 On Thu, Feb 19, 2015 at 2:19 AM, Christopher Schultz  
 ch...@christopherschultz.net wrote:
 
 Sreyan,
 
 (Sorry, I sent way before I was done writing. Full intentional
 message follows.)
 
 On 2/18/15 10:15 AM, sreya...@gmail.com wrote:
 What is the SYSTEM PATH that you are referring to ? Is it
 the JAVA_HOME or the PATH system variable ?
 
 Neither of those. It's commonly referred to as the CLASSPATH 
 environment variable, which should pretty much never be set
 because it's horribly confusing.
 
 Instead, Tomcat uses java -classpath [the classpath] to launch
 the JVM. The classpath used there includes two JAR files:
 
 bin/bootstrap.jar bin/tomcat-juli.jar
 
 So the only thing that javax.sql.DriverManager can scan is the
 boot classpath (that includes all the JVM internals) plus the
 system classpath (which includes just those two specific JARs
 above).
 
 What is the CLASSPATH just before Tomcat properly starts up?
 
 The boot class path includes JVM stuff (rt.jar, etc.)
 
 The system class path includes anything the JVM environment was 
 instructed to load when launched (either from the CLASSPATH 
 environment variable, or from the -classpath argument on the 
 command-line).
 
 Tomcat's bootstrap class creates a new ClassLoader which includes 
 everything in lib/*.jar and then starts the Tomcat container using 
 *that* as the effective class path.
 
 What is it after it starts up?
 
 Well, Tomcat can see everything in the boot and system class paths 
 (ClassLoaders) plus everything in lib/*.jar.
 
 Correct me if I am wrong that means that whatever
 dependencies I have in my project is not added to the SYSTEM
 CLASSPATH but is instead loaded by TOMCAT.
 
 Correct.
 
 So if a module searches only the SYSTEM CLASSPATH it won’t be
 able to find the dependencies. Am I right ?
 
 Correct. And DriverManager can't search *down* into ClassLoaders
 it doesn't know about -- including Tomcat's ClassLoader. So, 
 DriverManager can't load your JDBC driver using its standard
 detection algorithm.
 
 So, you still need to call Class.forName to register the driver.
 
 -chris
 
 -

 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVOkZpAAoJEBzwKT+lPKRYxIoQAI4rf1nfa5RWsMWFHb98dIDi
/1KHw9EgjtUI0n+HP5AthmeHYUhXolrUsiFnx+gfmspViKF/wTs0iVUkyZjRTPF0
m1v3DNfy/VvvRpXiEyLUJbvSfzkLo+Axg3tH/licfcZbhKi16ubeGDUWYq9juSBm
O8GiYrifkJbYVNYU/FT1wlp68agvgQlYDqygrVz3bhv5rYVlCfX/ja5LUyZPlJeu
556cLNmV0tNAVG+dpK2wfz/uZoa6QrO9CR02GCdSqq+opBiQN2uxwweiY5Zl2REf
N3G37ixDEa2hTJLb0H3YBymIZfSB5jxe2AAOV+iVwTMMznl1wClR9matzF/w3NP8
RgJimcAgDOdAILE1I+J9p8Tl6DMPR13vJc9IF0GzUWoApiZ9MS+6Q4PUWFuFVxTY
oUTiXeeWY6FkBj4GdCx38tk4r2+6Vh3COnzK0E0wTxpAtJIC6P8zsFtXouS8zjm5
8hQl2aMKrumYE7ZC1RuKQnJ5QGWGMcyb+RbVEoXPOKjYDVl3sxZPjn23gd0zjlyd

Re: Tomcat Thread issue

2015-04-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Felix,

On 4/24/15 3:19 AM, Felix Schumacher wrote:
 Am 24. April 2015 09:08:08 MESZ, schrieb Subhro Paul
 subhro.p...@tcs.com:
 
 
 -Subhro Paul subhro.p...@tcs.com wrote: - To:
 users@tomcat.apache.org From: Subhro Paul subhro.p...@tcs.com 
 Date: 04/23/2015 06:20PM Subject: Re: Tomcat Thread issue
 
 -Daniel Mikusa dmik...@pivotal.io wrote: - To: Tomcat
 Users List users@tomcat.apache.org From: Daniel Mikusa
 dmik...@pivotal.io Date: 04/23/2015 05:01PM Subject: Re: Tomcat
 Thread issue
 
 On Thu, Apr 23, 2015 at 7:15 AM, Subhro Paul
 subhro.p...@tcs.com wrote:
 
 Dear Team,
 
 One of our client's website stopped working yesterday. We
 observed
 that
 Tomcat servers were not working properly during that time. We
 have
 checked
 the memory usage of the server was fine but in the Catalina.out
 log
 we
 found it was already reached to max thread which is 512 though
 the
 number
 of connections to the server was normal. We took a thread dump
 from
 the
 server using VisualVM and we got the below message from
 threaddump:
 
 
 Since a thread dump is a point in time snapshot, you should
 always take multiple thread dumps, with a few seconds in between
 each one.  This gives you additional perspective as to what's
 happening with the threads over a period of time.
 
 
 
 http-8080-1 - Thread t@22
 
 java.lang.Thread.State: BLOCKED
 
 at java.util.Vector$1.nextElement(Vector.java:320)
 
 - waiting to lock 37749687 (a java.util.Vector) owned
 by
 http-8080-116 t@161
 
 at 
 org.apache.jsp.includes.header_jsp.isExcludePath(header_jsp.java:116
)


 
at
 org.apache.jsp.includes.header_jsp._jspService(header_jsp.java:314)



 
Look at what header.jsp is doing.  It seems to be doing something with
 the Vector class which is causing the thread to block.
 
 
 
 at 
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)


 
at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 
 at
 
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:377)


 
at
 
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
13)


 
at
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)


 
at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 
 at
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)


 
at
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)


 
at
 
 org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDisp
atcher.java:646)


 
at
 
 org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationD
ispatcher.java:551)


 
at
 
 org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDis
patcher.java:488)


 
at
 
 org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary
.java:968)


 
at
 
 org.apache.jsp.home.customer_005fservice.bill.my_005fbill_jsp._jspSer
vice(my_005fbill_jsp.java:126)


 
at
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)


 
at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 
 at
 
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:377)


 
at
 
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
13)


 
at
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)


 
at
 javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 
 at
 
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)


 
at
 
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)


 
at
 
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)


 
at
 
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)


 
at
 
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:127)


 
at
 
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102)


 
at
 
 org.apache.catalina.valves.RequestFilterValve.process(RequestFilterVa
lve.java:269)


 
at
 
 org.apache.catalina.valves.RemoteHostValve.invoke(RemoteHostValve.jav
a:81)


 
at
 
 org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:
555)


 
at
 
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)


 
at
 
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:298)


 
at
 
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:857)


 
at
 
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:588)


 
at
 
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:48
9)


 
at java.lang.Thread.run(Thread.java:701)
 
 
 
 Locked ownable synchronizers:
 
 -  None
 
 
 
 This was coming for different threads. Once we restarted the
 servers,
 the
 website back to normal again but we got the 

Re: Info: WebSocket connection closed, Code: 1006 when try to run websocket sample

2015-04-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Thusitha,

On 4/24/15 7:40 AM, Thusitha Thilina Dayaratne wrote:
 Furthermore I've tried following things out and both options works
 without issue.
 
 1. Running tomcat distributed examples in my server 2. Running the
 war file that I built inside Tomcat
 
 I've mistaken here. My war file doesn't run on Tomcat either.
 
 
 When I used the following dependency to build the example webapp,
 instead of 302 I'm getting 404 error.
 
 dependency groupIdjavax.websocket/groupId 
 artifactIdjavax.websocket-api/artifactId 
 version1.0/version scopeprovided/scope /dependency
 
 Am I having wrong dependency here? If so what are the dependencies
 that I should include when do the build?

You aren't getting very many responses, here.

The problem is that you are asking for solutions to problems that
nobody understands. You are asking us why doesn't this work, but you
haven't told us what it is.

Imagine that I am writing a web application that needs to process
financial transactions (e.g. DEBIT, CREDIT), and it's not working for
some reason. If I asked you why does my web application return 404,
but didn't provide any code, or any explanation of the architecture,
or any of that, you would have no idea what could possibly be wrong
with my code. It could be simple a configuration problem. It could be
a complete misunderstanding of how a web application works. It could
be a very rarely-seen bug that only occurs when users with an account
number that happens to be a prime number plus one try to do a DEBIT
operation.

So, take a step back.

The Tomcat distributed examples work. That's great: it means that
Tomcat itself is capable of running Websocket applications.

Your application does not work: it seemed to be returning a 302 error
which may suggest that the Websocket library hasn't properly initialized
.

Are you using Tomcat in an embedded way, or are you launching it from
the traditional bin/startup.sh, etc. way? Are you trying to side-load
the Websocket library, or are you expecting that Tomcat will
auto-detect and initialize it? Does your own code include anything
other than servlets that request an upgrade to a Websocket connection
and then do their thing?

Without this information, nobody will be able to help you.

It's frustrating to have to beg for information in order to help
people. You have posted a lot of questions recently on this list where
the responses are all of the form I can't help because you haven't
provided enough information. Your responses tend to ask new questions
and not really provide that vital information to help you.

None of us are paid for the time we spend answering questions on this
mailing list -- at least, nobody that I know of. At some point, people
stop bothering to ask, because they just expect that you are going to
ignore the requests for more information and they will still be unable
to help.

So, again: take a step back.

Remember that none of us has even a passing understanding of what you
are trying to build, how you are building it, what the Maven
dependencies are (or even mean, in some cases), etc. You need to tell
us all of that to give us some context.

Then we might be able to help you.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVOktUAAoJEBzwKT+lPKRYwS0P/RswUwhyBqD+B8R4TPQz+Mua
vsMi6vuCmX+9NrVM2iUrArLxbhsg3fCkHOqGRPmYHGomhXrNdBV5O69Uw6wFItB6
l+ZneFKvK5W4b30BKwLtvaSycqy8LonSFo0dxE9fAVIsACpF7BqxEO6RJHyZKbiA
aVHZY32xadX5DfN1I7h+eNwsET68dg1208tzleB3n1lepcdRWgZA73eeI/91quIr
f2qd0Ui/a9q+CoXopo3kuGLmGU1t2rwkPV6IU+ViDe9A4s32749mrKTYbMDmevWD
ItyUpKE0o69sGKq7FR8tt0q8oR3UD0XldbO+hLc73iNPKUFdVLx0vreDdn+kgvyd
thbQKuJlFa13Y/3BTWlHUFl2xekxwP8Qsy3E1Q/WH8wer45Oizzu3/kpGW6o29FO
HYxI+ZwrKi6yUp7kB1Xde1In6/vd/3/ja7GKKQxetleyC8JGS0p391VvggUKdybO
T/g5xt/b5rZm+nVfjSB4Cv7PSXLe9/LKOmD6Lq9on2SredXIpR8j1WzCN3vufC3H
uyayIEonW2fB0Fkwim/9Ku410vUrHGLFK4g9QkR/wN6Z04/Qr+RhnFlKEfPmuwYH
COAE8ap1D4q/lVdTFNvbk3HpozLfw+4Sfrz6R11fha6XwxFGxyNIbWsUuUt/Zy3a
jYzRJ3hwlnMkjZWe5Wdc
=brQN
-END PGP SIGNATURE-

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



Re: Tomcat 6.0.37 on As400 don't work more

2015-04-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Buon Giorno,

On 4/23/15 10:06 AM, gio.cot wrote:
 this morning (without in appearance  have done nothing) I don't 
 succeed to run  my applications Web installed on Tomcat on As400.
 If I open the Tomcat console I see  listed only the applications /
  host-manager and /manager, all the me applications are not listed 
 anymore.

It looks like your applications have been undeployed or removed from
the webapps/ directory. Have you checked the filesystem to make sure
that all the web applications are where you think they should be?

Is there some other administrator who could have made changes, here?

 If I go with Wrklnk on webapps I see them.

What is Wrklnk?

 In the log I find the following errors: can you help me to
 understand where could be the problem ?

The errors you are seeing are from deploying the examples web
application, which it seems like you don't want to do, anyway.

Find out what's going on with your installation; it looks like someone
has probably changed something.

What version of Tomcat are you running?

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVOkLJAAoJEBzwKT+lPKRYXk8P/2TfC8rjHOvzcZPb9vGallca
ugnePBwOY8tuqpqFuauZgHtwpcHpDXgi4luM/QFOsJsA0afzwc6EM7vTb6msyShn
qL48BCiaBq1lOcX6O50j/BNqyrONNNQvcFJ2vTA26Vd0NPta+A4WV2TkpSOj41Kz
HyP0SkW+s861fqKjYvZZIfN4eE0SkvtASGpJyq+HPIv2/kcJM5hmcTRd94wOqNtx
wR7u4d3+i6uh9d7FRH3krTWZZ6KmpozivIlckes42yJ0/Gl7uldEIBW2IT4t8/Wh
VS7mzmVioKfT6zjK48qMnwgKij/VZlruUzKxwphUAI/F9h8FqO8inSlH1jU3W4fT
glT7YnblMYxZa7ibINJpJOfYgCka9QqoBN/9JOzQ9aMwLg7v+x39Qd52dwCQ3Me0
3gxLaMI7gTO1V+NCERaLPALXE7Z2XQBD2tE7SjAkHgOOuDA1TeSV7bb+ch3yWPEK
bc6G/6fFwuUY0gy9eD5kO3fKX3PFSAYkjWSKj64fHC0zRigMRbg8PKnRev11h/3M
4X3I0lFHJcDYsLYQsp4eNxjq+CdRiTThUuCQ0NI8FkVrh12IDGFS8zYGb83IFN93
q9BPfy9t0iom8Ru5crdpKNwCljDSB14VDP3h3RbJrnx2jS6qWT8hEQbIuicAnO//
l8lkvKYp3nCPG3clQLlF
=WJ/E
-END PGP SIGNATURE-

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



Re: Where are my non-persistent sessions stored ?

2015-04-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Sreyan,

On 4/23/15 9:24 AM, Sreyan Chakravarty wrote:
 I beg to differ but every time a new request is sent to the server,
 Tomcat creates a new session for it. So yes Tomcat creates a
 session even if the application does not ask for it.

This is not true.

If you can demonstrate that Tomcat is creating sessions that should be
created, please provide a small example that does so.

 Every unique session generates an unique session id on the server.

I should hope so.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVOkNzAAoJEBzwKT+lPKRYxqYQALqzGKeZF/9IXzpuBd91h9oi
fdNBncyrRuMUvN85hzTUl+ry9vevzN4nHZEzN2+oQUzO/+O7gFiET+dQYxR69bl5
A/eL/6pZiXoZQlpuRapVuRQmhphf/7tgQdLolhAXxt8GSeKuYd9fRBK4+cD4o9vZ
udGhhbJzkZ8nKQv8hVA8Gt3tzx7KkcQhRdBZ4EWQQBCd4RO/oe8yViCoglK4DTx5
7RIhTqLeHABZDy0SAisWXUxlv0ajRP5tgSSQEeD0kUe/3DEJQjOuKyCL9WFzwxQU
iFesIYvnE+Lu0759nwkUYTPqY7E5wZeTZyHwl/wnZLGuMzzZLwe4USeZ3QLCieLc
/MSfivIy3VJL8NbPLCtQ2V9zVEht8ljB/D+Sb1zLfc+0jY/OCmWux3ws7KQ6UwdA
pkQheiJaOpnJkxDxwS4yH3dQhr6tFEMO1nOKw40v4TJP3Gvycc/BzCt0zVZV2EcJ
QhQaQJOLG3qtkNz65ybM91MwqnSjDngeVzsEw1zyHIQt497hO8D3jaaMgsSrtAZe
K4kG6Mj+ZcptD4E+FwABdFix/XOhpjdOXlGO/LSmXq0rnpOw0aQOrcadTeUVOrWg
OiLmHbqTJ8U0d7Tys0rEVGi1qdi+z6R5KQ37gXFv6LmC5EjOLkjSlfr26OuHh4JW
AM+vdYLS3qmiX/Ymo44g
=BtTh
-END PGP SIGNATURE-

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



Re: Where are my non-persistent sessions stored ?

2015-04-24 Thread David kerber

On 4/24/2015 9:21 AM, Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Sreyan,

On 4/23/15 9:24 AM, Sreyan Chakravarty wrote:

I beg to differ but every time a new request is sent to the server,
Tomcat creates a new session for it. So yes Tomcat creates a
session even if the application does not ask for it.


This is not true.

If you can demonstrate that Tomcat is creating sessions that should be
created, please provide a small example that does so.


Did you mean ... sessions that should NOT be created...?






Every unique session generates an unique session id on the server.


I should hope so.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVOkNzAAoJEBzwKT+lPKRYxqYQALqzGKeZF/9IXzpuBd91h9oi
fdNBncyrRuMUvN85hzTUl+ry9vevzN4nHZEzN2+oQUzO/+O7gFiET+dQYxR69bl5
A/eL/6pZiXoZQlpuRapVuRQmhphf/7tgQdLolhAXxt8GSeKuYd9fRBK4+cD4o9vZ
udGhhbJzkZ8nKQv8hVA8Gt3tzx7KkcQhRdBZ4EWQQBCd4RO/oe8yViCoglK4DTx5
7RIhTqLeHABZDy0SAisWXUxlv0ajRP5tgSSQEeD0kUe/3DEJQjOuKyCL9WFzwxQU
iFesIYvnE+Lu0759nwkUYTPqY7E5wZeTZyHwl/wnZLGuMzzZLwe4USeZ3QLCieLc
/MSfivIy3VJL8NbPLCtQ2V9zVEht8ljB/D+Sb1zLfc+0jY/OCmWux3ws7KQ6UwdA
pkQheiJaOpnJkxDxwS4yH3dQhr6tFEMO1nOKw40v4TJP3Gvycc/BzCt0zVZV2EcJ
QhQaQJOLG3qtkNz65ybM91MwqnSjDngeVzsEw1zyHIQt497hO8D3jaaMgsSrtAZe
K4kG6Mj+ZcptD4E+FwABdFix/XOhpjdOXlGO/LSmXq0rnpOw0aQOrcadTeUVOrWg
OiLmHbqTJ8U0d7Tys0rEVGi1qdi+z6R5KQ37gXFv6LmC5EjOLkjSlfr26OuHh4JW
AM+vdYLS3qmiX/Ymo44g
=BtTh
-END PGP SIGNATURE-

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





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



RE: Apache Tomcat jk connector 400 bad request

2015-04-24 Thread Razi Ansari

 Date: Fri, 24 Apr 2015 09:15:29 -0400 From: ch...@christopherschultz.net
 To: users@tomcat.apache.org
 Subject: Re: Apache Tomcat jk connector 400 bad request
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256
 
 Razi,
 
 (What email program are you using? It doesn't seem to understand
 mailing lists because your replies don't include the thread-id
 required to properly-group mailing list threads. That's pretty
 frustrating because all your messages look separate from the others in
 the thread.)
 
Apologies for the email, I am using Window Live Mail as my mail client.

 On 4/24/15 8:10 AM, Razi wrote:
  I checked up on the firewall, there is none between the webserver
  and the jboss application server.
  
  I had enabled the trace in modjk.log and found the following
  entries, with KeepAliveTimeout set to 5
 
 What is KeepAliveTimeout? Is that your setting on httpd? If so, that
 only affects incoming requests from clients into httpd. It has no
 effect on the connections between httpd and Tomcat.
 
KeepAliveTimeout, this is the one in httpd.conf of Apache Web Server. I set it 
to 5, i get the 400 error,increase it to 15, don't get the error.

  Apr21 15:31:53 2015 
  [4023:140648883541760][trace]ajp_read_fully_from_server::jk_ajp_common
 .c(1399):
 
  
 enter
   ... a bunch of other requests. ... Apr21 15:36:53 2015 
  [4023:140648883541760][trace]ajp_read_fully_from_server::jk_ajp_common
 .c(1432):
 
  
 exit
  Apr21 15:36:53 2015 
  [4023:140648883541760][trace]ajp_read_into_msg_buff::jk_ajp_common.c(1
 487):
 
  
 exit
  Apr21 15:36:53 2015 
  [4023:140648883541760][debug]ajp_send_request::jk_ajp_common.c(1766):
 
  
 (worker12) browser stop sending data, no need to recover
  unrecoverable error 400 , request failed Consumed 0 bytes of
  remaining request data for worker aborting connection for worker 
  attempting to map uri /error/http_bad_Request.html
  
  There is no error in the Jboss application server logs.
 
 Interesting. What about the access log? Does JBoss even admit to
 accepting the request?
The access log ,shows time of request received  (%t), as 15:31:53 2015 , with 
300 seconds as the time taken to serve the request (%D). But this line is 
actually printed 5 minutes afterward with other requests which were received at 
15:36:48 , and also it shows 400 as status.
Another thing I notice in the modjk.log, is that for this request, I only see 
the request header getting printed, don't see any body getting printed in the 
logs.
On Jboss logs, I can see the request coming in, wait for 5 minutes and then 
process the request successfully.

 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v2
 Comment: GPGTools - http://gpgtools.org
 
 iQIcBAEBCAAGBQJVOkHxAAoJEBzwKT+lPKRYrmAQAMBt4sgatAgrqHdSR9KxzYCo
 lUbdUjuQ+lGi/nCc/HALcDjVRTtbagSMsTcJxl5uzpUn9JbAwUN/+ERCh8mSMLyH
 jqIzrJD+lGJc+b5Eff6je3OFxZznpoieiN89oaodemVQzJW7oCSG5SNiYYqN6sBD
 cE01OE+V6sSohmqRNQ3Ieh4Maz4X9/J6qD2sq9ax+r5b71jZHeA6BK9//XOgolyV
 MeUSAuSC41ZnzdTMDozj8hrszilI5keBp4lWE0oIJJ7nHlkpqE0Zi13CN8NASUni
 Z2QQRu+SjVf5EHY9Cjek+qdr5z2HGdjQyxBIz7RW2a1EKH8jCU5f5tlb3Mjl2++k
 DywPlqfnJCeA03PPLuCnbiFW+M1M4JOoLrhKudwkKdsWz7SuURY1xy8G7ufue/ed
 2d6hPINwVUb5Fr/FI7s2hj7ItZzx5IQ2DxSSCwdV3Ts0ePTK/acRKhu22lFfH0BH
 YnshsMkLrja7LlV5SpZeB9oCyPZl0ecoPnCy3K8sBdnDDGOddwflnSn97jgLRK+/
 j1Rr9CT+DXQLgiWeFnJZJ5Fq5HCG1EzoidZ4KBeMWQpxGr1ukmhxDbMkWMUE87X2
 ycG+GGAZ0x+xA0R8xyeN65hP/7cS+07FMHdKdw7rZAmf6BWyxC5FxFerVWRM2hPY
 IP4OKOfiXwivGBDwIgCC
 =ZBL9
 -END PGP SIGNATURE-
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
  

Re: Apache Tomcat jk connector 400 bad request

2015-04-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Razi,

On 4/24/15 9:34 AM, Razi Ansari wrote:
 
 Date: Fri, 24 Apr 2015 09:15:29 -0400 From:
 ch...@christopherschultz.net To: users@tomcat.apache.org Subject:
 Re: Apache Tomcat jk connector 400 bad request
 
 Razi,
 
 (What email program are you using? It doesn't seem to understand 
 mailing lists because your replies don't include the thread-id 
 required to properly-group mailing list threads. That's pretty 
 frustrating because all your messages look separate from the others
 in the thread.)
 
 Apologies for the email, I am using Window Live Mail as my mail
 client.

It's okay. It's just a minor irritation. But it /will/ make the
archives a mess.

 On 4/24/15 8:10 AM, Razi wrote:
 I checked up on the firewall, there is none between the
 webserver and the jboss application server.
 
 I had enabled the trace in modjk.log and found the following 
 entries, with KeepAliveTimeout set to 5
 
 What is KeepAliveTimeout? Is that your setting on httpd? If so,
 that only affects incoming requests from clients into httpd. It has
 no effect on the connections between httpd and Tomcat.
 
 KeepAliveTimeout, this is the one in httpd.conf of Apache Web 
 Server. I set it to 5, i get the 400 error,increase it to 15,
 don't get the error.

Yeah... that's really weird.

 There is no error in the Jboss application server logs.
 
 Interesting. What about the access log? Does JBoss even admit to 
 accepting the request?
 
 The access log ,shows time of request received  (%t), as
 15:31:53 2015 , with 300 seconds as the time taken to serve the
 request (%D). But this line is actually printed 5 minutes
 afterward with other requests which were received at 15:36:48 ,
 and also it shows 400 as status. Another thing I notice in the
 modjk.log, is that for this request, I only see the request
 header getting printed, don't see any body getting printed in the
 logs. On Jboss logs, I can see the request coming in, wait for 5
 minutes and then process the request successfully.

The good news is that Tomcat is accepting the request, logging it,
etc. A 400 response usually means that the request is broken in some
way. It could be a partial request or something like that. For
instance, an HTTP/1.1 request that never provides the \r\n\r\n
required after the headers would just hang waiting or the \r\n\r\n.
When the request-read timeout (keepAliveTimeout, defaulting to
connectionTimeout, defaulting to -1; infinite) occurs, the connection
will simply cancel the in-flight request.

Have you set connectionTimeout or keepAliveTimeout to something other
than their defaults? This would be in the JBoss configuration. I don't
know how those timeouts are expressed in JBoss, but in Tomcat they
would be on the Connector element.

I think you might want to take this question to JBoss, especially if
you are using a version of JBoss that doesn't use Tomcat under the cover
s.

Your mod_jk configuration looks fine to me; I can't think of a reason
why you would be getting these dropped connections, unless you are
under some kind of attack by someone trying to exploit a
request-splitting vulnerability that exists somewhere in your stack.
(And it would have to exist, because some component is convinced that
there is a request that hasn't been fully made, and presumably the
client is only sending complete requests.)

You may have to pull-out a packet-sniffer for this one.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVOk3CAAoJEBzwKT+lPKRYGSsQAJFkvk/lrhGT92Em2BRJfVnh
uzfHA3h8+Ynbgcc3CJzLGYleXbvC/HSIzcC1YTPmZZGs8mOBTz3yicwRwbrPryC/
OlqC4v0lloN0eTZ8dub7P6dUg8g5awP+4G6r8WEdZ55WuIReQgDo3kD/2Md8+RXF
rwPbOHFWUCwF56URqEEJ2fSbjH1D37lxT+oR6BCHGcRftoUmnffPCHXY5dY1RGNg
k8tuvREPvPz6HE00JYpIfnphCnS7z37fo+fQgNmyXqwKhE8aWnQZEZ2R5zlK+u78
7ex04iSIGFJSrh3vOci6Vq9R5i3dIBKK2s/WGuUQ9aKcAbcxnyqgfkz9ssp6fWUi
v4fQ+li1ZwwP9SYB6XgT6yGRwZ2UJsOGHfV93AkjzZ505vEJd6r1LjaB+ZxZ1Z6V
P2Km9VrQe844QdNOGphWTYaEDYUXjLScSlS8gAXWG/zh9r0dUravZiiXReXY8FLd
I6mkzK1+ThuOEQqvHDN+hN9ClrlSlQ9D6JbN90BdlhQQA/5PGlwyKluapG/4UEpe
0+vUALR6/IiQ4HwgrkitXGpOjPvVTZWnjs2pyS5ulezs5qzMNXdctKzWLsQ8tuR7
F/uosc575v1om/j2XKtrbK/+lNA2PSEJ9WhjLsL8dLygH1/jmL1LDJQwAeESzock
gLQX0EYmGUG8QJBI1+sq
=MlqE
-END PGP SIGNATURE-

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



Re: [OT] Sending HTTP Trailers from a client (not servlet)

2015-04-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

André,

On 4/24/15 10:17 AM, André Warnier wrote:
 No, but I tried.  But everything I found seems to say that such 
 trailers are really rarely used, and that's probably why you are
 not getting any echo.
 
 I believe that initially you mentioned that you had found a 
 perfectly good use case, but you never explained what it was...

I'm happy to explain. It's actually kind of the poster-child for trailer
s.

I have an XML message that I'd like to send to a server, and I'd like to
sign it with a cryptographic signature (an HMAC, actually). I'd like to
be able to support LARGE messages, even though for the most part, they
are currently small. In order to do this today, we read the *whole*
message from wherever it came from, HMAC the whole thing, then contact
the server and send the HMAC as a header, then dump the *whole* message
into the request entity.

These days, most messages are at more a few kb or whatever, so buffering
them in memory isn't a big deal. Also, the client isn't on a server, so
it's not like we are going to make much in the way of resource issues,
here.

Anyhow, I'd love to be able to support a more streaming-friendly
interface so we could handle huge messages. We would simply stream the
XML as the request entity, and when it was done, we'd add the trailer
that says oh, btw, the HMAC was [x].

I hope that clears things up.

Thanks,
- -chris

 On 4/18/15 12:19 PM, Christopher Schultz wrote:
 All,
 
 I've got a perfect use-case for HTTP trailers but it doesn't 
 seem like any existing client (e.g. HttpURLConnection, 
 HttpClient) has support for them on the /sending/ side.
 
 HttpURLConnection doesn't have a way (that I can see) to
 fetch trailing headers, but it may just be that you have to
 consume the response and then check the headers (similar to
 what you'd do in a Servlet when the client actually sends
 trailing headers to the server).
 
 HttpClient allows you to get the trailing headers from a 
 response in a very awkward way by reading them from the 
 ChunkedInputStream which is buried a few levels deep, 
 evidently.
 
 But neither seem to have a way to actually *send* headers to 
 the server.
 
 Has anyone ever actually done this from a Java-based client? 
 I'm currently using my own wrapper around HttpURLConnection 
 (because HttpClient seemed to heavy for my purposes) and
 it's been working great for a few years. I'd like to support
 a streaming mode plus trailer headers with it, and I'd prefer
 not to dump HttpURLConnection and replace it with low-level
 socket work because them I'll have to do a whole bunch of
 work to reproduce what HttpURLConnection is already providing
 (e.g. TLS, auto-redirects, etc.).
 
 Any ideas from the community?
 
 Thanks, -chris
 
 ---
- --




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


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


 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVOlScAAoJEBzwKT+lPKRYKO4P/2vFLX7eP9BmCc/TBtw/6wV2
06u4ekIeIR1gkBaPJq5dp5y8dRfqeysIEzhgXKFTiLuqF5SLNdRXaCs5twQRiZrw
JDh6d8Zy7Sec2HOXDAfNzzBq2AROKDz/PPWJYXbJLmwmGQTqIh3J72+HKsAVwesi
BB8QxI0o04iDmmkcSzjkRcztKriVfAJtksAjyJcB4bw7xlcJdEhOXbtbO6wJ6Yd0
m0eQQbU8mAJiqM9VkHPSUEnmR3P5s1vxIJ5e4tZYEO8CADDhZkBCwTyQKhZctteE
uDwq8XoTAmTuqXyAfUBqmGilpjNU9EF9I/K0ZnLydoAsVmD5IrGMNutx0ya6g4cs
W5nc9O2NE96sisdicAdZEj9t7CbRc9Vwb44j/drMiAZRBYzcplTmeII1+5UgWGJp
apa1DwZOPOcnLkW3GKkHRv/Wv02r9qmVAmFRVLNIsXp4cKgvTm8pC3vJhmpiEaya
hUzpoJbDL1JFkeUYqMXlfJ7qHkA23tUsiez9Ws1wtP4ux5XFesd5OficoyY/ZCSd
zhf9s204JfFqND0IGPnUHOqqK/rAe1D1GE/1me95iN2h9/vB8TvbvfehiP5JIR7K
Y7/61OTaeA++vutdXDpPTg6VVEG0mker+TcQFbHf2c9Xkp+K5Gj55loHflsHf1bD
e0hwdkEmw28JkbSp/QmV
=lVZp
-END PGP SIGNATURE-

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



Re: All Status is S Tomcat manager

2015-04-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Jian,

On 4/24/15 10:17 AM, Jian Wu wrote:
 I am running a website with a load balancer (software) and three
 web servers, each of which deploys an instance of Tomcat 7.

Just to be clear, you have a single load-balancer, 3 web servers
(httpd?), and 3 Tomcat servers? Or is Tomcat considered a web server
in this scenario?

 While the other two web servers look OK, there is one web server 
 which often gives me trouble after restarting Tomcat.
 
 Basically, the maxThread (2000) is reached and the server is almost
 not accessible.

That's a lot of threads.

 When I open the server:8080/manager of that server, I found that
 all the Stages under http-nio-8080 are S! The values of
 BSent and BRecv are all 0 KB. What does that mean?

Those are metrics I don't recognize. Are these stats kept and shown by
the load balancer?

 To solve this problem, the only way I know is to restart Tomcat,
 but after several days, the problem emerges again.
 
 These three servers are deployed in exactly the same way, so it is
 very strange that one of them uses all 2000 theads, but the others
 use only less than 300 threads! Currently, the load balancer
 distributes 3/7 traffic to Server 1, 2/7 traffic to Server 2, and
 2/7 traffic to Server 3.  The problematic server is Server 2.

Can you post your configuration for Tomcat's Connectors? Remember to
remove any sensitive information that may be in there.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJVOlWuAAoJEBzwKT+lPKRYHTIQALHGK6IzqAu0dDmRKmluxcAd
7CFKxg1Te3PyJP7+nIhTlHrlTTBwwP8TE/RGdJgsJW0rG8NxApn+UX+TaI9r9srw
apR9hK49zP7KicmJZygGspSFOdmC1KpuXudV19mbLrdmoWRWKWwZs5d4ujUzemSG
wrfSH7ARAhIczkYrLhwIo/V52k2wwD7DAzzGrcVsNWvhCfFjAhF5d/E/NRk1w8tv
xAGAJCmQFUcpxOFqN3i9T63HiLuotv5kXiL/YuTikNEFbeaf/5C8niunYjVNJsaf
Py1kzW/V8+uPmzhklq1paV0o/aQ3W0RROHF8zGn19I9VBmEMTwN00RprXkaAEsbR
ghLb6XlrCaAk1VxsxMUiimKhrscFsIT5aiPaFdci+Ti7szrluAuhk4a27lMgzBFf
Y5KJ7d3S0cch7TWIYMykymsg5yUPAkPCKgHjoxpWMNmnOqyN0ksJgr7Be4ZlNoJQ
BoIRmPbN29v3x59rDnC9pMQ75e1Ua5gisWrzbWV+KrS2kOQKLhAsEc7dRSGJYOV7
ebrSIZ7msqPTfMywB9t54DEUVGFM90MDs0L1xa+nqTGJA/lX5w6iiCOcCiTAzbb5
yqP+DGr3ifEy91QRwEEU2j4wdlH/0Z3k3JuTymFH8D3UlUDjYeOhLQWxJ31gePnL
/r0thS57aPypDbQ+zbqw
=eRCX
-END PGP SIGNATURE-

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



Re: Info: WebSocket connection closed, Code: 1006 when try to run websocket sample

2015-04-24 Thread Thusitha Thilina Dayaratne
Hi,

First I would like to apologize for the inconvenience.
On 4/24/15 7:40 AM, Thusitha Thilina Dayaratne wrote:
 Furthermore I've tried following things out and both options works
 without issue.

 1. Running tomcat distributed examples in my server 2. Running the
 war file that I built inside Tomcat

 I've mistaken here. My war file doesn't run on Tomcat either.


 When I used the following dependency to build the example webapp,
 instead of 302 I'm getting 404 error.

 dependency groupIdjavax.websocket/groupId
 artifactIdjavax.websocket-api/artifactId
 version1.0/version scopeprovided/scope /dependency

 Am I having wrong dependency here? If so what are the dependencies
 that I should include when do the build?

You aren't getting very many responses, here.

The problem is that you are asking for solutions to problems that
nobody understands. You are asking us why doesn't this work, but you
haven't told us what it is.

Imagine that I am writing a web application that needs to process
financial transactions (e.g. DEBIT, CREDIT), and it's not working for
some reason. If I asked you why does my web application return 404,
but didn't provide any code, or any explanation of the architecture,
or any of that, you would have no idea what could possibly be wrong
with my code. It could be simple a configuration problem. It could be
a complete misunderstanding of how a web application works. It could
be a very rarely-seen bug that only occurs when users with an account
number that happens to be a prime number plus one try to do a DEBIT
operation.

So, take a step back.

The Tomcat distributed examples work. That's great: it means that
Tomcat itself is capable of running Websocket applications.

Your application does not work: it seemed to be returning a 302 error
which may suggest that the Websocket library hasn't properly initialized
.

Are you using Tomcat in an embedded way, or are you launching it from
the traditional bin/startup.sh, etc. way? Are you trying to side-load
the Websocket library, or are you expecting that Tomcat will
auto-detect and initialize it? Does your own code include anything
other than servlets that request an upgrade to a Websocket connection
and then do their thing?


Remember that none of us has even a passing understanding of what you
are trying to build, how you are building it, what the Maven
dependencies are (or even mean, in some cases), etc. You need to tell
us all of that to give us some context.

Then we might be able to help you.

I will rephrase my question
I'm using embedded tomcat version 8.0.20. We have created an application
server on top of that and we are packing tomcat provided example webapp
with that.
I get the source of the example webapp in Tomcat (I don't change any code
in that and use that as it is provided) and use Maven in order to build the
sample webapp. In that for websocket I'm using following dependency

dependency
  groupIdjavax.websocket/groupId
  artifactIdjavax.websocket-api/artifactId
  version1.0/version
  scopeprovided/scope/dependency

I've bundle following tomcat websocket dependencies as OSGi bundle and
using that in the server.
dependency
groupIdorg.apache.tomcat.embed/groupId
artifactIdtomcat-embed-jasper/artifactId
version8.0.20/version
optionaltrue/optional
/dependency
dependency
groupIdorg.apache.tomcat/groupId
artifactIdtomcat-websocket-api/artifactId
version8.0.20/version
optionaltrue/optional
/dependency
This OSGi bundle is available with the server.

After building the example webapp, when I try to run the wesocket examples
in that webapp on my server, I'm getting

Info: WebSocket connection closed, Code: 1006


In the browser console it prints (for echo programmatic option in the echo
sample)

WebSocket connection to 'ws://
 10.100.7.26:9763/examples/websocket/echoProgrammatic' failed: Error
 during WebSocket handshake: Unexpected response code: 302


I tried to deploy the same example which is distributed with Tomcat
distribution on my server.
It run on my server without any issue.

Thanks
Best Regards

2015-04-24 19:25 GMT+05:30 Christopher Schultz ch...@christopherschultz.net


 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Thusitha,

 On 4/24/15 7:40 AM, Thusitha Thilina Dayaratne wrote:
  Furthermore I've tried following things out and both options works
  without issue.
 
  1. Running tomcat distributed examples in my server 2. Running the
  war file that I built inside Tomcat
 
  I've mistaken here. My war file doesn't run on Tomcat either.
 
 
  When I used the following dependency to build the example webapp,
  instead of 302 I'm getting 404 error.
 
  dependency groupIdjavax.websocket/groupId
  artifactIdjavax.websocket-api/artifactId
  version1.0/version scopeprovided/scope /dependency
 
  Am I having wrong dependency here? If so what are the dependencies
  that I should include when do the build?

 You aren't getting very many responses, here.

 The problem is that you are asking for 

Re: Tomcat Thread issue

2015-04-24 Thread Subhro Paul


-Subhro Paul subhro.p...@tcs.com wrote: -
To: users@tomcat.apache.org
From: Subhro Paul subhro.p...@tcs.com
Date: 04/23/2015 06:20PM
Subject: Re: Tomcat Thread issue

-Daniel Mikusa dmik...@pivotal.io wrote: -
To: Tomcat Users List users@tomcat.apache.org
From: Daniel Mikusa dmik...@pivotal.io
Date: 04/23/2015 05:01PM
Subject: Re: Tomcat Thread issue

On Thu, Apr 23, 2015 at 7:15 AM, Subhro Paul subhro.p...@tcs.com wrote:

 Dear Team,

 One of our client's website stopped working yesterday. We observed that
 Tomcat servers were not working properly during that time. We have checked
 the memory usage of the server was fine but in the Catalina.out log we
 found it was already reached to max thread which is 512 though the number
 of connections to the server was normal. We took a thread dump from the
 server using VisualVM and we got the below message from threaddump:


Since a thread dump is a point in time snapshot, you should always take
multiple thread dumps, with a few seconds in between each one.  This gives
you additional perspective as to what's happening with the threads over a
period of time.



 http-8080-1 - Thread t@22

    java.lang.Thread.State: BLOCKED

             at java.util.Vector$1.nextElement(Vector.java:320)

             - waiting to lock 37749687 (a java.util.Vector) owned by
 http-8080-116 t@161

             at
 org.apache.jsp.includes.header_jsp.isExcludePath(header_jsp.java:116)

             at
 org.apache.jsp.includes.header_jsp._jspService(header_jsp.java:314)


Look at what header.jsp is doing.  It seems to be doing something with the
Vector class which is causing the thread to block.



             at
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

             at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

             at
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)

             at
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)

             at
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

             at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

             at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

             at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

             at
 org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)

             at
 org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)

             at
 org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)

             at
 org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)

             at
 org.apache.jsp.home.customer_005fservice.bill.my_005fbill_jsp._jspService(my_005fbill_jsp.java:126)

             at
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

             at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

             at
 org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)

             at
 org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)

             at
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

             at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

             at
 org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

             at
 org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

             at
 org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

             at
 org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

             at
 org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

             at
 org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

             at
 org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:269)

             at
 org.apache.catalina.valves.RemoteHostValve.invoke(RemoteHostValve.java:81)

             at
 org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)

             at
 org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

             at
 org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

             at
 org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)

             at
 org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

             at
 org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

             at java.lang.Thread.run(Thread.java:701)



    Locked ownable synchronizers:

 -          None



 This was coming for different threads. 

Re: Tomcat Thread issue

2015-04-24 Thread Felix Schumacher


Am 24. April 2015 09:08:08 MESZ, schrieb Subhro Paul subhro.p...@tcs.com:


-Subhro Paul subhro.p...@tcs.com wrote: -
To: users@tomcat.apache.org
From: Subhro Paul subhro.p...@tcs.com
Date: 04/23/2015 06:20PM
Subject: Re: Tomcat Thread issue

-Daniel Mikusa dmik...@pivotal.io wrote: -
To: Tomcat Users List users@tomcat.apache.org
From: Daniel Mikusa dmik...@pivotal.io
Date: 04/23/2015 05:01PM
Subject: Re: Tomcat Thread issue

On Thu, Apr 23, 2015 at 7:15 AM, Subhro Paul subhro.p...@tcs.com
wrote:

 Dear Team,

 One of our client's website stopped working yesterday. We observed
that
 Tomcat servers were not working properly during that time. We have
checked
 the memory usage of the server was fine but in the Catalina.out log
we
 found it was already reached to max thread which is 512 though the
number
 of connections to the server was normal. We took a thread dump from
the
 server using VisualVM and we got the below message from threaddump:


Since a thread dump is a point in time snapshot, you should always take
multiple thread dumps, with a few seconds in between each one.  This
gives
you additional perspective as to what's happening with the threads over
a
period of time.



 http-8080-1 - Thread t@22

    java.lang.Thread.State: BLOCKED

             at java.util.Vector$1.nextElement(Vector.java:320)

             - waiting to lock 37749687 (a java.util.Vector) owned
by
 http-8080-116 t@161

             at
 org.apache.jsp.includes.header_jsp.isExcludePath(header_jsp.java:116)

             at
 org.apache.jsp.includes.header_jsp._jspService(header_jsp.java:314)


Look at what header.jsp is doing.  It seems to be doing something with
the
Vector class which is causing the thread to block.



             at
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

             at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

             at

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)

             at

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)

             at
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

             at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

             at

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

             at

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

             at

org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)

             at

org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:551)

             at

org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:488)

             at

org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:968)

             at

org.apache.jsp.home.customer_005fservice.bill.my_005fbill_jsp._jspService(my_005fbill_jsp.java:126)

             at
 org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

             at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

             at

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)

             at

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)

             at
 org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)

             at
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

             at

org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

             at

org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

             at

org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

             at

org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

             at

org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

             at

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

             at

org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:269)

             at

org.apache.catalina.valves.RemoteHostValve.invoke(RemoteHostValve.java:81)

             at

org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555)

             at

org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

             at

org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)

             at

org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)

             at

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)

             at

org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

             at java.lang.Thread.run(Thread.java:701)



    Locked ownable