Did it blow apart or break internally?
You need a 242 or 231 (preferred) with a "medium" length 23 spline input. By medium length I mean the input shaft should stick oit from the seal about .750 inches. 94-95 V8s use the long input that sticks out 1.25 inches from the seal and 96-98 V8 ZJs use the medium length.
Also, make sure depth of the hole in the input is at least 2 inches deep! It does not have to be splined all the way, just 2 inches of depth for the transmission output to fit all the way in. I found a medium length 23 spline 242 and it did not work as the input bore was only an inch or so deep.
On another note you can get away with running a short input on the V8 ZJ. It will only stick out like a quarter of an inch from the seal. You still have an inch of spline engagement and I never broke the one I ran that way. I'd still shoot for a medium input with the proper bore depth.
Are you screwed for transportation while this rig is down? If you need a t-case to get you around I've got a 249 out of my 96 ZJ buggy you can have.