Re: Apache Tomcat jk connector 400 bad request

2015-04-22 Thread Marcos Almeida Azevedo
On Wed, Apr 22, 2015 at 5:18 AM, Razi  wrote:

> hi there,
>
> Another bit of information I wanted to add.
>
> The apache error log is peppered with the following line : OpenSSL : I/O
> error, 5 bytes expected to read on BIO#...
>
> Warm Regards
> Razi A. Ansari
>
>
> From: Razi
> Sent: Tuesday, April 21, 2015 8:37 AM
> To: users@tomcat.apache.org
> Subject: Apache Tomcat jk connector 400 bad request
>
> Hi there,
>
> I would like to explain my scenario, perhaps this has been answered on
> this forum.
>
> A bunch of random Ajax requests from the browser (IE9) end up with a 400
> error code on the apache webserver and the the browser hangs for 5 minutes.
> Httpwatch shows the error code as ERROR_INTERNET_CONNECTION_RESET and then
> immediately afterwards IE fires the same request again, which shows up with
> a time taken of 5 minutes and error code as
> ERROR_HTTP_INVALID_SERVER_RESPONSE. The browser recovers after 5 minutes.
>
> Further investigation on the webserver and appserver logs reveals the
> following::
>   a.. The request comes from the browser and hits the webserver and then
> forwards to the appserver instantly.
>   b.. The mod_jk log for the request shows that there is time duration of
> 5 minutes spent in the ajp_read_fully_server::jk_ajp_common.c(1399): enter.
> After 5 minutes I get the next line as follows
> ajp_read_fully_server::jk_ajp_common.c(1432): exit. Then in the next line i
> see the following ajp_send_request::jk_ajp_common.c(1766) worker 11 browser
> stop sending data, no need to recover. Later it shows unrecoverable 400,
> request failed.
>   c.. The forensic.log show the content length as a nonzero value.
>   d.. The applcation server log hangs in the
> org.apache.coyote.ajp.AjpProcessor.read method for 5 mintues and the
> continues the execution. The thread dump also confirms this.
> The questions I have are::
>   a.. Is this a problem with IE only because of the keepalive timeout and
> the apache webserver keepalive time(current value is set to 5seconds) out
> which is not in sync.
>   b.. Is this a problem with the appserver not able to process requests
> that are bad/incomplete.
>   c.. Should I increase the Apache webserver timeout value to 60s or more
> , will this have any performance impact.
> Kindly advise on the scenario. Many thanks for reading through.
>
> Current setup:
> Apache 2.2.24
> Mod_jk 1.2.37
> Redhat Linux VM
> JBoss EAP 6.1.0
> JSF 2.1, Richfaces 3.3.4
>
>
First, I apologize if my comment is offtopic.  But you may also consider
fronting nginx instead of Apache httpd.  It is very easy to configure as
reverse proxy for your tomcat and also serve your static files.  If Apache
is really a requirement kindly ignore my comment


>
>
>
> Warm Regards
> Razi A. Ansari
>



-- 
Marcos | I love PHP, Linux, and Java



Re: Tomcat - thread dies randomly

2015-03-30 Thread Marcos Almeida Azevedo
On Sun, Mar 29, 2015 at 5:17 PM, Madhur Ahuja 
wrote:

> We have built a messaging server using PubNub which listens for chat
> messages from Android device.
> For this, our J2EE based spring, we have created a Pubnub listener (which
> is basically a listening socket)
> as follows. However, we have observed is that our server stops listening
> randomly after few days. The
> Tomcat keeps working fine, but just the socket stops listening. There is
> not error in logs.
>
> Can anyone help in diagnosing this issue? Specifcally, I want to ensure
> that the below design to initiate a listener is durable and not prone
> to errors.
>

Seems the issue is with your application not Tomcat. Maybe try WebSocket?


>
> public class IncomingListener implements ApplicationListener <
> ContextRefreshedEvent > {
>
> @Override
> public void onApplicationEvent(ContextRefreshedEvent event) {
>
> private static volatile boolean isContextLoaded = false;
>
> @Autowired
> ServletContext application;
>
> synchronized(IncomingListener.class) {
>
> if (isContextLoaded) {
> System.out.println("WTF: Not initializing incoming
> listener");
> return;
> }
> try {
> initialiseIncomingListener();
> isContextLoaded = true;
> } catch (JSONException e) {
> e.printStackTrace();
> } catch (AkoshaException e) {
> e.printStackTrace();
> }
>
> }
> }
>
> private void initialiseIncomingListener()
> {
>  // Initialize our Pubnub Listener
>
>  pubnub.subscribe(serverchannel, new Callback() {
>
>  // Subscribe to pubnub
> });
> }
> }
>



-- 
Marcos | I love PHP, Linux, and Java