Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349430 - Jetty 7x access jsp file error using ajp protocol
Summary: Jetty 7x access jsp file error using ajp protocol
Status: RESOLVED DUPLICATE of bug 341694
Alias: None
Product: Jetty
Classification: RT
Component: other (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 7.2.x   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-15 09:09 EDT by wangxinsheng CLA
Modified: 2011-06-27 16:41 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description wangxinsheng CLA 2011-06-15 09:09:31 EDT
Build Identifier: 7.3.1.v20110307

  using apache 2.15+mod_jk+Jetty7.3.1 access jsp page,event the jsp file generated  by a txt file such as  linux command of mv a.txt a.jsp. access errors as follow:
[Wed Jun 15 16:37:08.004 2011] [27849:1123723584] [error] ajp_connection_tcp_get_message::jk_ajp_common.c (1312): (local) can't receive the response body message from tomcat, tomcat (127.0.0.1:8009) has forced a connection close for socket 14
[Wed Jun 15 16:37:08.004 2011] [27849:1123723584] [error] ajp_get_reply::jk_ajp_common.c (2085): (local) Tomcat is down or network problems. Part of the response has already been sent to the client
the same error occured on 7.1.6,but when jetty version change to 6.1.22,errors does not occurred!

Reproducible: Always
Comment 1 wangxinsheng CLA 2011-06-16 02:48:14 EDT
While debuging ,I found that  the class of Ajp13Generator has a method which can't executed for the _buffer is not null. the source code as follows:
 private void initContent() throws IOException
    {
        if (_buffer == null)
        {
            _buffer = _buffers.getBuffer(_contentBufferSize);
            _buffer.setPutIndex(7);
            _buffer.setGetIndex(7);
        }
    }

Next step ,the method increaseContentBufferSize in class AbstractGenerator as follows has inited the buffer field.  
 public void increaseContentBufferSize(int contentBufferSize)
    {
        if (_buffer==null)
            _buffer=_buffers.getBuffer();
        if (contentBufferSize > _buffer.capacity())
        {
            Buffer nb = _buffers.getBuffer(contentBufferSize);
            nb.put(_buffer);
            _buffers.returnBuffer(_buffer);
            _buffer = nb;
        }
    }

 the buffer of 6.x has not inited,as follow is jetty6.1.22 source code :
public void increaseContentBufferSize(int contentBufferSize)
    {
        if (contentBufferSize > _contentBufferSize)
        {
            _contentBufferSize = contentBufferSize;
            if (_buffer != null)
            {
                Buffer nb = _buffers.getBuffer(_contentBufferSize);
                nb.put(_buffer);
                _buffers.returnBuffer(_buffer);
                _buffer = nb;
            }
        }
    }
Comment 2 weijx CLA 2011-06-24 05:38:07 EDT
Jetty7.4 fix this bug

https://bugs.eclipse.org/bugs/show_bug.cgi?id=341694
Comment 3 Michael Gorovoy CLA 2011-06-27 16:41:02 EDT
Marking this bug as duplicate of bug 341694. Please re-open if the fix doesn't work in your environment.

*** This bug has been marked as a duplicate of bug 341694 ***