The problem you are running into is that ejabberd's BOSH endpoint can only be used to connect to ejabberd's XMPP service. You can't use ejabberd's BOSH to connect to jabber.org.
The service I run at bosh.metajack.im is using Punjab, which is a standalone BOSH connection manager, and it can be used to connect to any publicly accessible XMPP server.
To read more about the differences, see
and also the notes in Appendix B in the book.