Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341694 - ajp component not work
Summary: ajp component not work
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: 7.2.2   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 7.2.x   Edit
Assignee: Greg Wilkins CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 349430 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-04-02 06:45 EDT by weijx 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 weijx CLA 2011-04-02 06:45:51 EDT
Build Identifier: jetty7.3.1

I use apache httpd server with module_jk and jetty, but I can not access app from apache httpd server which deployed in jetty.

I see the Ajp13Generator.java file and find that the _buffer field must have 7 bytes before real data. 

the super class will init _buffer field some time ,but without 7 bytes before, this method is :

    /**
     * @return Returns the contentBufferSize.
     */
    public int getContentBufferSize()
    {
        if (_buffer==null)
            _buffer=_buffers.getBuffer();
        return _buffer.capacity();
    }

    /* ------------------------------------------------------------ */
    /**
     * @param contentBufferSize The contentBufferSize to set.
     */
    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;
        }
    }

I inherit Ajp13Generator.java and override the method below: 

    public void increaseContentBufferSize(int contentBufferSize)
    {
       // do nothing
    }
    
    public int getContentBufferSize()
    {
    	initContent();
    	return _buffer.capacity();
    }

so I can access app from apache httpd server, so yours must init _buffers Correctly in Ajp13Generator.

class: org.eclipse.jetty.ajp.Ajp13Generator
field: _buffers


Reproducible: Always
Comment 1 Greg Wilkins CLA 2011-04-06 18:24:48 EDT
I've applied a similar fix for 7.4.0

thanks
Comment 2 Michael Gorovoy CLA 2011-06-27 16:41:02 EDT
*** Bug 349430 has been marked as a duplicate of this bug. ***