Most webhosting packages only allow to host static HTML pages and CGI (PHP, Perl) scripts. Some provide JSP and JSF support but those are more expensive than regular webhosters.
If you want to code your own webserver/socket applications in java you need a root server package (I, for example, use a vServer for €12,99/month)
On such server you have direct root access to the machine, where you can install any software you want - so you just have to install the java runtime engine of your choice and you are good to go (assuming the server's firewall is set correctly) - with a dedicated IP address you can directly connect to your servers java programs.