Is it just me or is this ultra-political correctness a new and intresting phenomenon? I'm really interested to watch where it's all going. Pretty much all jokes are going to offend somebody. You can't ask people to smile, comment on thier clothes or belongings. You can't interact causally in the workplace at all. Perhaps we'll see workplaces where all communication is in writing and on topic. Do we want our workplace…
Telling you that your jokes are offensive would indeed be harassment---if you worked at a late night show or another joke-telling profession! Otherwise, no, telling you that your jokes are offensive is in fact not a form of workplace harassment.
Also, you might want to reflect on why making friends, telling jokes, laughing, and enjoying life requires you to say racist and/or sexist things at work.