If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Drag the stack out by using e.printStackTrace() instead. Also, never pull the toString off of the exception's getMessage; it is possible for that to be null.
Once you have the stack it should give you the line number. Since there are several items here that can throw exceptions you need to determine which it is. To me the only one that makes sense is the split method. The array itself would have one result even on an empty string, but if the string is null to start with than you cannot split it.
You can also place a breakpoint on the try and walk it through a debugger to confirm.

Yep, you bet.
You can simplify it as well by converting a collection out of it. Collections can be shuffled, so you could simply convert the array to a list, and then shuffle the list and pull the first item.