> props.put (Context.PROVIDER_URL,"localhost:1099");
First, you would need to use something other than localhost since that will point to the computer the applet is running on, rather than the server computer. (I assume there is something in the applet classes that gives the servers name, or at least ip address.)
But, I think the simplest way to let a applet communicate with an EJb is to do it via a servlet. The servlet can be connected by its URL, and the applet and servlet can communicate with serialized java objects. The servlet can then do the calls to the EJB. The advantage with this is that the servlet does not need to have access to the EJB interfaces. In addition, if the applet would be running behind a firewall it would probably not be able to connect the EJBs, but able to connect to the web server.