Wednesday, June 23, 2010

Hard to Debug Tomcat JK Connector Problem

If you try to open a page in Liferay (or any J2EE app) and only see "The data area passed to a system call is too small", chances are you're using IIS and the Tomcat IIS Connector library in front of your J2EE server.  The problem is that the url is too long.  Because Liferay uses the longest urls in the universe I had a similar problem with the Pound reverse proxy, but at least Pound told me what the problem was in the error message ("Error: request URL too long" or something like that).  Naturally, you won't get messages about this in your logs because the request gets stopped before tomcat even sees it.

Here is a mailing list thread about this from 2009.  Basically, it looks to me like the apache guys are misinterpreting the variable INTERNET_MAX_URL_LENGTH from WinInet.h as including the maximum query string length when it is only intended to represent the url before the query string (the protocol, the "://" protocol/domain/path seperator, and the path).  So urls which are valid for IIS can have really long query strings which cause them to break isapi_redirect.dll.  I fixed this by adding a macro (#define ISAPI_MAX_URL_LENGTH 4096) then replacing every occurrence of INTERNET_MAX_URL_LENGTH with ISAPI_MAX_URL_LENGTH and it appeared to work fine.  I'm not a security expert though, I might have opened an exploitable hole.  Point is, it works better now.

If you're not using IIS, I have no idea.

Thursday, June 10, 2010

Liferay JSP Wrapping

The best tip from the east coast developer's thing was about overridding just part of JSPs in ext or a hook if you're modifying the appearance of the liferay core.  Apparently the info was already out there.  I think it should be publicized better, so go read this jsp hook tidbit and it will make future upgrades easier on you if you're modifying the core: Do you need to override JSPs?

Thursday, June 03, 2010

Idea for SUVs

A sun/rain shade that can pop out of the rear hatch w/ when it's raised all the way to make loading groceries in the rain easier and make tailgating more comfortable.  Something like the material in the popup tents that are so common now except it'd just be an extra foot or two of shielding on the perimeter of the hatch and not a wholly separate thing.  It'd have to retract automatically too to be useful in the rain.