Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 363943 - NPE with mod_jk 1.2.32 and no load balancing
Summary: NPE with mod_jk 1.2.32 and no load balancing
Status: RESOLVED FIXED
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 7.5.x   Edit
Assignee: Jan Bartel CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-16 12:19 EST by Mike Hurd CLA
Modified: 2011-11-27 22:09 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Hurd CLA 2011-11-16 12:19:49 EST
Build Identifier: 6.1.x

When using the latest version of mod_jk (1.2.32) to connect to a jetty service 6.1 or later we receive a NullPointerException in the  RequestHandler class.

java.lang.NullPointerException
        at org.eclipse.jetty.ajp.Ajp13Connection$RequestHandler.parsedRequestAttribute(Ajp13Connection.java:215)
        at org.eclipse.jetty.ajp.Ajp13Parser.parseNext(Ajp13Parser.java:406)
        at org.eclipse.jetty.ajp.Ajp13Parser.parseAvailable(Ajp13Parser.java:150)
        at org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:411)
        at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:241)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:529)
        at java.lang.Thread.run(Thread.java:722)

This is happening because in the newest mod_jk a request attribute, 'JK_LB_ACTIVATION',  was added. When the Apache server is not configured to use the mod_jk load balancing, the value of JK_LB_ACTIVATION comes in as a null.

We have tested various version of Jetty from 5.1.x through 8.0.0.M3 and the problem consistently occurs whenever the latest mod_jk is used.

Is anyone else seeing this issue? Due to company driven security patches, we are required to use the latest mod_jk connector. So any help here would be greatly appreciated.

Thanks!
Mike

Reproducible: Always

Steps to Reproduce:
1. Setup Apache with mod_jk version 1.2.32 connector
2. Don't set up load balancing
3. Setup Jetty service (any version - we tried 5.1.x, 6.1.x, 7.x.x, 8.x.x)
4. Will get NPE
Comment 1 Jan Bartel CLA 2011-11-16 16:27:08 EST
Mike,

Can you capture an AJP13 packet that demonstrates this and attach it in some form to this issue? What I am interested in is how the null value for the attribute is represented ... does it have 00 as the length field for the value string?

thanks
Jan
Comment 2 Mike Hurd CLA 2011-11-22 12:04:43 EST
One of our network people dumped this... Not sure if it is what you're looking for...

From the webserver:   

.4.z....HTTP/1.1.../auditn/..
10.1.91.17.....dev.service.com..P..
....dev.service.com....pMozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.22) Gecko/20110902 Firefox/3.6.22 ( .NET CLR 3.5.30729)....?text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8...Accept-Language...en-us,en;q=0.5...Accept-Encoding...gzip,deflate...Accept-Charset...ISO-8859-1,utf-8;q=0.7,*;q=0.7..
Keep-Alive...115....
keep-alive.....__utma=152775858.767331099.1316635255.1316635255.1316635255.1; __utmz=152775858.1316635255.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none).....0.
..AJP_REMOTE_PORT...53731.
..JK_LB_ACTIVATION....

Response back from the backend
HTTP/1.1 400 Bad Request

Connection: close

Server: Jetty(6.1.11)
Comment 3 Greg Wilkins CLA 2011-11-27 22:09:44 EST
Mike,

I have updated the jetty code to treat a null value as an attribute removed.
However I don't currently have time to actually check this against the latest mod_jk.

This is in HEAD of master and is available in the latest snapshot build at https://oss.sonatype.org/content/groups/jetty-with-staging/org/eclipse/jetty/jetty-distribution/7.6.0-SNAPSHOT/

It will also be in the 7.6.0.RC0 release out in the next few days.

If you could test, that would be much appreciated.


[ note also that mod_proxy_http is a much faster way of talking apache to jetty ]