ESPN's trade machine won't approve of this but it works if you calculate everything longhand considering exceptions, partial guarantees, etc.
The only hole I see is possibly Denver giving up one too many draft picks, even though it buys them a ton of cap room for the next to FA seasons.
Denver receives: Cap space & huge future salary relief
Jazz receive Kevin Martin, Al Harrington, #14 or 16 from Houston & 2014 NYK first (via Denver).
Houston receives Big Al, Arron Afflalo, Chris Anderson, #20 from Denver
Houston swaps Martin's expiring for a more useful expiring, and get's an all around stud in Afflalo to replace the SG void. They take on salary (which they can afford) and drop a few spots in the draft.
Denver looks to be giving up a lot until you start calculating their salary situation. Nuggets have a little over $51,000,000 in committed salary during the 2013/14 season, and that's before paying JaVale McGee this year and & Ty Lawson next. Those two will probably fetch something like 11 and 9, respectively. Is that a team any GM wants to pay $71,000,000+ to? Take out AA, Harrington, Anderson, and the #20, and the Nuggets have $44mm in payroll.
Al Harrington's deal looks awful--3 more years left at $6.7, $7.15, and $7.6. Only 50% of the last two years are guaranteed, however, and buying him out wouldn't be terribly painful or any meaningful hit to cap room. Harrington can still produce and wouldn't be a bad 2nd or 3rd string situational guy to have on the bench.
Even with the Harrington buyout and a #14 or 16 rookie scale, this deal still only brings the Jazz up to $29 mm in salary in 2013/2014. Millsap will be offered $10 to $11mm, so add that on if necessary. This leaves the Jazz with plenty of room to go out and get that extra piece in FA.
In addition, that NYK pick is unprotected and could end up being golden.
The only hole I see is possibly Denver giving up one too many draft picks, even though it buys them a ton of cap room for the next to FA seasons.